autoit

Pause While loop by hotkey

a 夏天 提交于 2019-11-30 09:41:48
问题 I want to pause an AutoIt script containing a While loop and some functions. But I am only able to close the script on HotKeySet() . How can I pause it? The script checks for changes on a part of screen (x,y coordinates are set in a config file) and takes screenshots after playing an alert sound. It doesn't stop the While loop when pushing the pause button. But closing the program works. Here is my code: Global $Paused, $counter = 0 HotKeySet("{1}", "TogglePause") HotKeySet("{2}", "Terminate"

Choosing a Windows automation scripting language. AutoIt vs Autohotkey [closed]

感情迁移 提交于 2019-11-29 18:43:31
I need to choose a Windows automation scripting language. Which one do you recommend; AutoIt , AutoHotkey , or an other? I have read " An AutoIt / AutoHotkey comparison ". Interesting history, but without recommendation. Searching Google leaves around 312k hits for AutoHotkey Windows vs 482k for AutoIt Windows . On Stack Overflow there are 15 questions tagged autoit vs 18 autohotkey . I am interested in your opinion as programmers. Which one do you think is easier to use, more deployable and more powerful in terms of functionality? I have already used AutoHotkey for personal use, so my initial

Swap 2D array's rows and columns

依然范特西╮ 提交于 2019-11-29 16:49:25
I need to get columns from a CSV file into an array (multidimensional array or array of arrays). I used CSV.au3 which loads the rows just fine, but I need the columns in that place. My CSV file looks like: Item 1, Item 2, Another Item Item 3, Item 4 It creates a multidimensional array that looks like: $aResult[0] = [0] => 'Item 1', [1] => 'Item 2', [2] => 'Another Item' $aResult[1] = [0] => 'Item 3', [1] => 'Item 4' Where I would like it to look like: $aResult[0] = [0] => 'Item 1', [1] => 'Item 3' $aResult[1] = [0] => 'Item 2', [1] => 'Item 4' $aResult[2] = [0] => 'Another Item' For each row

Database, relational query

淺唱寂寞╮ 提交于 2019-11-29 12:31:12
Chemicals have a trade name (which is what it is commonly referred to as) and an actual chemical name. I need to look up a trade name, find its proper chemical name, then get properties of that chemical. For example: $tradeName = "Voranol" if $tradeName == "Voranol" then $productName = "Polyether Polyol" $flare = "List I" $bay = "1" $listPos = 3 EndIf I have an .au3 file that contains a ton of products. It works fine but it's kind of tedious to do if $tradeName == "Name1" or $tradeName == "Name2" or $tradeName == "Name4" or $tradeName == "Name5" . I will also need to be able to edit it

Incremental variable definition

余生颓废 提交于 2019-11-28 14:34:19
I want to automatically define incrementing variable names. So instead of this: $Var1 = 'This is variable one :P' $Var2 = 'This is variable two :P' I'd like this (pseudo code): For $i = 1 to UBound($People)-1 **$var[$i]** = GUICtrlCreateCheckbox($var[$i], 24, $y, 200, 17) $y = $y + 25 Next Does anyone know how? The code should make as many checkboxes as defined in an array and every checkbox should have its own variable. You're looking for the Assign function! Check out this example: For $i = 1 To 5 Assign('var' & $i, $i); Next Then you can access these variables with: MsgBox(4096, "My dynamic

Hexadecimal to decimal

与世无争的帅哥 提交于 2019-11-28 14:33:03
I have to convert a hexadecimal number to decimal, but don't know how. In the AutoIt documentation (pictured below) some constants (being assigned hexadecimal values) are defined: 0x00200000 hexadecimal (underlined in image) equals 8192 decimal (this is the true conversion). But convertors return 2097152 . I have to convert another hex value ( 0x00000200 ), but convertors get it wrong. How to correctly convert it? When I use the definition $WS_EX_CLIENTEDGE (or a hexadecimal value), it doesn't work. If I use an integer I believe it will work. As per Documentation - Language Reference -

AutoIT | Click On A Div Button | Browser

风格不统一 提交于 2019-11-28 13:58:41
问题 I have been trying to click on a specific button on a website. I have finally concluded to ask for help here. This my whole program: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ie.au3> #include <MsgBoxConstants.au3> #include <GuiEdit.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("KingDomLikes Bot", 334, 150, 192, 124) $Group1 = GUICtrlCreateGroup("Login

Choosing a Windows automation scripting language. AutoIt vs Autohotkey [closed]

╄→гoц情女王★ 提交于 2019-11-28 13:29:34
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I need to choose a Windows automation scripting language. Which one do you recommend; AutoIt, AutoHotkey, or an other? I have read "An

Swap 2D array's rows and columns

你离开我真会死。 提交于 2019-11-28 11:32:36
问题 I need to get columns from a CSV file into an array (multidimensional array or array of arrays). I used CSV.au3 which loads the rows just fine, but I need the columns in that place. My CSV file looks like: Item 1, Item 2, Another Item Item 3, Item 4 It creates a multidimensional array that looks like: $aResult[0] = [0] => 'Item 1', [1] => 'Item 2', [2] => 'Another Item' $aResult[1] = [0] => 'Item 3', [1] => 'Item 4' Where I would like it to look like: $aResult[0] = [0] => 'Item 1', [1] =>

Capture and display STDOUT at the same time

拥有回忆 提交于 2019-11-28 10:18:41
I have the following code to capture and process the Run command output. How do I modify it such that the Run command window displays output and at the same time the output gets logged? Replacing @SW_HIDE with @SW_SHOW (or the equivalent) just shows a blank command window. Something similar to the linux tee command which logs to file while it prints STDOUT. $CurrentPID = Run(@ComSpec & ' /c ' & $CurrentLogCmd, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) If Not ProcessWaitClose($CurrentPID,60) Then WriteLog("[Warning] Timed-out.Finding date in current hour raw log -" & $CurrentLogFileName) $F