Jump to content
Sign in to follow this  
corl455

im new to auto it...

Recommended Posts

corl455

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

Share this post


Link to post
Share on other sites
covaks

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.

Share this post


Link to post
Share on other sites
BrettF
covaks

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.

Share this post


Link to post
Share on other sites
BrettF

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.

Share this post


Link to post
Share on other sites
corl455

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 by corl455

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.