Sign in to follow this  
Followers 0

New SciTE4AutoIt3 available with SciTE v2.27

138 posts in this topic

Posted (edited)

7/3/2011: Uploaded a new SciTe4AutoIt3.exe installer with the new SciTE v2.27 release.

IMPORTANT: This version doesn't have support for the ANSI version of AutoIt3 anymore since that is removed from AutoIt3.

Here are a couple of major changes:

- Updated our version of SciTE from 1.79 to 2.27.

- Tidy now supports UTF8&16 files

- AutoIt3Wrapper can now produce both the x86 and x64 compiled version of a script.

Enjoy,

Jos

Addition/Chnages/Fixes in the current installer:

--------------------------------------------------------------------------------------------------
7/03/2011
*** Merged the updates of SciTE v 2.27 by Neil Hodgson with our own version of SciTE. (Jos)
    - Fixed AutoItTools.lua to remove CR & LF from selected variable for debug statements.
    - Fixed AutoItTools.lua to ensure the PROPER funct is only ran when one of these characters is typed: "[ =(]".
	- Fixed Jump-to-Func in AutoItGotoDefinition.lua so it aloso works when there is a comment after the #include statement.
*** Updated AutoIt3Wrapper_Gui/AutoIt3Wrapper v2.0.3.0 (Jos)
    - Added support for UTF files. (jchd)
	- Added #Autoit3Wrapper_compile_both to compile both version of an EXE (x86&x64).
	- Added #Autoit3Wrapper_outfile_x64.
	- Added %outx64% to the replace variables.
    - Added #AutoIt3Wrapper_run_debug=Off/On
    - Added #AutoIt3Wrapper_res_compatibility=Windows7,Vista
    - Updated AutoIt3Wrapper to properly support RT_STRING resource input via INI file input. (Wraithdu)
    - Fixed a GUI change counter when cvsWrapper isn't installed resulting in updates of the sourcecode.
    - Fixed regex for handling multiple spaces infront of Directives
    - Updated the generated directives section to better remove old lines.
    - Change stringreplace to regex for header and footer of Autoit3wrapper gui.
*** Updated Tidy.exe v2.2.1.0 (Jos)
    - Removed the 4096 record limit.
    - Added support for UTF8 with BOM files.
    - Added option /region_indent or /ri which will indent #region-#endregion sections.
    - Set variable name case for variables as defined in the Constants included files.
       Parameter /prc or /properconstants support is added for this function because it will slow down the Tidy process and by default it is off.
       e.g.: #Tidy_Parameters=/prc=1
       Tidy.ini:
        [ProgramSettings]
        * * * (tabchar) Indent setting: 0 = Tabs > 0 = Number of Space
        tabchar = 0
        * * * Update Functions / Keywords / Macros / UDFs To Proper Case
        proper = 1
        * * * Update Constants defined in the "constant Include files"
        properconstants = 0
    - Fixed proper casing Keywords when they "look like a Function" e.g. switch ($a=1)
    - Fixed space removal after ( when /Delim=0
    - Fixed space addition Between sting and closing brace in case of a Dot after the Brace.
*** Updated Obfuscator.exe v1.0.29.0 (Jos)
    - Fixed assign/execute warnings in case parameter /sf=1 is specified.
    - Fixed multi layer #CS / #CE
    - Added support for #OnAutoItStartRegister
    - Added skip for #noautoit3execute to ensure it stays in the obfuscated script
    - Fixed mem corruption when long records are used in Func's
    - Fixed made the variables in the decode funcs random to avoid false positives.
    - Added Check for #Obfuscation_Off & On when scanning for FUNC names to avoid Obfuscation of this func
*** Updated SciTEConfig v1.6.8.0
    - Updated Run/Edit option to also update the beta hive in the registry. (Jos)
	- Added option to modify the selected line fore/background and opage settings. (Melba23)
*** Updated Koda v 1.7.3.0 (lazycat)
   - Release 1.7.3.0 build 252 (2010-07-30)
*** Updated csnippet 1.0.5.13 (GeoSoft)
	- Updated the source to ensure it works again in the current release.
*** Added Get_AU3_RegistrySettings.au3 which will list the current reg settings and can be used to find issue.
--------------------------------------------------------------------------------------------------

==> ScitillaHistory page containing all SciTE/Scintilla updates.

==> Visit the SciTE4AutoIt3 Download page for the latest versions

==> Check the online documentation for an overview of all extra's you get with this installer.

Edited by Jos

Share this post


Link to post
Share on other sites



Posted (edited)

Looking god good Jos!

Hey, while I'm here, you know a lot about stuff... And crap.... And other stuff. What would it take to make the SciTE console readable from AutoIt? We had a short discussion on it in (<--- link) thread.

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

Posted

It's looking great the long awaited new version and I've started to get the errors about Eval() being used ;) No biggy I just have to be a little more intelligent in my coding style as I've never been a fan of Eval() anyway :)

