I was wondering if it was possible to make a trigger that affects every letter I type. My goal is to be able to turn this:
chat Hello!
into something like:
chat |bk|h|br|e|by|l|bp|l|bg|o|bc|!
But I want all the colors (everything inside the divider lines) to be randomly generated, and match anything I enter into chat as long as the trigger is activated. I honestly don't know where to even begin. When it comes to the script I will need. I just know it is possible because I have seen it done.
The colors available are:
BK, B, BB, C, BC, G, BG, R, BR, Y, BY, W, BW, P, BP
I was thinking I would have to use a table and the math.random but I honestly have no idea how to make it work.
Any suggestions? Even if you just start by pointing me in the right direction?
Post Post:
So while I was thinking here is what I have come up with:
Obviously I am not actually trying to match ????????????, But I didn't know what else to right for the time being. Maybe this will at least saves you (whoever can help me) a bit of time. All it does is recall a random object from the table "randcolors" and sends it to the mud.
chat Hello!
into something like:
chat |bk|h|br|e|by|l|bp|l|bg|o|bc|!
But I want all the colors (everything inside the divider lines) to be randomly generated, and match anything I enter into chat as long as the trigger is activated. I honestly don't know where to even begin. When it comes to the script I will need. I just know it is possible because I have seen it done.
The colors available are:
BK, B, BB, C, BC, G, BG, R, BR, Y, BY, W, BW, P, BP
I was thinking I would have to use a table and the math.random but I honestly have no idea how to make it work.
Any suggestions? Even if you just start by pointing me in the right direction?
Post Post:
So while I was thinking here is what I have come up with:
<triggers>
<trigger
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="????????????"
send_to="12"
sequence="100"
>
<send>local randcolors {
"|BK|",
"|B|",
"|BB|,
"|C|",
"|BC|",
"|G|",
"|BG|",
"|R|",
"|BR|",
"|Y|",
"|BY|",
"|W|",
"|BW|",
"|P|",
"|BP|",
}
Send (randcolors [math.random (1, #randcolors)])</send>
</trigger>
</triggers>
Obviously I am not actually trying to match ????????????, But I didn't know what else to right for the time being. Maybe this will at least saves you (whoever can help me) a bit of time. All it does is recall a random object from the table "randcolors" and sends it to the mud.