Leaderboard
Popular Content
Showing content with the highest reputation on 11/24/2016 in all areas
-
Hello, I´m using AutoIt for a long time not only to automate applications but to develop complex stand-alone applications. I am particularly annoyed by the fact that the logic in AutoIt is difficult to separate from the presentation and the standard GUI elements are very inflexible. If you want to create something more sophisticated, you have to use GDI and write many lines for simple effects or animations. With these thoughts in mind, I looked around for alternatives and unfortunately found nothing that corresponded to my ideas. Therefore, I have thought of a different solution. I have created this framework in order to separate the logic from the presentation and to use HTML & CSS in my GUI to the full extent. Goals of the Framework MVC development with AutoIt HTML & CSS GUI in AutoIt Better and more modern package system(UDF) like npm CLI support like Laravel Artisan faster and more structured application development roma() is strongly inspired by Laravel PHP Framework so Laravel users will notice many similarities. Support Unfortunately, I do not have much time for the project at the moment. So I thought to myself, I share it and ask you for support. Content The framework primarily serves for the development of stand-alone applications. All necessary settings are preconfigured. You can start immediately with the logic or the view All settings are in one place The logic(controller) and the presentation are clearly separated from each other Development with MVC structure You can develop the GUI in realTimer without restarting AutoIt GUI can be developed in HTML & CSS Any graphic & video integration is possible (.png, .gif etc.). Also everything that is possible in HTML5 and CSS3 JavaScript & Frameworks are supported Debug logs are created including console output It is possible to work with multiple languages All UDFs are contained in the framework. Reloading is not necessary The AutoIt UDFs are also included in the Framework. This ensures that it workds correctly for different Versions of AutoIt The framework also provides functions that are necessary for communication between AutoIt and HTML. For example, evaluation of form data (GET & POST) (documentation for this and examples follow.) I also developed a template engine. (Similar to Laravel Blade) The template engine supports if statements (would like to have help to make loops possible). In the Future I will publish a complete documentation of the template engine and examples. Almost finished is a database package. This makes communication with databases an absolute child's play. So that was it for once. If something else occurs to me, I will update the list. Small Example url: http://localhost:8080/welcome ;application.au3 ;----------------------------------------------------------------------------------------------/ ; Initial ;----------------------------------------------------------------------------------------------/ #include 'vendor\initial.au3' func _roma_routes() ;----------------------------------------------------------------------------------------------/ ; GET Request ;----------------------------------------------------------------------------------------------/ $route_get('welcome', 'welcome') endfunc ;roma\controller\welcome.au3 ;----------------------------------------------------------------------------------------------/ ; Welcome Controller ;----------------------------------------------------------------------------------------------/ func controller_welcome() Local $name = 'Eduard', $lastname = 'Tschernjaew' ;----------------------------------------------------------------------------------------------/ ; passed variable to view (Array are possible) ;----------------------------------------------------------------------------------------------/ $toView('name', $name) $toView('lastname', $lastname) ;----------------------------------------------------------------------------------------------/ ; Return a View ;----------------------------------------------------------------------------------------------/ return $VIEW('welcome') endfunc <html> <head> <title>roma() - Template Test</title> </head> <body> <h1>Hello {{ $name }} {{ $lastname }}</h1> </body> </html> Download The framework is under the Open-Source license. Github: https://github.com/4ern/roma/ git clone https://github.com/4ern/roma.git or download the ZIP. Documentaion: https://github.com/4ern/roma/blob/master/README_EN.md ToDo [ ] Loop Funktion in Template.au3 [ ] CLI module like Laravel Artisan [ ] Solution approaches, how the framework can be optimally compiled, so that in the compiled state all files are available. [ ] Framework Tests & Bugfixes roma() is still in development. Documentation and application examples will soon be available. I am looking forward to any Contributing. Thanks for Feedback and Contributing1 point
-
Connect two points with line
MrKris1224 reacted to UEZ for a topic
No need to reinvent the wheel -> quick search! #include <Array.au3> Global $aCanvas[25][12] drawBresenhamLine($aCanvas, 1, 1, 10, 21) _ArrayDisplay($aCanvas) Func drawBresenhamLine(ByRef $aArray, $iX0, $iY0, $iX1, $iY1, $bSE = True) Local $iDx = Abs($iX1 - $iX0) Local $iSx = $iX0 < $iX1 ? 1 : -1 Local $iDy = Abs($iY1 - $iY0) Local $iSy = $iY0 < $iY1 ? 1 : -1 Local $iErr = ($iDx > $iDy ? $iDx : -$iDy) / 2, $e2 Local $iSX = $iX0, $iEY = $iY0 While $iX0 <= $iX1 $aArray[$iY0][$iX0] = "*" If ($iX0 = $iX1) And ($iY0 = $iY1) Then ExitLoop $e2 = $iErr If ($e2 > -$iDx) Then $iErr -= $iDy $iX0 += $iSx EndIf If ($e2 < $iDy) Then $iErr += $iDx $iY0 += $iSy EndIf WEnd If $bSE Then $aArray[$iEY][$iSx] = "S" $aArray[$iY1][$iX1] = "E" EndIf Return 1 EndFunc ;==>drawBresenhamLine1 point -
These "0x20" are substrings, not characters!1 point
-
My doubt was about String() interpretation of binary data, but I noticed it translates "as is" into a string, adding the classical 0x in front of the string, so there should not be problems with white spaces.1 point
-
Credit to MHz for creating the CMD part. Creating the .ini file ;Create a constant variable in Local scope of the filepath that will be read/written to. Local Const $sFilePath = @ScriptDir & "\Mapping\" & "Config.ini" Local $sFilewrite = 'IGNORE_ERRORS=' & IniWrite($sFilePath, "settings", 'IGNORE_ERRORS', 1 & @CRLF & 'Installer='& $out) $out is generated by another CMD process script that scans the hard drive in order to find the mapping software. But if you know the path won't change I would write it in like below. ;Create a constant variable in Local scope of the filepath that will be read/written to. Local Const $sFilePath = @ScriptDir & "\Mapping\" & "Config.ini" Local $sFilewrite = 'IGNORE_ERRORS=' & IniWrite($sFilePath, "settings", 'IGNORE_ERRORS', 1 & @CRLF & 'Installer=' & "C:\Users\aa2zz6\AppData\Local\ESRI\Desktop10.1\ArcGIS Desktop.exe") .ini file will look like [settings] IGNORE_ERRORS=1 Installer=C:\Users\aa2zz6\AppData\Local\ESRI\Desktop10.1\ArcGIS Desktop.exe Reading file path to CMD Global $Ignore, $Ini, $Installer, $Pid ; Ini Settings file $Ini = @ScriptDir & "\Mapping\" & "Config.ini"" ; Read Ini Setting: IGNORE_ERRORS=0 or IGNORE_ERRORS=1 $Ignore = 'IGNORE_ERRORS=' & IniRead($Ini, "Settings", "IGNORE_ERRORS", 0) ; Read Ini Setting: Installer to run later $Installer = IniRead($Ini, "Settings", "Installer", "") ; If $Installer is something and $Installer exists, then run it. If $Installer And FileExists($Installer) Then $Pid = Run('"' & @ComSpec & '" /c "' & $Installer & '" /v "' & $Ignore & '"', @ScriptDir, @SW_HIDE) ; Check if @error is set. (Use of Exit is optional as used for example) If @error Then Exit 1 ; Wait for process to close ProcessWaitClose($Pid) Else ; Act on condition failure of $Installer If Not $Installer Then Exit 2 If Not FileExists($Installer) Then Exit 3 EndIf1 point
-
create and run autoit scripts without installing autoit
naturelaws reacted to Jos for a topic
Just use the AutoIt3 Installer first and then the SciTE4AutoIt3 installer after that to get a working setup to be able to compile scripts. The portable version is for those who know what they are doing. Jos1 point -
create and run autoit scripts without installing autoit
naturelaws reacted to jchd for a topic
Unless I misunderstand your sentence, extracting the editor isn't enough to be able to compile a script.1 point -
create and run autoit scripts without installing autoit
naturelaws reacted to Melba23 for a topic
naturelaws, I use the full installer version, so I am not too familiar with the portable version. What output do you get in the SciTE console (the lower pane) when you try to run the script? When you post it please use Code tags as explained here. M231 point -
create and run autoit scripts without installing autoit
naturelaws reacted to Melba23 for a topic
naturelaws, Simply compile the scripts into stand-alone executables - they will run without AutoIt being installed. M231 point -
There is a hotkey to not require a 'freeze' in the window info tool...ctrl+alt+f...unfreeze, mouse over the context, then refreeze...on the autoit window info tool. Standard ones are >>>> Window <<<< Title: Class: #327681 point
-
1 point
-
I ruefully admit I also sometimes need to display things to ensure I get the proper type. Joker!1 point
-
Tjalve, So save the file directly as a hex string and let AutoIt do most of the work for you: #include <Crypt.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> $sFile = "File.txt" $sPassword = "P@ssw0rd" $sString = "This is the string to encrypt" ; Encrypt $bData = _Crypt_EncryptData($sString, $sPassword, $CALG_RC4) MsgBox($MB_SYSTEMMODAL, "Encrypted", $bData) ; Write the returned binary (in the form of a hex string) to a file FileWrite($sFile, String($bData)) ; Read the hex string from file $sData = FileRead($sFile) FileDelete($sFile) ; Decrypt the string $bDecrypted = _Crypt_DecryptData($sData, $sPassword, $CALG_RC4) ; And then reconvert to a string to display MsgBox($MB_SYSTEMMODAL, "Decrypted", BinaryToString($bDecrypted)) Any better? M231 point
-
How to clear or delete the scite console output
argumentum reacted to Jos for a topic
This is a methode to clear to Output pane during script execution: For $x = 1 to 100 ConsoleWrite($x & @CRLF) Next ConsoleWrite("clear output in 1 sec" & @CRLF) Sleep(1000) SendSciTE_Command("menucommand:420") ; Clear Output pane "IDM_CLEAROUTPUT" ConsoleWrite("cleared" & @CRLF) For $x = 1 to 100 ConsoleWrite($x & @CRLF) Next Exit ; ; Send command to SciTE Func SendSciTE_Command($sCmd) Local $Scite_hwnd = WinGetHandle("DirectorExtension") Local $WM_COPYDATA = 74 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', 0, _ 'Ptr', DllStructGetPtr($COPYDATA)) EndFunc ;==>SendSciTE_Command Jos1 point