Share this post


Link to post
Share on other sites

Posted

Hey, while I'm here, you know a lot about stuff... And crap.... And other stuff. What would it take to make the SciTE console readable from AutoIt? We had a short discussion on it in (<--- link) thread.

Something for you to play with:

Opt("WinSearchChildren", 1)
#AutoIt3Wrapper_UseX64=n
Global $WM_COPYDATA = 74
; Get SciTE DirectorHandle
$Scite_hwnd = WinGetHandle("DirectorExtension")
; Get My GUI Handle
Global $My_Hwnd = GUICreate("AutoIt3-SciTE interface")
;Register COPYDATA message.
GUIRegisterMsg($WM_COPYDATA, "MY_WM_COPYDATA")
;
For $x = 1 To 10
	ConsoleWrite($x & @CRLF)
Next
ConsoleWrite("clear output in 1 sec" & @CRLF)
Sleep(1000)
SendSciTE_Command($My_Hwnd, $SciTE_hwnd,"menucommand:420") ; Clear Output pane "IDM_CLEAROUTPUT"
ConsoleWrite("cleared" & @CRLF)
SendSciTE_Command($My_Hwnd, $SciTE_hwnd,"menucommand:409") ; Hide console "IDM_TOGGLEOUTPUT"
For $x = 1 To 10
	ConsoleWrite($x & @CRLF)
Next
Sleep(200) ; give a little time for the console output to appear
;
; get current info in output pane:
; Retrieve all text from the SciTE control and convert to Binary Using Unicode
$Output = StringToBinary(ControlGetText("[CLASS:SciTEWindow]","","Scintilla2"),2)
; Translate back to ANSI text
$Output = BinaryToString($Output,1)
; Strip ending 00 plus extra chars
$Output = string($Output)
;
Msgbox(0,"Current OutputPane info",$Output)
Exit
;
; Send command to SciTE
Func SendSciTE_Command($My_Hwnd, $Scite_hwnd, $sCmd)
	Local $My_Dec_Hwnd = Dec(StringRight($My_Hwnd, 8))
	$sCmd = ":" & $My_Dec_Hwnd & ":" & $sCmd
	ConsoleWrite('-->' & $sCmd & @lf )
	Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
	DllStructSetData($CmdStruct, 1, $sCmd)
	Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
	DllStructSetData($COPYDATA, 1, 1)
	DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1)
	DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
	DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $Scite_hwnd, _
			'Int', $WM_COPYDATA, 'HWnd', $My_Hwnd, _
			'Ptr', DllStructGetPtr($COPYDATA))
EndFunc   ;==>SendSciTE_Command
; Received Data from SciTE
Func MY_WM_COPYDATA($hWnd, $msg, $wParam, $lParam)
	Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr',$lparam)
	$SciTECmdLen = DllStructGetData($COPYDATA, 2)
	Local $CmdStruct = DllStructCreate('Char['&$SciTECmdLen+1&']',DllStructGetData($COPYDATA, 3))
	$SciTECmd = Stringleft(DllStructGetData($CmdStruct, 1),$SciTECmdLen)
	ConsoleWrite('<--' & $SciTECmd & @lf )
