IF, OR, and WHILE help
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 63
- Joined: Sat Dec 25, 2004 3:23 pm
IF, OR, and WHILE help
Hi. IM trying to automate a video poker game. It has the 5 cards, etc..
and is there an easier way to do this....
if>{(card1=k) and (card3=k) while (card2=a) or (card2=2) or (card2=3)ETC...(same line)...and (card4=a) or (card4=2) ETC...(same line)..and (card5=a) or (card5=2)..ETC...
goto>A_LABEL
endif
I want it to be like, if there are two kings (card 1 and card 3), and any of the other cards are different, do something.
Kind Regards,
Mark
and is there an easier way to do this....
if>{(card1=k) and (card3=k) while (card2=a) or (card2=2) or (card2=3)ETC...(same line)...and (card4=a) or (card4=2) ETC...(same line)..and (card5=a) or (card5=2)..ETC...
goto>A_LABEL
endif
I want it to be like, if there are two kings (card 1 and card 3), and any of the other cards are different, do something.
Kind Regards,
Mark
Mark,
Have you tried "" (not equal to)?
(Edit1)
You will also need % around your variables. If the "k" is a variable it will need % around it. If it is a string it will need quotes. In my example I'm assuming its a string.
if>{(%card1%="k") and (%card3%="k") and (%card2%"k") and (%card4%"k") and (%card5%"k")}
goto>A_LABEL
endif
Also, can you use "while" as a logic operator? I haven't been able to find documentation on it.
Hope this helps,
Dick
Have you tried "" (not equal to)?
(Edit1)
You will also need % around your variables. If the "k" is a variable it will need % around it. If it is a string it will need quotes. In my example I'm assuming its a string.
if>{(%card1%="k") and (%card3%="k") and (%card2%"k") and (%card4%"k") and (%card5%"k")}
goto>A_LABEL
endif
Also, can you use "while" as a logic operator? I haven't been able to find documentation on it.
Hope this helps,
Dick
Last edited by JRL on Mon May 23, 2005 12:37 am, edited 2 times in total.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Consider using 11,12,13,1 for J,Q,K,A and then use basic math for something like this:
if>{(%card1%=12) and (%card3%=12) and (%card2%12).....
if>{(%card1%=12) and (%card3%=12) and (%card2%12).....
Last edited by Bob Hansen on Mon May 23, 2005 2:38 am, edited 2 times in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
-
- Pro Scripter
- Posts: 63
- Joined: Sat Dec 25, 2004 3:23 pm
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
-
- Pro Scripter
- Posts: 63
- Joined: Sat Dec 25, 2004 3:23 pm
-
- Pro Scripter
- Posts: 63
- Joined: Sat Dec 25, 2004 3:23 pm
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
-
- Pro Scripter
- Posts: 63
- Joined: Sat Dec 25, 2004 3:23 pm