corl455 Posted March 6, 2008 Share Posted March 6, 2008 ok, i have this code: $text = IniRead("data.ini", "main", "text", "NotFound") $repeat = IniRead("data.ini", "main", "repeat", "NotFound") $count=0 MsgBox(0, "AutoTalker", "By: Tyler Wight" & @CRLF & "Once you close this you" & @CRLF & "will have 5 seconds to click on the text box") sleep(5000) while $count < $repeat send($text) send("{ENTER}") Wend and heres the INI file: [main] text=whatsup repeat=10 when i run it, it types just fine, but it never stops. im really new to auto it scripting. so any help would be appreciated Link to comment Share on other sites More sharing options...
covaks Posted March 6, 2008 Share Posted March 6, 2008 You never increase the value of count. You set it to 0, and repeat = 10 as per the .ini file, but then you never increase count. So every time it goes through the while loop, count is always 0 and repeat is always 10. So it never ends. Put a "count += 1" into your while loop so count increases. Or just use a for loop instead. Link to comment Share on other sites More sharing options...
BrettF Posted March 6, 2008 Share Posted March 6, 2008 For loop would probably be the best option Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
xinhepc Posted March 6, 2008 Share Posted March 6, 2008 Do not understand Link to comment Share on other sites More sharing options...
covaks Posted March 6, 2008 Share Posted March 6, 2008 Seriously? Are you corl455? If so. You understand that the value of $count is 0 right? And the value of $repeat is 10? So if you never increase the value of $count, then it will always be less than $repeat. You need to increase the value of $count.. $text = IniRead("data.ini", "main", "text", "NotFound") $repeat = IniRead("data.ini", "main", "repeat", "NotFound") $count=0 MsgBox(0, "AutoTalker", "By: Tyler Wight" & @CRLF & "Once you close this you" & @CRLF & "will have 5 seconds to click on the text box") sleep(5000) while $count < $repeat send($text & @CRLF) $count += 1 ; We have to INCREASE the value of $count, or this loop will run forever. So we ADD 1 to the current value of $count each time the loop executes until eventually it is equal to $repeat, and the loop exits. WendoÝ÷ Øêî²)àiú+)jëh×6$text = IniRead("data.ini", "main", "text", "NotFound") $repeat = IniRead("data.ini", "main", "repeat", "NotFound") MsgBox(0, "AutoTalker", "By: Tyler Wight" & @CRLF & "Once you close this you" & @CRLF & "will have 5 seconds to click on the text box") sleep(5000) For $count = 1 to $repeat send($text & @CRLF) Next ; A for loop automatically adds to $count, and starts over again at the start of the loop. Link to comment Share on other sites More sharing options...
BrettF Posted March 6, 2008 Share Posted March 6, 2008 If you are the same person as the poster, then you DO NOT need to create a new account to post. You can easily do that by clicking reply in your old accout... If you are not, probably easier to rtfm first, and look at 1/2 the examples in the helpfile. Many of them utilize a For...Next loop. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
corl455 Posted March 6, 2008 Author Share Posted March 6, 2008 (edited) yeah, im corl455. but i have no idea how i missed that. honest mistake XD thx guys! EDIT: that guy wasnt me, im not that much of a retard XD (no offence to anyone) Edited March 6, 2008 by corl455 Link to comment Share on other sites More sharing options...
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