Anuran Posted March 25, 2008 Posted March 25, 2008 (edited) Hello all, i stuck at "GUICtrlCreateInput" and "GUICtrlRead". i want to run my loop X times and user can set how many times but something is wrong there it just ignore my input and loop is infinity. expandcollapse popup#include <GUIConstants.au3> Global $Paused HotKeySet("{ESC}","Quit") HotKeySet("{ENTER}","Start") HotKeySet("{PAUSE}","Pause") $i = 0 Opt("SendKeyDownDelay", 10) GUICreate("bla",458,350) GUISetState (@SW_SHOW) $Input = GUICtrlCreateInput("20",350,150,50) $num = GUICtrlRead($Input) Func Start() While 1 Send("{U}") Sleep(10) Send("{P}") Sleep(20000) Do Send("{2}") Sleep(4000) Send("{8}") Sleep(4000) $i = $i + 1 Until $i = $num WEnd EndFunc Func Pause() EndFunc While 1 Wend Func Quit() Edited March 25, 2008 by Anuran
Zedna Posted March 26, 2008 Posted March 26, 2008 Place $num = GUICtrlRead($Input) into Func Start() Resources UDF ResourcesEx UDF AutoIt Forum Search
Anuran Posted March 26, 2008 Author Posted March 26, 2008 i got another problem now :/ my loop just run once and then infinite again. i want to run my "while loop" > "do - until (x times)" > "while loop" > "do - until (x times)" and all this in a loop. any ideas? expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ESC}","Quit") HotKeySet("{ENTER}","Start") HotKeySet("{PAUSE}","Pause") $i = 0 Opt("SendKeyDownDelay", 10) GUICreate("bla",458,350) GUISetState (@SW_SHOW) $Input = GUICtrlCreateInput("20",350,150,50) Func Start() While 1 Send("{U}") Sleep(10) Send("{P}") Sleep(20000) Do Send("{2}") Sleep(4000) Send("{8}") Sleep(4000) $i = $i + 1 $num = GUICtrlRead($Input) Until $i = $num WEnd EndFunc While 1 Wend Func Quit()
Aceguy Posted March 26, 2008 Posted March 26, 2008 expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ESC}", "Quit") HotKeySet("{ENTER}", "Start") HotKeySet("{PAUSE}", "Pause") $i = 0 $restart = False Opt("SendKeyDownDelay", 10) GUICreate("bla", 458, 350) GUISetState(@SW_SHOW) $Input = GUICtrlCreateInput("20", 350, 150, 50) Func Start() While 1 Send("{U}") Sleep(10) Send("{P}") Sleep(20000) Do Send("{2}") Sleep(4000) Send("{8}") Sleep(4000) $i = $i + 1 $num = GUICtrlRead($Input) If $i = GUICtrlRead($Input) Then $i = 0 $restart =True Else $restart=False EndIf Until $restart = True WEnd sleep(50) EndFunc ;==>Start While 1 WEnd Func Quit() [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Anuran Posted March 26, 2008 Author Posted March 26, 2008 (edited) same as before, loop just run once. maybe my "$Input = GUICtrlCreateInput" get lost somehow or cant read it twice. is there a re-read function or restart from line XX or something? EDIT: ok works well with some editing. my real script is a bit bigger than this test script and i was n00b not trying everything. dont judge me ^^ im just a beginner doing his first steps thank you both for help and patience Edited March 26, 2008 by Anuran
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now