Just for fun, I have created just a few auto-response emotes (socials) for humourous purposes. If you are very sensitive to poor sexual comments, you may want to ignore the rest of this post, as it can be a tad distasteful in it's attempt to be funny.
A few people at Ages of Despair MUD have asked me how it was done, so I will provide the code here.
First, the trigger which detects that someone has used the "pet" emote to pet me:
<triggers>
<trigger
enabled="y"
match="^(?:> )*(?:\*)*(\w*) pets you lovingly\.$"
name="EMOTE_pet"
regexp="y"
script="Emote_Pet"
sequence="100"
>
</trigger>
</triggers>
(The > is actually a > in my trigger.)
Now, the script that it calls:
Sub Emote_pet (TriggerName, TriggerLine, arrWildcards)
If NOT (World.IsTimer("Emote_Pet_Timer") = 0) Then
EmotePet = 0
End If
If LCase(arrWildcards(1)) <> EmotePetter Then
EmotePetter = LCase(arrWildcards(1))
EmotePet = 0
End If
If LCase(arrWildcards(1)) = "quintesence" Then
World.LogSend "remote " & LCase(arrwildcards(1)) & " smiles as you pet him."
Else
EmotePet = EmotePet + 1
Select Case EmotePet
Case 1
World.LogSend "remote " & LCase(arrwildcards(1)) & " develops an erection, better not pet him anymore!"
World.DeleteTimer "Emote_Pet_Timer"
World.AddTimer "Emote_Pet_Timer", 0, 0, 15, "", 5, ""
Case 2
World.LogSend "remote " & LCase(arrwildcards(1)) & " moans and thanks you for petting his erection."
World.DeleteTimer "Emote_Pet_Timer"
World.AddTimer "Emote_Pet_Timer", 0, 0, 15, "", 5, ""
Case 3
World.LogSend "remote " & LCase(arrwildcards(1)) & " makes a mess in your hands! Thank you!"
World.DeleteTimer "Emote_Pet_Timer"
World.AddTimer "Emote_Pet_Timer", 0, 0, 15, "", 5, ""
Case Else
World.LogSend "remote " & LCase(arrwildcards(1)) & " dodges your messy hands. Eww! Stay away!"
World.DeleteTimer "Emote_Pet_Timer"
World.AddTimer "Emote_Pet_Timer", 0, 5, 0, "", 5, ""
End Select
End If
End Sub
The script uses the existance of a timer to determine what stage of emote to respond with. If the sender repeats a second emote within 15 seconds, they get the stage 2 response. Again and they get the stage 3 response. Yet again, and they receive the 4th (and final response). They will continue to get the last response for 5 minutes, or until someone else performs the emote, in which case the routine is reset to their name.
There is an exception check made for a player named "quintesence". If that player uses the "pet" emote with me as a target, they get a custom response. |