Help with a pixelcolor

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Marcdk
Junior Coder
Posts: 36
Joined: Sat Sep 22, 2007 10:16 pm

Help with a pixelcolor

Post by Marcdk » Sun Feb 24, 2008 6:50 pm

Ok so why doesn't this script work?

Waitpixelcolor>528417,284,521,2
If>%WPC_RESULT%=TRUE
wait>1
Goto>Other Spot
ENDIF
IF>%WPC_RESULT%=FALSE
mousemove>0,500
endif
label>end

Label>Other Spot
press alt
send>q
label>end
Okay so when i run this script , it moves the mouse to: 0,500 AND goes to the label: "Other Spot" why? :/ I just dont understand it.. :?

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

Post by Marcus Tettmar » Sun Feb 24, 2008 7:25 pm

Because you have told it to. At no point is the script told NOT to do that section of code.

Look at this section of code with my comments added:

IF>%WPC_RESULT%=FALSE
mousemove>0,500
endif

//Assuming WPC_RESULT is FALSE we will execute the above If/Endif block, so the mouse move will take place and we'll then end up here just after the endif

label>end

//Above is a plain label statement. It does nothing, it just marks a label. So we'll just skip right over it.

Label>Other Spot

//Another label, so carry on.

press alt
send>q
label>end

//So we execute this code too.

You have two "label>end" lines. Perhaps that first one is meant to be Goto>end.

But here's a better way to structure your code:

Code: Select all

Waitpixelcolor>528417,284,521,2
If>%WPC_RESULT%=TRUE
  wait>1
  press alt
  send>q
  Release Alt
Else
  mousemove>0,500
endif
BTW - you've also missed out "Release ALT".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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