|
azurerazor Beginner
Joined: 17 Dec 2001 Posts: 20 Location: USA
|
Posted: Thu May 24, 2018 9:07 pm
Name Resolver |
I'm using a couple of string list variables along with a trigger to help REMEMBER names
I'm attempting to use this old ZMUD code to handle the task
https://zuggsoft.com/forums/viewtopic.php?p=91401
I have two issues
First and most important
<trigger priority="150" id="15">
<pattern>^({@LongName})</pattern>
<value>#substitute %-1 {%1 (%item( @CommonName, %ismember( "%1", @LongName)))}</value>
</trigger>
is creating another trigger when I have a match instead of changing the MUD output text
<trigger priority="160" id="16">
<pattern>A hardy, square-jawed fool</pattern>
<value>#sub {%1 (%item( @CommonName, %ismember( "%1", @LongName)))}</value>
</trigger>
Second and less importantly
My addname alias is not storing the variables
<alias name="addname" id="14">
<value>#additem CommonName {%1}
#additem LongName {%-2}
</value>
</alias>
When I execute this command
Addname Bill A hardy, square-jawed fool
ERROR: Syntax error in Alias: addname : extra } brace |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri May 25, 2018 11:56 am |
This should be all you need.
Enter it on the command line.
#ALIAS addName {
$comon=%param(1)
$long=%params(2)
#ADDKEY nameList $long $common
}
#TRIGGER {({@nameList})} {#SUB {%db(@namelist, %1)}} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
azurerazor Beginner
Joined: 17 Dec 2001 Posts: 20 Location: USA
|
Posted: Fri May 25, 2018 6:50 pm |
Very close but I would like the MUD TEXT to be
LongName (CommonName)
The current version only displays the CommonName
as a bonus coloring the CommonName in white :) |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sat May 26, 2018 11:53 am |
#SUB {%1 (<color white>%db(@nameList, %1)</color>)}
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
azurerazor Beginner
Joined: 17 Dec 2001 Posts: 20 Location: USA
|
Posted: Tue May 29, 2018 10:48 am |
Killer!
|
|
|
|
azurerazor Beginner
Joined: 17 Dec 2001 Posts: 20 Location: USA
|
Posted: Thu Jul 26, 2018 1:34 pm |
FYI the final in process version is
TRIGGER
<trigger priority="240" id="24">
<pattern>({@nameList})</pattern>
<value><![CDATA[#SUB {<color purple>%1</color> (<color white>%db(@nameList, %1)</color>)}]]></value>
</trigger>
ALIAS
<alias name="addName" id="21">
<value>$common=%param(1)
$long=%params(2)
#ADDKEY nameList $long $common</value>
</alias> |
|
|
|
|
|