;Sayings
friendly := ["hello there!", "Howdy!", "Greetings friend!", "hi there"]
helpful := ["x next to y and z", "this is helpful", "The sky is blue"]
other := ["where is my toaster", "do it", "just"]
;Categories
welcome := [[friendly][helpful][other]]
Numpad0::
intotext(randomfromarray("friendly"),50,35,15)
return
Numpad1::
intotext(randomfromarray("helpful"),50,35,15)
return
;Numpad2::
;Select a random saying from the welcome category.
intotext(whatisit,thekeydelay,introwait,outrowait)
{
SetKeyDelay, thekeydelay
Send, t
Sleep, %introwait%
Send, %whatisit%
Sleep, %outrowait%
Send, {enter}
}
randomfromarray(uniquepickof){
return %uniquepickof%[random(1, %uniquepickof%.maxindex() )]
}
random(x, y){
Random, var, %x%, %y%
return var
}
- Can someone help me figure out (for Numpad2::) how to select a random Sayings array from the Welcome category, and then select a random index of that (saying) array?
I tried throwing a few ideas down but they all resulted with only "t" because I did not return the (pick random array )[index] value properly.
Aucun commentaire:
Enregistrer un commentaire