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
kingfish1
Beginner


Joined: 13 Jun 2005
Posts: 20

PostPosted: Mon Jun 13, 2005 5:07 pm   

Triggers and Special Characters
 
I am having a bit of trouble handling special characters.

The text that is giving me the problems is:
Bob is auctioning {*>SweetDreamS<*} (Level 1, Num 84). Current bid is 100.

The trigger is:
(%w) is auctioning &equipSearch ~(Level (%d), Num (%d)~). Current bid is *.


The variable equipSearch is picking up:
*>SweetDreamS<*

Is there anyway to store the curly brackets in the variable so it matches the origional string?

While I am on special characters:
I have a variable that is storing the following text (with the parentheses):
(Shinny Boots)

A text variable handles this fine. When I add it to a data record it loses the parentheses, so it is stored in the database as:
Shinny Boots

Any help would be greatly appreciated.

Kingfish
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Mon Jun 13, 2005 7:17 pm   
 
me too, found the solution for [] was %expand, but with %expand {} are stripped

just been living with it as noboby came up with a solution in a previous thread, P.S. Aardwolf?
Reply with quote
Ikyu
Beginner


Joined: 27 Feb 2005
Posts: 24

PostPosted: Mon Jun 13, 2005 8:44 pm   
 
I used the following pattern:
Code:
(%w) is auctioning (*) ~(Level (%d), Num (%d)~). Current bid is *.

and as action had it do:
Code:
#SHOW %1 - %2 - %3 - %4


this resulted in the following:
Code:
Ikyu is auctioning -={ Einstein's Belt }=- (Level 141, Num 291). Current bid is 100.

with result:
Code:
Ikyu - -={ Einstein's Belt }=- - 141 - 291


soo it is picking up the { this way..
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Tue Jun 14, 2005 3:23 am   
 
Ikyu store %2 in a variable...
then #show @variable
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Tue Jun 14, 2005 11:45 am   
 
Don't this fall into the whole "use " or ' marks around things" post of Nex's?
_________________
Reply with quote
kingfish1
Beginner


Joined: 13 Jun 2005
Posts: 20

PostPosted: Tue Jun 14, 2005 5:03 pm   
 
Nah, This doesn't have anything to do with that post. I have yet to see a post that addresses this question correctly.

The variable is created directly in the trigger:

(%w) is auctioning &equipSearch ~(Level (%d), Num (%d)~). Current bid is *.

If the var equipSearch has a double quote around it, or is surrounded by brackets Zmud will drop them when storing it.

Here are a few examples of the problem

Bob is auctioning "sword" (Level 1, Num 340). Current bid is 100.
Bob is auctioning {sword} (Level 1, Num 340). Current bid is 100.
Bob is auctioning [sword] (Level 1, Num 340). Current bid is 100.

I can't escape the special characters with a ~ becuase I don't what they are before hand.

Thanks in advance for any help.

Kingfish
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jun 14, 2005 10:26 pm   
 
So, umm, why not go with other wildcards and simply handle the assignment via #VAR or even the a=b syntax?
_________________
EDIT: I didn't like my old signature
Reply with quote
kingfish1
Beginner


Joined: 13 Jun 2005
Posts: 20

PostPosted: Wed Jun 15, 2005 3:04 am   
 
So, are you saying try something like:

(%w) is auctioning (*) ~(Level (%d), Num (%d)~). Current bid is *.

and then

#VAR aucItem {%2}
or
#VAR aucItem "%2"

That still doesn't work. If the second pattern is surrounded by special characters like I mentioned below it will not save them to the variable. Myself and several others would be anxious to see if you have tested a way that this works.

Thanks again for taking the time.

Kingfish
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Wed Jun 15, 2005 3:16 am   
 
Testing this with #SHOW, this seems to work with all your examples:


#TRIGGER {(%w) is auctioning (*) ~(Level (%d), Num (%d)~). Current bid is *.} {#VARIABLE aucitem {%literal( %2)}}
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 16, 2005 12:04 am   
 
Well, you should be glad to know I tested a way to make your problem disappear...it's exactly the same trigger pattern you started the post with (tested with the very line you posted that the trigger pattern was based on). What version of ZMud are you using? I'm starting to think it's more interference from some Preference setting or one of those niggling quirky glitches that randomly spring up for no reason.

If it's a preference setting, it might be Strip quotes.
_________________
EDIT: I didn't like my old signature
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