In my Mud we have the "*" symbol to identify those not in my Kingdom.
For example:
*NEWBIE aratar from Tier*
*Duke Althalus*
I'm trying to have a trigger that when I'm locating items i can say or tell who is holding that item.
Example:
A green Ring of Protection is carried by *Baron Sieyl*
trigger
tell Baron Sieyl "How much for your green Ring of Protection"
Is it always going to be "A green Ring of Protection" or will it be more general than that?
More general. Went with that because the items can be one word or multiple, and wanted to cover a few bases.
I have a number of tutorials and videos about scripting and making triggers, for example:
http://www.gammon.com.au/forum/?id=9626
Please show what you have done so far, and explain in what way it is not working. To show your existing trigger see this:
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see
Copying XML.
<triggers>
<trigger
match="^(.*?) is carried by *(.*?)*"
regexp="y"
sequence="100"
>
<send>gtell %3 Are you wanting to sell your %1 </send>
</trigger>
</triggers>
The main issues i'm having is the * Surrounding the name, the fact they have titles, and the multi word usage. Watched most of your tutorials on it, but haven't seen anything that can fix this issue. Thank you too!
First, your trigger wasn't enabled. Second, as I explain in my page about regular expressions, if you want to match on an asterisk itself you have to put a backslash around it, like this:
<triggers>
<trigger
enabled="y"
match="^(.*?) is carried by \*(.*?)\*$"
regexp="y"
sequence="100"
>
<send>gtell %3 Are you wanting to sell your %1 </send>
</trigger>
</triggers>
For advice on how to copy the above, and paste it into MUSHclient, please see
Pasting XML.
Regular expressions
- Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
- Also see how Lua string matching patterns work, as documented on the Lua string.find page.