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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
EagleVeteran
Newbie


Joined: 31 Mar 2006
Posts: 7

PostPosted: Fri Mar 31, 2006 5:16 pm   

NEWBIE ** I would like to have ZMUD match descr to names
 
First off I did search ( replace mud text, friend list, etc)

Found only this to be similiar and would be cumbersome for handling 50+names http://forums.zuggsoft.com/phpbb/viewtopic.php?t=6283&highlight=replacing+mud+text
This does not work for me , but I did not try to resolve it yet... thinking that a list of 50 desc might be too long for the var.



My mud uses descriptions rather than names

MUD SENDS (colored text)--> An elderly man with a thin, crooked nose

This guys name is Finneus

What I would like to see is
An elderly man with a thin, crooked nose (Finneus)

Further since there will be 50 or so names it seems this should be done in a DB....
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Apr 03, 2006 1:11 pm   
 
Use something like this. A variable with an index key and a resolver.

#var vNameResolver %null
#alias addname {#additem vNameResolver.ShortList %1;#additem vNameResolver.LongList {%-2};#additem vNameResolver.%1 {%2}}
#trigger {(@{vNameResolver.LongList})} {#sub {%1 ~(%item(%ismember({%1},@vNameResolver.LongList),@vNameResolver.ShortList)~)}

Syntax: addname Finneus An elderly man with a thin, crooked nose
Allows for #SHOW Long name for Finneus is @vNameResolver.Finneus

Untested but the idea is there.

It creates two lists whose order is important. The first item in ShortList is equal to the first item in the LongList etc.
Reply with quote
EagleVeteran
Newbie


Joined: 31 Mar 2006
Posts: 7

PostPosted: Tue Apr 04, 2006 10:37 pm   
 
Can't seem to get anything working at all with that idea... so I revertted back to the idea referred to in the other post referenced above

VAR's LongName and CommonName which are string lists

and a trigger

Pattern
{@LongName}

Value
#sub {%1 ~(%item( @CommonName, %ismember( "%1", @LongName))~)}

MUD output without trigger
A young grey tabby cat prowls around here.

MUD output w/ trigger
A you~(~)ls around here.


Which does not make much sense... Any ideas?
Reply with quote
EagleVeteran
Newbie


Joined: 31 Mar 2006
Posts: 7

PostPosted: Tue Apr 04, 2006 10:41 pm   
 
By the way
When I change the trigger value to
#show %1

gives me no additional output.... it is as if this value is not captured?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Apr 05, 2006 2:28 am   
 
Quote:

Pattern
{@LongName}


You need parentheses around the {@longname} part.
_________________
EDIT: I didn't like my old signature
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Apr 05, 2006 6:28 pm   
 
This looks like what someone else is asking
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=6283

To adapt for you
Quote:

#VAR CommonName {GreenGoo|BlueTroll}
#VAR LongName {large, green blob of jelly|large, blue troll}
#TRIGGER {({@LongName})} {#substitute %-1 {%item( @CommonName, %ismember( "%1", @LongName))}}
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
EagleVeteran
Newbie


Joined: 31 Mar 2006
Posts: 7

PostPosted: Wed Apr 05, 2006 6:43 pm   Wow, It's really close now
 
BTW, Guinn that was the discussion forum that I linked in my first post.
___________________________________________________________

Thanks for all your help BTW... This stuff is WAY over my head

Trigger is working fine, but the output is coming out (GARBLED) but readable, but with all correct INFO

Trigger
Patter
({@LongName})
Value
#sub {%1 ~(%item( @CommonName, %ismember( "%1", @LongName))~)}

Output from MUD (no trigger)
An angular-faced, slender man patrols here, looking hawkishly about.

Output (with Trigger)

An anAn angular-faced, slender man (Solder #4)ols here, looking hawkishly about.

I changed up my VAR's a bit to determine that whats happening is... The first four letters(five characters) of MUD output are showing before trigger fires... so there is the duplication. Somehow that causes the description after the name to gte cut off as well?

Its getting close, in fact its usable at this point but I would like to post this to the finished scripts forum
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Apr 05, 2006 11:50 pm   
 
Odd, it works fine for me. This is the exact code and test I did, and the output from it...

Code
Quote:
#VAR CommonName {GreenGoo|BlueTroll|Solder #4}
#VAR LongName {large, green blob of jelly|large, blue troll|angular-faced, slender man}
#TRIGGER {({@LongName})} {#substitute %-1 {%1 ~(%item( @CommonName, %ismember( "%1", @LongName))~)}}

#show An angular-faced, slender man patrols here, looking hawkishly about.


ZMud output:
Quote:
An angular-faced, slender man (Solder #4) patrols here, looking hawkishly about.


Perhaps use #PRIORITY?
Quote:
#TRIGGER {({@LongName})} {#priority {#substitute %-1 {%1 ~(%item( @CommonName, %ismember( "%1", @LongName))~)}}}
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
EagleVeteran
Newbie


Joined: 31 Mar 2006
Posts: 7

PostPosted: Thu Apr 06, 2006 1:04 pm   Roar!!!!
 
emote stands and applauds ~guinn and ~mattlofton, with shouts and whistles

It works!!!

Two final questions just to make it pretty...
What can I do to make it trigger only at the beginning of a line?
and how do I make the the output WHITE and leave the rest of the line as colored from the MUD...
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Thu Apr 06, 2006 7:19 pm   
 
Which bit do you want to make white? The 'Soldier #4'?
#TRIGGER {^({@LongName})} {#priority {#substitute %-1 {%1 ~(<color $FFFFFF>%item( @CommonName, %ismember( "%1", @LongName))</color>~)}}}

Or the angular-faced man?
#TRIGGER {^({@LongName})} {#priority {#substitute %-1 {%1 ~(%item( @CommonName, %ismember( "%1", @LongName))~)};#PCOL white %x1}}

Btw, using the ^ at the start forces a match at the start of the line
Reply with quote
EagleVeteran
Newbie


Joined: 31 Mar 2006
Posts: 7

PostPosted: Thu Apr 06, 2006 8:45 pm   OK I guess this is FINAL then (Shadows of Isidur)
 
#var LongName
#var CommonName

alias

Pattern
addname

Value
#additem CommonName %1
#additem LongName {%-2}
(could not get this to work as a single line command)

And the Trigger
#TRIGGER {^({@LongName})} {#priority {#substitute %-1 {%1 (<color $FFFFFF>%item( @CommonName, %ismember( "%1", @LongName))</color>)}}}

Restriction Names are 1 word only!!
To add a name type
Addname Bill Freckled, red-head boy with brown eyes

Enjoy knowing peoples names IC!
Reply with quote
azurerazor
Beginner


Joined: 17 Dec 2001
Posts: 20
Location: USA

PostPosted: Thu Aug 31, 2006 8:38 pm   
 
Any idea why this would stop work all of a sudden?

I have used it for months then all of a sudden nothing, other triggers work but not this one...

I even deleted the trigger and re-entered it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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