Recently I had occasion to stay connected (to the Internet) by sending periodic messages to a MUD. Using a timer was the obvious choice, but to be a bit more interesting I wanted to not just send the same thing every time. (Also, some MUDs disconnect you if you send the same thing repeatedly). After a bit of research, I came up with this small script routine.
By typing in "socials" I got a list of socials, and by copying and pasting (and removing multiple spaces) I was able to quickly get a list of them in usable form.
Then I used "split" (as suggested by Krenath) and the "rnd" (random) function to choose one of them.
All that remains to be done is to add a timer, firing, say, every minute, and calling the script routine DoRandomSocial.
The SocialsList variable itself is outside the sub, as building it up is only needed to be done once (when the script is loaded).
If you are going to use this code you had better generate your own list of socials from your own MUD (I used the ones on Blood Moon), and use an editor to put the quotes at the start and end, like I did below (and remove multiple spaces between them).
The net effect is MUSHclient sends a randomly-chosen social when the timer fires. Here is some example output ...
Here is the script code (VBscript) ...
By typing in "socials" I got a list of socials, and by copying and pasting (and removing multiple spaces) I was able to quickly get a list of them in usable form.
Then I used "split" (as suggested by Krenath) and the "rnd" (random) function to choose one of them.
All that remains to be done is to add a timer, firing, say, every minute, and calling the script routine DoRandomSocial.
The SocialsList variable itself is outside the sub, as building it up is only needed to be done once (when the script is loaded).
If you are going to use this code you had better generate your own list of socials from your own MUD (I used the ones on Blood Moon), and use an editor to put the quotes at the start and end, like I did below (and remove multiple spaces between them).
The net effect is MUSHclient sends a randomly-chosen social when the timer fires. Here is some example output ...
growl
Grrrrrrrrrr...
liver
You look angrily for someone to disembowel.
snowball
Who do you want to throw a snowball at?
beam
You beam delightedly at nothing in particular.
pound
You make vague pounding motions with your fist at the thought.
Here is the script code (VBscript) ...
dim SocialsList ' store list of socials
SocialsList = split ( _
"aargh acceptapol accuse adjust agree air " & _
"anticipate apologize applaud arias babble bark " & _
"bat bcatch beam bearhug beckon beer " & _
"beg bite bkiss bleed blink blush " & _
"boast boggle bonk bounce bow brb " & _
"buff burp cackle camel charge cheer " & _
"chortle chuckle clap claw collapse comfort " & _
"compliment confused conspire contemplate cough cover " & _
"cower cramp cringe criticize cry cuddle " & _
"cup curse curtsey dance daydream discodance " & _
"doh drool duck egrin embrace explode " & _
"eyebrow faint fart fatality flare flex " & _
"flinch flip flirt flutter foot french " & _
"frown fume furrow gack gag garlo " & _
"gasp giggle glare goose grimace grin " & _
"groan grovel growl grumble gulp halo " & _
"hand handshake head hiccup highfive homework " & _
"hop howl hug hush innocent insane " & _
"jig judge kiss groin laces laaag " & _
"laugh lean lick life listen liver " & _
"love lust massage meditate mime mischievous " & _
"moan mock mooon mosh mull mutter " & _
"nod noogie nudge nuzzle pale pant " & _
"passout pat peck peer pie pinch " & _
"pissed plead point poke polite ponder " & _
"pound pout powertrip pray propose pth " & _
"puke punch purr ramble raspberry rofl " & _
"roll romeo rub ruffle run sage " & _
"sarcasm scold scowl scratch scream scuff " & _
"serenade shake shiver shoo shrug shudder " & _
"sigh silly sing slap slobber smile " & _
"smirk snap snarl sneeze snicker sniff " & _
"snore snort snowball snuggle sob spam " & _
"spank spit squeal squeeze squint squirm " & _
"stagger stare starve stomp stretch strut " & _
"sulk support sweep swoon tackle tag " & _
"tank tap tease thank threaten tickle " & _
"tight tip toast tweak twiddle twirl " & _
"twitch type undress view violin wait " & _
"wave whap whine whip whistle wiggle " & _
"wince wink wonder worry worship wrestle " & _
"wrist yae yawn yeehaw yodel yowl " & _
"zerbert ")
Randomize ' Initialize random-number generator.
Sub DoRandomSocial (strTimerName)
world.send SocialsList ( rnd * ubound (SocialsList ))
End Sub