Trouble using my script

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
annon
Newbie
Posts: 1
Joined: Thu Oct 30, 2008 4:13 am

Trouble using my script

Post by annon » Thu Oct 30, 2008 4:17 am

It won't work, don't really know the reason why, I might be misusing the string on if statement, but I tried it many different ways such as..

name == "something"
name = "something
name = something
name == something

Don't really know what else to do but ask for guidance on these forums.

By the way, I DO know it's an infinite loop.

Code: Select all

let>exit=0
let>name="lol"
let>rndx=0
let>rndy=0
let>rndwait=0
repeat>exit
GetActiveWindow>name,X,Y
IF> name = "something"
random>1200,rndx
random>600,rndy
let>rndy=rndy+330
MouseMove>rndx,rndy
LClick
Send Character/Text>zzzzzz im doing something... anti afk
press enter
random>5,rndwait
let>rndwait=rndwait+3
wait>rndwait
ENDIF
until>exit,1

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Oct 30, 2008 8:30 am

Should be:

If>name=something

If you want spaces and string delimiters see IGNORESPACES in the help file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Oct 30, 2008 1:22 pm

It's in an infinite loop because you are not incrementing exit. Repeat loops don't automatically increment the variable so you have to include a line like

Let>exit=exit+1

inside the loop.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts