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
BlackSmith
Apprentice


Joined: 08 Dec 2002
Posts: 152

PostPosted: Fri Jun 02, 2006 2:56 pm   

#AddItem & clearing alias bugs?
 
I resently found a nice "bug".

I get this kind of feed from mud
Code:
,--------------------------------------------------------------------.
| Guild name                             |     Command | Level | Max |
|====================================================================|
| The Conjurers                          |    conjurer |    18 |  25 |
| Denizens of the Underdark              |    denizens |     5 |   5 |
| Fight Club                             |         fc+ |     0 |   8 |
| Magical background                     |     magical |    10 |  10 |
| Metal Warriors of the World            |      metal+ |     0 |   1 |
| The Association of Mystical Navigators |   navigator |     5 |   5 |
| Default long name                      |  nightlife+ |     0 |   1 |
| The Psionicists                        |  psionicist |    35 |  35 |
| Default long name                      |      turku+ |     0 |   1 |
`--------------------------------------------------------------------'

Now, i have a nice trigger that executes
Code:
#Variable guilds ""
when it finds
Code:
^| Guild name %s | %s Command | Level | Max |
from input.

So now i (should) have empty variable called guilds where my trigger
Code:
^\| (.*)\s+\|\s+([\+a-z]+) \|\s+(\d+) \|\s+(\d+) \|

#AddItem Guilds %2
should store all the guild names that i have.
But, alas, i get a empty text variable for time to time.

Ideas where this might come?
_________________
BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Jun 02, 2006 4:32 pm   
 
Does it sometimes work correctly?

My guess is that the second trigger is sometimes not firing for some reason. Could be that the format sent by the MUD is slightly different sometimes. Like some extra or missing spaces, for example.
_________________
Kjata
Reply with quote
shalimar
GURU


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

PostPosted: Fri Jun 02, 2006 6:56 pm   
 
#IF (!%null(%2)) {#AddItem Guilds %2}
_________________
Discord: Shalimarwildcat
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jun 02, 2006 10:24 pm   
 
According to all the information you posted %2 would correlate to the "Command" column and not the "Guild name" column. Also you should get in the practice of using proper delimeters. In this case braces are correct:
#AddItem Guilds {%1}

CMud will do much to eliminate the stricter need for delimeters in certain situations, but it is still a good habit to have.

I can't see any reason for the Regex to fail to match, although there have been some reported, and as yet unresolved possible bugs with white space matching. You might try using a fixed width pattern and then %trim your captured data.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
BlackSmith
Apprentice


Joined: 08 Dec 2002
Posts: 152

PostPosted: Mon Jun 05, 2006 1:07 pm   
 
Kjata wrote:
Does it sometimes work correctly?
Maybe once for every ten times on average.
Kjata wrote:
My guess is that the second trigger is sometimes not firing for some reason. Could be that the format sent by the MUD is slightly different sometimes. Like some extra or missing spaces, for example.
I actually found the bugging part.
The clearing triggers pattern should have been
^\| Guild name \s+ \| \s+ Command \| Level \| Max \|
I tested it with Echo's and suddenly the clearing trigger started to loop on itself so i suspected incorrect prel.
And so it was.
thanks for all the help
shalimar wrote:
#IF (!%null(%2)) {#AddItem Guilds %2}

#ADDITEM wrote:
Duplicated values are not added using this command.

Vijilante wrote:
According to all the information you posted %2 would correlate to the "Command" column and not the "Guild name" column. Also you should get in the practice of using proper delimeters. In this case braces are correct:
#AddItem Guilds {%1}
No.
I want the command stored so i can use it later.
_________________
BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient.
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