CMUD Change Reply to Tell Script

... A place to ask for help on any topic whether it be starting out to player killing to IT issues.
Post Reply
Jaili
Posts: 16
Joined: Sat Jun 01, 2019 1:49 pm

CMUD Change Reply to Tell Script

Post by Jaili » Tue Mar 31, 2020 1:15 pm

Edit: Since the ls to ss reply has been fixed with a coding change, this is no longer needed unless you chat with stabbers often.

With reply broken between LS and SS, Fermin mentioned it would be nice to have a script to get around this. I first wrote a simple one, then a more robust one. You might want to comment out or delete the #say lines. They were used for testing purposes.

The replybroken class is the simple one. It matches at the start of the line to prevent people from breaking it, but that also means it can be broken by the prompt sometimes. It will also still capture shopkeepers with only one name like Cyril in TV.


#CLASS replybroken
#var lasttellsender 0
#trigger {^(%w) tells you *} {#VAR lasttellsender %1;#SAY Last sender stored as @lasttellsender}
#ALIAS rep {tell @lasttellsender %-1}
#CLASS 0

The replybrokenexp class removes the check at the start of the line. This means an extra check to handle grocers, criers, etc. Cyril will still get captured, but you could add that or other shopkeepers you frequent to the (%1=~XXXXX) section. I'm still not sure how to handle someone chatting or saying a tell command, since those commands also end with '. At the least, it's something to get people started.

#CLASS replybrokenexp
#var lasttellsenderexp 0
#trigger {(%w) tells you '*'$} {#IF ((%1=~grocer)or(%1=~crier)or(%1=~adventurer)or(%1=~armorer)or(%1=~weaponsmith)or(%1=~tailor)or(%1=~petshopkeeper)or(%1=~blacksmith)or(%1=~soul)or(%1=~weaponsmith)or(%1=~banker)) {} {#VAR lasttellsenderexp %1;#SAY Last sender stored as @lasttellsenderexp}}
#ALIAS rep {tell @lasttellsenderexp %-1}
#CLASS 0

Post Reply