hlstriker Posted September 14, 2005 Share Posted September 14, 2005 Is it possible to have a few variables, then have the send command use 1 of the variables? Example: I want a variable that contains different colors such as... red, purple, green, blue, and orange. Then I would use the send command... Send( "The random color is... " & $random ) Now is there any way I can get $random to display a random color when the send command is run? Thanks in advance ! The best Honda forums!RuneScape High Alching for Profit! Link to comment Share on other sites More sharing options...
hlstriker Posted September 14, 2005 Author Share Posted September 14, 2005 Do you all understanding what i'm saying or should I try and describe what I want it to do better? The best Honda forums!RuneScape High Alching for Profit! Link to comment Share on other sites More sharing options...
layer Posted September 14, 2005 Share Posted September 14, 2005 Heres how I would do it: $random = Random(1, 5, 1) If $random = 1 Then Send("blue") ElseIf $random = 2 Then Send("red") ElseIf $random = 3 Then Send("orange") ElseIf $random = 4 Then Send("yellow") Else Send("green") EndIf FootbaG Link to comment Share on other sites More sharing options...
hlstriker Posted September 14, 2005 Author Share Posted September 14, 2005 Ok, thanks alot ! The best Honda forums!RuneScape High Alching for Profit! Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted September 14, 2005 Share Posted September 14, 2005 This might work a little better for you Dim $aColors[4] = ['blue', 'red', 'green', 'yellow'] $index = Random(0, UBound($aColors) - 1, 1) MsgBox(0, $index, $aColors[$index]) Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
layer Posted September 14, 2005 Share Posted September 14, 2005 Ok Mr. SmartyPants! Haha, only messin' I knew there was a better way. FootbaG Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted September 14, 2005 Share Posted September 14, 2005 (edited) I've been working with php lately (reworking a school site from pure html to simple php stuff), so I've had to work with easy modifications to the site (god bless csv files ). I guess it gets you thinking of how not to use if...then statements for every option Edited September 14, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
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