Jump to content

Trouble with random generation


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...