oxygenthief Posted July 12, 2008 Share Posted July 12, 2008 Hey folks, firstly thanks to all those of you forum users who take time to help people like myself, i have used the search function for other problems I have had and usually find a way of achieving the result I desire without needing to request help directly, but now i have searched for hours without any luck. My problem, I would like to use the Send command to input a random quote #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 $0 ="Now I cut you,Come on and bleed" $1 ="Death is waiting" $2 ="you'll have to fight harder than this" $3 ="My blade will only improve your looks" $4 ="Warm up the next opponent this one will not last long" $index = Random (0,4,1) Send ($ & [$index], 1) WEnd something like this i deleted the unnecessary IF _ispressed commands as i have no problem with them only problems getting it to randomly select and send a phrase hope someone can help this poor fool Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 12, 2008 Share Posted July 12, 2008 Use arrays for this kind of stuff. Example: Global $Array[3]=["Help me", "Help you", "Help him"] MsgBox(0, "Random sentence", $Array[Random(0,2,1)]) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
oxygenthief Posted July 12, 2008 Author Share Posted July 12, 2008 Use arrays for this kind of stuff. Example: Global $Array[3]=["Help me", "Help you", "Help him"] MsgBox(0, "Random sentence", $Array[Random(0,2,1)]) thanks for replying i did tinker with arrays to begin with but couldnt get my ancient brain to work out what i was doing wrong, if its not too much trouble how can i use the last line of code with the send command i tried various methods all of which returned syntax errors or other code warning errors thanks again for going to the trouble of helping me Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 12, 2008 Share Posted July 12, 2008 like so? Global $Array[3]=["Help me", "Help you", "Help him"] Send($Array[Random(0,2,1)]) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
oxygenthief Posted July 12, 2008 Author Share Posted July 12, 2008 like so? Global $Array[3]=["Help me", "Help you", "Help him"] Send($Array[Random(0,2,1)]) Perfect ! thank you my syntax was just returning errors a ton of thanks for your help !! hope you have a great day Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 12, 2008 Share Posted July 12, 2008 NP! muttley .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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