EndFunc   ;==>MY_WM_COPYDATA

Share this post


Link to post
Share on other sites

Posted

It's looking great the long awaited new version and I've started to get the errors about Eval() being used ;) No biggy I just have to be a little more intelligent in my coding style as I've never been a fan of Eval() anyway :)

What errors do you get because you are a tiny bit vague here? ;)

Share this post


Link to post
Share on other sites

Posted (edited)

I'm not really reporting it as a problem since I was planning to find a workaround. :) But upon further inspection of the error it appears it's the Eval()'s that are contained within WinAPIEx.au3 or more specific the Function is __Def().

Error Output:

- Iteration 1 Strip Functions result: Output  5162 lines and stripped 10392 lines
-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsAF23.tmp(3638,1) Warning for line:If $__WINVER >= Eval('iVer' & $i) Then 

-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsAF23.tmp(3639,1) Warning for line:Return Eval('iVal' & $i) 

-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsAF23.tmp(3642,1) Warning for line:Return Eval('iVal' & $Count) 

-#############################################################################################
-#### Obfuscator Found   3 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- Iteration 2 Strip Variables result: Output  1665 lines and stripped 3445 lines
-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsD876.tmp(189,1) Warning for line:If $__WINVER >= Eval('iVer' & $i) Then 

-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsD876.tmp(190,1) Warning for line:Return Eval('iVal' & $i) 

-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsD876.tmp(193,1) Warning for line:Return Eval('iVal' & $Count) 

-#############################################################################################
-#### Obfuscator Found   3 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- Iteration 3 Strip Variables result: Output  1601 lines and stripped 64 lines
-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsDB93.tmp(133,1) Warning for line:If $__WINVER >= Eval('iVer' & $i) Then 

-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsDB93.tmp(134,1) Warning for line:Return Eval('iVal' & $i) 

-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by the Call() statement.
>### current Func: __Def
C:\Users\GUINNESS~1\AppData\Local\Temp\OBsDB93.tmp(137,1) Warning for line:Return Eval('iVal' & $Count) 

-#############################################################################################
-#### Obfuscator Found   3 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- Iteration 4 Strip Variables result: Output  1598 lines and stripped 3 lines
+> Source    42989 lines 2165681 Characters.
+> Stripped  13904 Func/Var lines and  27359 comment lines, Total 2099124 Characters.
+> Saved     95% lines 96% Characters.
+> Obfuscator v1.0.29.0 finished created:C:\Test_Obfuscated.au3

Edit: I wasn't getting this error when using Obfuscator V1.0.28.7

Edited by guinness

Share this post


Link to post
Share on other sites

Posted

Edit: I wasn't getting this error when using Obfuscator V1.0.28.7

The warning is a little misleading and I will look at that, but the warning is all about the fact that the Eval() refers to a Variable that Obfuscation cannot figure out and potentially contains a variable from a "Global Const" line that it will strip.

Hope that made sense. :)

Share this post


Link to post
Share on other sites

Posted

No I understood it! And I've looked at APIConstants.au3 but somehow I can't see why the error would exist. Or maybe I'm looking at it with tired eyes?! :)

Share this post


Link to post
Share on other sites

Posted

No I understood it! And I've looked at APIConstants.au3 but somehow I can't see why the error would exist. Or maybe I'm looking at it with tired eyes?! :)

mmm.. you say you understand but still wonder why you get this Warning/Error?

The warning really should say and will in the next verion of Obfuscator:

-### StripOnly/StripFunc Error: Found Eval() statement using unsolvable variable, which will/could lead to removal of Global Const definition for this variable.

Share this post


Link to post
Share on other sites

Posted (edited)

Bad explanation and wasn't thinking logically. I understood the error but couldn't figure out how I could change the Function and suppress the Error too, but then I came up with this update after I drank some coffee ... :)

