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
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Apr 12, 2008 4:51 pm   

Trigger that works on all my characters but one?
 
Here's the trigger, it seems to work on all of my characters but one...

for some reason, I also have to edit the pattern for each specific character, even though they all have the same style prompt.

I just want to know why it won't work for my one character, it just take a 0 and subtracts from it forever...


#REGEX tnl_grab {^<\w+/\w+ \w+/\w+ \w+/\w+mv (\w+)tnl \w+ \w+/\w+w \w+g/\w+s $} {tnl=%1} {General Triggers}

#REGEX xp_per {You receive (\w+) experience points.$}
{
tnl=@tnl-%1
~;%1xp and @tnl"tnl"
} {General Triggers}

It's supposed to grab:


<848/876hp 390/524m 292/304mv Xtnl 269pq 137g/88s
[Inside a Pine Forest] [NESW-NW-NE] 3:30am [Night Time]>

from this, and, on all of my other characters, it works fine. I always edit the pattern to:
^<\w+/\w+ \w+/\w+ \w+/\w+ (\w+)tnl \w+ \w+/\w+ \w+/\w+ $

So that's not it either.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Apr 12, 2008 5:34 pm   
 
Corrected Pattern: ^<\d+/\w+ \d+/\w+ \d+/\w+ (\d+)tnl \w+ \w+/\d+s\s*$ This one works.
Your old Pattern :^<\w+/\w+ \w+/\w+ \w+/\w+ (\w+)tnl \w+ \w+/\w+ \w+/\w+ $ This one does not work.

The \d only matches numbers and did not have anything to do with the fix. It only makes the match slightly faster.
The\s* just matches any amount of spaces including none.
So your problem was that you were trying to match one more set of numbers that was not there.

^<\w+/\w+ \w+/\w+ \w+/\w+ (\w+)tnl \w+ \w+/\w+ \w+/\w+ $
<848/876hp 390/524m 292/304mv Xtnl 269pq 137g/88s
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Apr 12, 2008 5:42 pm   
 
Oh, and it is taking Null which it is seeing as 0 when you try to do math and subtracting from that.
Because the variable is never getting set to anything by the prompt trigger the value of the variable is NULL or 0.
Nothing-something=-something
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Apr 12, 2008 6:01 pm   
 
Alright, but how come it worked on my other characters?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Apr 12, 2008 6:05 pm   
 
Because they are of different classes or races maybe?
Heck perhaps they just are of a higher level and have a different skill because of that.

You may have altered the prompt for this character and not remember it.
Or you may have altered the prompt for all of them.

I don't know I cannot tell you for sure why that prompt does not match the others but, as sure as the trigger works for them and not this one those prompts ARE different.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Apr 12, 2008 6:07 pm   
 
I use the same exact prompt, trust me Wink

^?([Quiet])<\d+/\w+ \d+/\w+ \d+/\w+ (\d+)tnl \w+ \w+/\d+s\s*$

should make it work if there's a [Quiet] in front of it?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Apr 12, 2008 6:15 pm   
 
^?([Quiet])<\d+/\w+ \d+/\w+ \d+/\w+ (\d+)tnl \w+ \w+/\d+s\s*$

Should be.

^(?:\[Quiet\])?<\d+/\w+ \d+/\w+ \d+/\w+ (\d+)tnl \w+ \w+/\d+s\s*$

Now it will work if there is or if there isn't.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Apr 12, 2008 6:18 pm   
 
yeah, I just figured that out :P

^(?:[Quiet])<\d+/\w+ \d+/\w+ \d+/\w+ (\d+)tnl \w+ \w+/\d+s\s*$

Thanks
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Apr 12, 2008 6:22 pm   
 
You left out a ? look at mine again. That ? is what makes the [Quiet] optional that and the fact that it is within (?:)
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Apr 12, 2008 6:51 pm   
 
Yeah, no. I said I came up with it on my own, and then looked here to see that it was the same as yours. So thanks. Smile
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Apr 12, 2008 10:41 pm   
 
Yours was not the same as his. His is (?:[Quiet])? while yours is (?:[Quiet]) only. Note the difference. The second ? makes it an optional reference.

Charneus
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Apr 12, 2008 11:29 pm   
 
Ah...

somehow I don't think that affects why it doesn't work on another character that's different:

<1097/1097hp 1087/1193m 370/370mv 48669tnl 188qp 871g/247s
[An Uneven, Hot Corridor] [NS] 9:30am [Day Time]>


The prompt should be the same, however. Sad
_________________
Listen to my Guitar - If you like it, listen to more
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