Randomiser Code

A simple randomiser. Drop it in a room, input any space-separated list, and the entire room will see the random result via the OOC command. It has a number of uses, including, but not limited to: determining a random flight winner, picking a name for a raffle draw, deciding where to RP, and so on.

Example:
'+rand blue pink purple' would return randomly either blue, pink, or purple.

For multiple word options, use underscores, like so:
'+rand South_Bowl Kitchen LC' would return either South Bowl, Kitchen, or LC.

Also, it is set up to publicly roll die, up to 6 at a time, in the same manner:
'+roll d6' to roll a number from 1 to 6, '+roll 2d8' to get two numbers from 1 to 8, plus the total of those numbers when added together.
+roll 7d<anything> or higher will return 'Huh?'

'+8ball' will publicly roll a basic 8ball, while '+RPball' has the same responses, plus some additional RP-related yes/no answers.


Any questions should preferably be paged or @mailed to X'hil in game, but, if that gets no response, email moc.liamg|nikdnax#moc.liamg|nikdnax

If you wish to share this code, please do, just remember to link to this page. If the code is updated, the new version will be put here.

Sample Output:

<OOC> Randomiser computes: [first(shuffle(I_am_testing this_device for_the_wiki))]
<OOC> Randomiser's result: for the wiki.

<OOC> Randomiser rolls: 2d8
<OOC> Randomiser rolls: 3,5 [8]

<OOC> Randomiser says, "The magic 8ball says: Without a doubt."

<OOC> Randomiser says, "The magic RP-ball says: Ooo, RP? RPRPRPRPRPRP!"

The Code:

@create Randomiser=10

@Desc Randomiser=[space(5)]A simple randomiser. Drop it in a room, input any space-separated list, and the entire room will see the random result via the OOC command. It has a number of uses, including, but not limited to: determining a random flight winner, picking a name for a raffle draw, deciding where to RP, and so on.%r%rExample:%r'[ansi(g,+rand blue pink purple)]' would return randomly either blue, pink, or purple.%r%rFor multiple word options, use underscores, like so:%r'[ansi(g,+rand South_Bowl Kitchen LC)]' would return either South Bowl, Kitchen, or LC.%r%rAlso, it is set up to publicly roll die, up to 6 at a time, in the same manner:%r'[ansi(g,+roll d6)]' to roll a number from 1 to 6, '[ansi(g,+roll 2d8)]' to get two numbers from 1 to 8, plus the total of those numbers when added together.%r+roll 7d<anything> or higher will return 'Huh?'%r%r'[ansi(g,+8ball)]' will publicly roll a basic 8ball, while '[ansi(g,+RPball)]' has the same responses, plus some additional RP-related yes/no answers.%r%rThis [name(me)] is owned by [ansi(h,name(owner(me)))]; coded by X'hil.%rCode: http://isw.wikidot.com/code:random%r

&CMD_RAND Randomiser=$+rand *:ooc :computes: \[first(shuffle([ansi(h,%0)]))];@wait 1=ooc \;'s result: [ansi(h,edit(first(shuffle(%0)),_,%b))].

&CMD_ROLL Randomiser=$+roll d*:ooc :rolls: [ansi(h,1)]d[ansi(h,%0)];@wait 1=ooc :rolls: [ansi(h,add(rand(%0),1))]
&CMD_ROLL_1 Randomiser=$+roll 1d*:ooc :rolls: [ansi(h,1)]d[ansi(h,%0)];@wait 1=ooc :rolls: [ansi(h,add(rand(%0),1))]
&CMD_ROLL_2 Randomiser=$+roll 2d*:ooc :rolls: [ansi(h,2)]d[ansi(h,%0)];@wait 1=ooc :rolls: [setr(0,add(rand(%0),1))],[setr(1,add(rand(%0),1))] \[[ansi(h,add(%q0,%q1))]\]
&CMD_ROLL_3 Randomiser=$+roll 3d*:ooc :rolls: [ansi(h,3)]d[ansi(h,%0)];@wait 1=ooc :rolls: [setr(0,add(rand(%0),1))],[setr(1,add(rand(%0),1))],[setr(2,add(rand(%0),1))] \[[ansi(h,add(%q0,%q1,%q2))]\]
&CMD_ROLL_4 Randomiser=$+roll 4d*:ooc :rolls: [ansi(h,4)]d[ansi(h,%0)];@wait 1=ooc :rolls: [setr(0,add(rand(%0),1))],[setr(1,add(rand(%0),1))],[setr(2,add(rand(%0),1))],[setr(3,add(rand(%0),1))] \[[ansi(h,add(%q0,%q1,%q2,%q3))]\]
&CMD_ROLL_5 Randomiser=$+roll 5d*:ooc :rolls: [ansi(h,5)]d[ansi(h,%0)];@wait 1=ooc :rolls: [setr(0,add(rand(%0),1))],[setr(1,add(rand(%0),1))],[setr(2,add(rand(%0),1))],[setr(3,add(rand(%0),1))],[setr(4,add(rand(%0),1))] \[[ansi(h,add(%q0,%q1,%q2,%q3,%q4))]\]
&CMD_ROLL_6 Randomiser=$+roll 6d*:ooc :rolls: [ansi(h,6)]d[ansi(h,%0)];@wait 1=ooc :rolls: [setr(0,add(rand(%0),1))],[setr(1,add(rand(%0),1))],[setr(2,add(rand(%0),1))],[setr(3,add(rand(%0),1))],[setr(4,add(rand(%0),1))],[setr(5,add(rand(%0),1))] \[[ansi(h,add(%q0,%q1,%q2,%q3,%q4,%q5))]\]

&CMD-8BALL Randomiser=$+8ball:ooc The magic 8ball says: [ansi(h,first(shuffle(Signs point to yes.|Yes.|Reply hazy\, try again.|Without a doubt.|My sources say no.|As I see it\, yes.|You may rely on it.|Concentrate and ask again.|Outlook not so good.|It is decidedly so.|Better not tell you now.|Very doubtful.|Yes - definitely.|It is certain.|Cannot predict now.|Most likely.|Ask again later.|My reply is no.|Outlook good.|Don't count on it.|Yes\, in due time.|My sources say no.|Definitely not.|Yes.|You will have to wait.|I have my doubts.|Outlook so so.|Looks good to me!|Who knows?|Looking good!|Probably.|Are you kidding?|Go for it!|Don't bet on it.|Forget about it.,|),|))]

&CMD-RPBALL Randomiser=$+rpball:ooc The magic RP-ball says: [ansi(h,first(shuffle(Signs point to yes.|Yes.|Reply hazy\, try again.|Without a doubt.|My sources say no.|As I see it\, yes.|You may rely on it.|Concentrate and ask again.|Outlook not so good.|It is decidedly so.|Better not tell you now.|Very doubtful.|Yes - definitely.|It is certain.|Cannot predict now.|Most likely.|Ask again later.|My reply is no.|Outlook good.|Don't count on it.|Yes\, in due time.|My sources say no.|Definitely not.|Yes.|You will have to wait.|I have my doubts.|Outlook so so.|Looks good to me!|Who knows?|Looking good!|Probably.|Are you kidding?|Go for it!|Don't bet on it.|Forget about it.|Don't ask me\, I'm just a ball!|too tired\, insert caffeine to continue|Ooo\, RP? RPRPRPRPRPRP!|Yes - consult pevent.|Sorry\, the internet ate my brain.,|),|))]

Additional undocumented features, added for personal/friend usage.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License