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
Anders
Novice


Joined: 14 Jul 2003
Posts: 31
Location: USA

PostPosted: Fri Mar 17, 2006 6:32 am   

Trubble with putting text with ['s to variable.
 
For some time now I have been using ansi trigger to capture my roomnames, the same trigger adds the entire roomname and exits to a variable.
I was making minor changes to the trigger and suddenly the ['s and ]'s disappeard from the variable that I store the name to.

The text I get from the mud is:
Code:
Sea of Hylar [n,e,s,w,d].

And before that is what got enterd into the variable.
But now the variable only contains:
Code:
Sea of Hylar n,e,s,w,d.

I have made no changes at all to the line which adds to the variable, which follows:
Code:
  currentroom="%1"


How do I make it work again?
I have tried %quote but it does not work.

The name sent to the mapper has change the same way, the line is:
Code:
  #tag {name} %1
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Mar 17, 2006 6:43 am   
 
The characters '[' and ']' are special characters in zMud. If you're matching on them you can use '~' to match explicitly. If you just the value, then on your trigger check the options and make sure the option for 'Verbatim' is selected.
_________________
Asati di tempari!
Reply with quote
Anders
Novice


Joined: 14 Jul 2003
Posts: 31
Location: USA

PostPosted: Fri Mar 17, 2006 6:50 am   
 
Perhaps you missunderstood me. The trigger fires, it's just that not the entire string gets added to the variable.
If anyone wonders, the trigger pattern is:
Code:
^((*){|$}%e[{|0;}32m ~[(*)~]%e[0m.)$
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 17, 2006 11:39 pm   
 
Quote:

^((*){|$}%e[{|0;}32m ~[(*)~]%e[0m.)$


You problem stems from early expansion of %1...%99 variables. To get around this, either play around with the %expand() function or remove the outermost set of parentheses and either stuff all the ansi code/plain text into one of the two remaining sets of parentheses or rebuild the string you want using %concat().

#trigger {^(*){|$}%e[{|0;}32m ~[(*)~]%e[0m.$} {
blah blah blah
CurrentRoom = %concat("%1", "%e[32m ~[", "%2", "~]%e[0m.")
blah blah blah
}
_________________
EDIT: I didn't like my old signature
Reply with quote
Anders
Novice


Joined: 14 Jul 2003
Posts: 31
Location: USA

PostPosted: Fri Mar 24, 2006 12:54 am   
 
Thank you. That seems to be working good.
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