|
Layna Newbie
Joined: 12 Mar 2008 Posts: 1
|
Posted: Wed Mar 12, 2008 7:35 pm
Random chance to emote |
I managed to sort my first problem out. Sort of. It's probably a hugely inelegant way of doing it, but ho hum!
Anyway, I want to have a % chance for an emote to fire at the same time as a command - what's the best way to go about doing this? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Mar 13, 2008 12:07 am |
#oninput {*} {#if (%random(1,100)>50) {do an emote}}
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Thu Mar 13, 2008 1:10 am |
%item(@emoteList, %random(1, %numitems(@emoteList)))
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Mar 13, 2008 4:40 pm |
And to combine the two...
#oninput {*} {#IF (%random(1,100) > 90) {%item(@emoteList, %random(1, %numitems(@emoteList)))}}
This is a 10% chance, simply lower the 90 to change that higher. Remember, your % chance with this method is the REMAINDER of the 90 out of 100, which is 10.
This randomizes your chance of emoting, and also randomly chooses an emote from a list...
Here is a sample emote list:
emoteList {cough|sneeze|emote pukes on his shoes|spit self|emote bites his nails}
cough, sneeze, and spit are all socials on my former mud. spit self would make your drool.
the others are manual emotes using the emote command.
Enjoy. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Thu Mar 13, 2008 11:20 pm |
I bet you get 17 in a row on a bad day and curse the levity.
(listening to cynical music) |
|
|
|
|
|