Func __Def($iVer1, $iVal1, $iVer2, $iVal2, $iVer3 = Default, $iVal3 = Default, $iVer4 = Default, $iVal4 = Default)
	Local $aVal[5] = [4, $iVal1, $iVal2, $iVal3, $iVal4], $aVer[5] = [4, $iVer1, $iVer2, $iVer3, $iVer4]

	Local $iCount = $aVer[0]

	For $i = 1 To $iCount
		If $__WINVER >= $aVer[$i] Then
			Return $aVal[$i]
		EndIf
	Next
	Return $aVer[$iCount]
EndFunc   ;==>__Def

Thanks Jos.

Edited by guinness

Share this post


Link to post
Share on other sites

Posted (edited)

Is it ok to post SciTE LUA stuff here as well?

I've updated my scripts for word highlighting in SciTE a la Notepad++. The new version allows to set a mode where any highlighted text is marked throughout the file, not just a whole word. In this mode, you can configure the minimum length of selected text to highlight. Here we go:

SciTEUser.properties settings

#global enable [0|1, def=1]
highlight.sel.text=1
#whole word mode [0|1, def=1]
highlight.whole.word=0
#min selected text length [integer, def=2]
highlight.min.length=2

LUA script

(mine is loaded from its own file, so modify SciTEStartup.lua accordingly)

MyTools = EventClass:new(Common)

function MyTools:OnStartup()
	-- class property to hold active marker state so we only update when necessary
	self.bMarkersActive = false
	-- class property to indicate programatic marker clearing and avoid double UI update
	self.lastSelText = ""
	-- initialize missing props
	if props['highlight.sel.text'] ~= '0' and props['highlight.sel.text'] ~= '1' then
		props['highlight.sel.text'] = '1'
	end
	if props['highlight.whole.word'] ~= '0' and props['highlight.whole.word'] ~= '1' then
		props['highlight.whole.word'] = '1'
	end
	if props['highlight.min.length'] == '' then
		props['highlight.min.length'] = '2'
	end
end

function MyTools:OnUpdateUI()
	if props['highlight.sel.text'] == '1' then
		local selText = editor:GetSelText()
		-- check if selection has changed, update accordingly
		if selText == self.lastSelText then
			return false
		else
			self.lastSelText = selText
		end
		--print('update')
		local selStart = editor.SelectionStart
		local selEnd = editor.SelectionEnd
		-- check if selected text is an allowed word
		if selStart ~= selEnd and self:IsWord(selText) then
			-- check for word boundaries at ends of selection
			if props['highlight.whole.word'] == '0' or (not self:IsWord(string.char(editor.CharAt[selStart-1])) and not self:IsWord(string.char(editor.CharAt[selEnd]))) then
				self:markOccurrences(selText)
			else
				self:clearOccurrences()
			end
		else
			self:clearOccurrences()
		end
	end

	return false
end

function MyTools:IsWord(word)
	if props['highlight.whole.word'] == '1' then
		-- look for anything not allowed
		local find = string.find(word, '[^%a%d_$#@.]')
		if find == nil then
			return true
		else
			return false
		end
	else
		-- return true if selection length is >= highlight.min.length and no new lines
		local find = string.find(word, '[\r\n]')
		if find == nil and string.len(word) >= tonumber(props['highlight.min.length']) then
			return true
		else
			return false
		end
	end
end

function MyTools:clearOccurrences()
	if self.bMarkersActive then
		--print('clearing')
		scite.SendEditor(SCI_INDICATORCLEARRANGE, 0, editor.Length)
		self.bMarkersActive = false
	end
end

