Sign in to follow this  
Followers 0
crazedwombat

Trouble with random generation

3 posts in this topic

#1 ·  Posted (edited)

Opt("TrayIconDebug",1)

while 1

$walk = random(1, 100)

tooltip($walk)

sleep(1000)

if $walk > 50 Then

controlsend("ClassName=TMainForm.UnicodeClass","","","{F9}")

elseif $walk < 50 Then

controlsend("ClassName=TMainForm.UnicodeClass","","","{F10}")

EndIf

WEnd

this is a snippet off of my functioning script, $walk IS being assigned a randomly generated number, but the if statement isn't working.. any ideas why this wouldn't work?

the same controlsends work in all other cases with the rest of the script, just not in regards to the random string...

Edited by crazedwombat

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

sorry guys, now it does work, was some sort of bug.. i've been messing with it for like an hour and now after taking a break and no further changes it works..

must be something bugging with controlsend and window focus or something...

again, sorry.

btw ty for the point about the = 50.. even though it works without it i'm sure it would've frozen up or killed the script had it managed to hit 50...

Edited by crazedwombat

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  
Followers 0