Sign in to follow this  
Followers 0
oxygenthief

Sending random quote using send command

6 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0