function MyTools:markOccurrences(selText)
	self:clearOccurrences()
	-- set flag markers are active
	self.bMarkersActive = true
	-- set indicator style
	local curIndic = 0
	scite.SendEditor(SCI_SETINDICATORCURRENT, curIndic)
	scite.SendEditor(SCI_INDICSETALPHA, curIndic, 255)
	scite.SendEditor(SCI_INDICSETUNDER, curIndic, true)
	scite.SendEditor(SCI_INDICSETSTYLE, curIndic, INDIC_ROUNDBOX)
	scite.SendEditor(SCI_INDICSETFORE, curIndic, 0xFFF55D)
	-- set search flags
	--local flags = SCFIND_WHOLEWORD
	local flags = 0
	-- find each occurrence of the word and set the indicator range
	local s,e = editor:findtext(selText, flags, 0)
	while s do
		scite.SendEditor(SCI_INDICATORFILLRANGE, s, e - s)
		s,e = editor:findtext(selText, flags, e+1)
	end
end
Edited by wraithdu
Manadar and jaberwacky like this

Share this post


Link to post
Share on other sites

Posted

Something for you to play with:

I was hoping for something more console'y. That's going to fail catastrophically in a SciTE-less environment (like cmd.exe)

Share this post


Link to post
Share on other sites

Posted (edited)

I was hoping for something more console'y. That's going to fail catastrophically in a SciTE-less environment (like cmd.exe)

:) I am confused but could be because it is still early:

Your Question:What would it take to make the SciTE console readable from AutoIt?

My Answer:Example Script to read the SciTE Output Pane.

Your reply:Need to work in a SciTE-less environment too.

;)

Edited by Jos

Share this post


Link to post
Share on other sites

Posted

It sounds like what he actually wants is to be able to glom on to the parent process's standard input/output.

Share this post


Link to post
Share on other sites

Posted (edited)

Like when you compile as a console-app.

Like if you're doing

input = raw_input("say something\n")
print input

in Python

It could be useful to test console-apps without compiling.

Edit: What ProgAndy said!

Edited by AdmiralManHairAlkex

Share this post


Link to post
Share on other sites

Posted (edited)

In AutoIt, you'll have to do something like $STDIN = _WinAPI_GetStdHandle(0) and then _WinAPI_ReadFile. The problem ist the AutoIt3Wrapper which does not forward input data I think. It should be modified to use $STDIO_INHERIT_PARENT

Edited by ProgAndy

Share this post


Link to post
Share on other sites

Posted

I encountered a small problem with the new SciTE version:

When I type

$a.Email
$a. is in red and Email in blue.

But when I type

$a[1].Email
The "E" is in blue but the rest ("mail") becomes black.

I'm running SciTe 2.27on Windows 7.

On Scite 1.79 I don't see this behavior.

Share this post


Link to post
Share on other sites

Posted

And to add to that, when I type this:

$var.something.Else()

The '.E' is red. The second item has to begin with 'E' or 'e'. I think it's confusing it for scientific notation?

Share this post


Link to post
Share on other sites

Posted

And to add to that, when I type this:

$var.something.Else()

The '.E' is red. The second item has to begin with 'E' or 'e'. I think it's confusing it for scientific notation?

This is indeed what is happening and linked to the usage of the squarebrackets in the example.

Will have a look to see how to fix this.

Jos

Share this post


Link to post
Share on other sites

Posted (edited)

While you are looking at it Jos you might also want to look at @Year (third line) in this one.

$sFile = @ScriptFullPath
$iFileDate = Number(StringTrimRight(FileGetTime($sFile, 1, 1), 2))
$iNowDate = Number(@YEAR & @MON & @MDAY & @HOUR & @MIN)
$iDiff = $iNowDate - $iFileDate
;MsgBox(0, "File Time", $iFileDate & @CRLF & $iNowDate & @CRLF & @CRLF & $iDiff)
If $iDiff >= 5 Then
	MsgBox(0, "Result", "The file " & $sFile & " is older than 5 minutes.")
EndIf

@Year is Black while the other Macros are pink.

I only noticed it because I haven't gotten around to putting in my custon highlighting yet.

Edit: Actually I just ran another test and it's the @YEAR macro that isn't being picked up at all.

Edited by GEOSoft

Share this post


Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this  
Followers 0