Modification to Random Socials Plugin?

Posted by Herb on Wed 07 Aug 2002 01:05 PM — 5 posts, 22,825 views.

United Kingdom #0
Many socials on my mud require a target.
If there is no target the mud returns 'Pardon?'
Could the plugin be expanded to automatically remove any socials that generate a 'Pardon?' response?
Australia Forum Administrator #1
It would be a bit tricky. For instance, on SMAUG, the error messages are different every time, eg.


tickle
Whom do you want to tickle?


So, you would have to detect each one, which would be a lot more work than just removing them as you find them.

The random socials currently has built-in to remove one, so for instance, you might type:


socials:remove tickle


In your case, with one word "Pardon?" it is easier, but then you have to know if the word relates to a recent random social, or just a typing error you made.

Personally I just ignore them - the occasional one that fails just adds to the colour a bit, and if the "pardon" annoys you, use the "remove" function to gradually prune your list.
United Kingdom #2
Fair comment.
To be honest I was more interested in the mechanics of a solution rather than actually being bugged by the pardon response.
Australia Forum Administrator #3
Ah, OK.

In that case I would do something like this...

When a random social is sent, remember the date/time (and the social itself).

Then make a trigger to match on "Pardon?", the trigger calls a script, and if this happens within (say) 2 seconds of the last random social, delete the saved random social from the list.
Canada #4
The way I would do it, is like this (is semi-pseudo code):

world.enabletrigger "emote watchdog", true
world.addtimer "emote watchdog timer", 2 seconds
save emote to variable
world.send "emote target"

OnEmoteTimerEnd
  world.enabletrigger "emote watchdog", false

OnWatchdogTrigger
  Delete appropriate emote

Fairly simplistic, and efficient in that the trigger doesn't waste execution time when it's not needed.