Valkyrie Posted June 2, 2009 Posted June 2, 2009 (edited) Dear readers,Mij code is as displayed here:$msgrand = 1 $text0 = "....." $text1 = "....." $text2 = "....." $text3 = "....."Now I do this:if $msgrand >= 1 Then $nr = Random(0, 9) ;WHAT HERE? EndIfThe problem is, that it wont send the chosen text. Can someone tell me what I am doing wrong?I want to display (send) one of the random text that has been set with $text0 up to $text3.Best regardsP.S. the ;WHAT HERE? part should need a code, but I dont know the correct one!something like Send($text[$nr]) maybe? Edited June 2, 2009 by Valkyrie
monoceres Posted June 2, 2009 Posted June 2, 2009 Use arrays instead. Local $Texts[4]=["This","Array","Contains","Text"] $Rand=Random(0,UBound($Texts)-1,1) Send($Texts[$Rand]) Broken link? PM me and I'll send you the file!
Valkyrie Posted June 2, 2009 Author Posted June 2, 2009 (edited) oke got it now, thanks a lot Edited June 2, 2009 by Valkyrie
monoceres Posted June 2, 2009 Posted June 2, 2009 Valkyrie said: I cant use local $text = ["world domination!?", "level?", "boooooorrrringgg!"] gives me the error: C:\Users\Angelo\Desktop\sknnr.au3(4,9) : ERROR: syntax error which points to: local $text = ["world domination!?", "level?", "boooooorrrringgg!"] Look at my code again. Notice that I specified how many items I was adding. Broken link? PM me and I'll send you the file!
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