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
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Mon Sep 20, 2010 3:34 am   

Pattern Matching.
 
I am trying to match the following line. Putting everything inside the brackets.
Code:
Str[avg] Dex[good] Con[great] Int[avg] Wil[good] Agi[avg]


I thought I had it correctly with the following but that doesn't match.
Code:
Str~[(%w)~] Dex~[(%w)~] Con~[(%w)~] Int~[(%w)~] Wil~[(%w)~] Agi~[(%w)~]
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
hadar
Apprentice


Joined: 30 Aug 2009
Posts: 198
Location: my apt, in california

PostPosted: Mon Sep 20, 2010 5:11 pm   
 
cna you give a little more info? i tryed out your strin and it worked for me
_________________
if you build it they will come, assuming that they have not already come to build it
Aardwolf Bootcamp
My youtube channel
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Sep 20, 2010 6:40 pm   
 
Copy and paste into your reply the line from the mud which this trigger should match, enclosing the line within [code]...[/code] markers.
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Mon Sep 20, 2010 8:51 pm   
 
Nevermind on this it works. I think it was the wizard not working correctly. I closed CMUD and reopened it with same string and it worked.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Tue Sep 21, 2010 1:46 am   
 
Matching to different sentences.
I am trying to store some information from the score command, but I have to different lines that I am having some difficulty with. Here is the score:
Code:

Mytrem, a 19 year old Common Human Male:

Str[avg] Dex[good] Con[great] Int[avg] Wil[good] Agi[avg]
Your soul sparks like embers flying free of a fire.
Your account has been awarded 1 roleplay points.
You are quite full, and feeling thirsty.
You are 63 inches tall, and weigh 129 pounds.
You are of medium build for one of your people, and wear size Small (S).
When in combat, your mode is Normal.
You are currently speaking Westron.
You are currently unencumbered.
You are carrying about 20 pounds.
You were born on the 20th day of Viresse, 2472.
You have been playing for 0 days and 7 hours.
You will fight with 100 percent of your effort.
You are standing.
You walk when you travel.
Your group is currently open to new members.

You are affiliated with the following clans:

  Dwellers in Gondor                       (Membership) 


Now the two lines that are getting confused are:
You are quite full, and feeling thirsty.
and
You are of medium build for one of your people, and wear size Small (S).

Now I have a few triggers, that capture the information I wanted, but the trigger for your hunger and thirst gets fired twice. The pattern is {You are (*) and (*).$} For this pattern I need the star because it can change to one or two words. The color is different for those words.
Now when I hit the second line the trigger gets fired again, which overwrites the first time it was triggered. Any ideas how to fix this?
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
shalimar
GURU


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

PostPosted: Tue Sep 21, 2010 2:08 am   
 
you might wanna use annonymous variables in your trigger pattern then since (*) grabs to many options.

instead of '(*)' use '({quite full|hungry|other states|etc})'

takes a little longer to get out the possible hunger states, but the trigger will be more precise.
_________________
Discord: Shalimarwildcat
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Tue Sep 21, 2010 2:11 am   
 
Duh!!!! I didn't even think of that. I should have remembered I could do that. :)
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
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