autocomplex Posted August 24, 2007 Posted August 24, 2007 Will this work? All three do the same thing so I figured they could all be put in the same Case. Case $msg = $StartButton, $MenuStart, $MenuHotKeyStart Start() Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
tAKTelapis Posted August 24, 2007 Posted August 24, 2007 I Think this is it: Case $msg = $StartButton OR $msg = $MenuStart OR $msg = $MenuHotKeyStart Start() Though i could be wrong, i couldn't find the reference to And/Or in the helpfile, though i am sure i have come across it before.
Moderators SmOke_N Posted August 24, 2007 Moderators Posted August 24, 2007 Will this work? All three do the same thing so I figured they could all be put in the same Case. Case $msg = $StartButton, $MenuStart, $MenuHotKeyStart Start()As long as it's in a Switch statement and you understand that the comma is an "Or". Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Moderators SmOke_N Posted August 24, 2007 Moderators Posted August 24, 2007 (edited) I Think this is it: While 1 $iRandom = Random(1, 10, 1) Switch $iRandom Case 1,2,3,4,5 MsgBox(64, "1 through 5", $iRandom & " was randomly picked") Case 6,7,8,9,10 MsgBox(64, "6 through 10", $iRandom & " was randomly picked") EndSwitch WEnd Edit: Removed a comment from within the code... What is wrong with the edit feature lately? Edited August 24, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
autocomplex Posted August 24, 2007 Author Posted August 24, 2007 I am using Select and EndSelect, but I know Switch does basically the same thing. What are the most obvious differences between them, because I might just do Switch. Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
Moderators SmOke_N Posted August 24, 2007 Moderators Posted August 24, 2007 I am using Select and EndSelect, but I know Switch does basically the same thing. What are the most obvious differences between them, because I might just do Switch.Switch + Value Case Value1EndSwitchSelect Case $msg = Value Case $othervar = Value Case $otherVarVar = valueEndSelectSwitch is value specific... I prefer switch myself over Select even though it's not as versatile (less work, and I believe someone clocked it to be faster). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now