Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
azurerazor
Beginner


Joined: 17 Dec 2001
Posts: 20
Location: USA

PostPosted: 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
    Reply with quote
    shalimar
    GURU


    Joined: 04 Aug 2002
    Posts: 4691
    Location: Pensacola, FL, USA

    PostPosted: 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
    Reply with quote
    azurerazor
    Beginner


    Joined: 17 Dec 2001
    Posts: 20
    Location: USA

    PostPosted: 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 :)
    Reply with quote
    shalimar
    GURU


    Joined: 04 Aug 2002
    Posts: 4691
    Location: Pensacola, FL, USA

    PostPosted: Sat May 26, 2018 11:53 am   
     
    #SUB {%1 (<color white>%db(@nameList, %1)</color>)}
    _________________
    Discord: Shalimarwildcat
    Reply with quote
    azurerazor
    Beginner


    Joined: 17 Dec 2001
    Posts: 20
    Location: USA

    PostPosted: Tue May 29, 2018 10:48 am   
     
    Killer!
    Reply with quote
    azurerazor
    Beginner


    Joined: 17 Dec 2001
    Posts: 20
    Location: USA

    PostPosted: 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>
    Reply with quote
    Display posts from previous:   
    Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
    Page 1 of 1

     
    Jump to:  
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum

    © 2009 Zugg Software. Hosted by Wolfpaw.net