thakin2005-04-02 21:55:09
I want to set up a trigger so when ever someone says hi to me, %random will be used to input a random command off a list i specify, like if %random gives off a number under 20, do this action, if it is between 20 and 40 do this one, all the way up to 99, cept I dunno of a way to do it without making 99 different triggers?
Soll2005-04-02 22:24:12
Easier way:
#trigger {^(%w) raises {his|her} hand in greeting to you and says "Hi!"} {
#VAR HiReplyList {hi|greetings|hello|bow|salute}
#1 {%item(@HiReplyList,%random(1,5))}}
#trigger {^(%w) raises {his|her} hand in greeting to you and says "Hi!"} {
#VAR HiReplyList {hi|greetings|hello|bow|salute}
#1 {%item(@HiReplyList,%random(1,5))}}
Unknown2005-04-03 01:47:27
I think this is a little more readable...
You can add as many {emote %1} things after it as you want, too.
CODE
#TRIGGER {^(%w) raises {his|her} hand in greeting to you and says "Hi!"} {#case %random {hi %1} {greet %1} {doff %1}}
You can add as many {emote %1} things after it as you want, too.
Unknown2005-04-03 04:33:31
%random by itself will result in a random number between 0 (or 1?) and 99 (or 100?), except when using cases (see Zarquan's code), when it will automatically choose a random one of the cases. And then you can use %random with arguments (e.g. random(1,10)), where it will choose a random number between and including those two arguments. See the help file on %random for more detail.