multiple 'if' script not workng

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

multiple 'if' script not workng

Post by Mark Gevry » Wed Jan 05, 2005 8:17 pm

Im working on a blackjakc game. Im having trouble with reading this card. It seems to just sit there. Take a look.

WaitWindowOpen>in Buckaroo*
SetFocus>in Buckaroo*
MoveWindow>in Buckaroo*,0,0
LABEL>card_identity
GetPixelColor>323,264,redQ1
GetPixelColor>320,262,redQ2
GetPixelColor>325,268,redQ3
GetPixelColor>325,262,redQ4
if>{(%redQ1%=10066431) and (%redQ2%=10066431) and (%redQ3%=10066431 and (%redQ4=6711039)} then
slot_one_red_queen
endif
goto>card_identity
label>slot_one_red_queen
message>i foud the queen!
wait>10
----------------------------
Is it just a mistake on my end?

Guest

Post by Guest » Wed Jan 05, 2005 8:58 pm

If you cut and paste this from your .scp then you are missing a ) so you have an unequal number of ( and ) in this line.
if>{(%redQ1%=10066431) and (%redQ2%=10066431) and (%redQ3%=10066431 and (%redQ4=6711039)}

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Wed Jan 05, 2005 9:03 pm

Anonymous wrote:If you cut and paste this from your .scp then you are missing a ) so you have an unequal number of ( and ) in this line.
if>{(%redQ1%=10066431) and (%redQ2%=10066431) and (%redQ3%=10066431 and (%redQ4=6711039)}
Ya i know i changed the ')' that i missed and the % sign i missed. What do you mean by unequal ands?
WaitWindowOpen>in Buckaroo*
SetFocus>in Buckaroo*
MoveWindow>in Buckaroo*,0,0
LABEL>card_identity
GetPixelColor>323,264,redQ1
GetPixelColor>320,262,redQ2
GetPixelColor>325,268,redQ3
GetPixelColor>325,262,redQ4
if>{(%redQ1%=10066431) and (%redQ2%=10066431) and (%redQ3%=10066431) and (%redQ4%=6711039)} then
slot_one_red_queen
endif
goto>card_identity
label>slot_one_red_queen
message>i foud the queen!
wait>10
[/quote]

Guest

Post by Guest » Wed Jan 05, 2005 11:27 pm

I meant what you fixed, unequal numbers of left and right parentheses = these things (((((()))))))

Guest

Post by Guest » Mon Jan 10, 2005 7:52 pm

Mark,

The way you have this written currently, If the colors you are seeking are not all correct matches, the script will loop indefinitely. Assuming your colors are correct you will still get the loop until you add "goto>" in front of your statement "slot_one_red_queen". "slot_one_red_queen" by itself, has no meaning.

Also, I don't think you need the word "then" in your if statement. I don't know if it is causing a problem but I'm pretty sure it's unneccesary.

Hope this was helpful.

Dick

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