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


Joined: 09 May 2008
Posts: 15

PostPosted: Sat May 10, 2008 11:47 am   

a word problem
 
so I know this is probably be a completely insanely simple question but for some reason I can't get it. So when I see how far I have practiced a certain skill I get this info from the mud.

skill name number

All I want is to get the skill name and place it into a var. However I can't seem to get it to work when there are two words in the skill name.

I know this is stupid simple, I just can't wrap my head around it. I can get two words just fine and place into a var but the skill name is not always two words.

I don't know if this is making sense as I am extremely tired right now. 36 hours awake straight and all.

Thanks to all who try to understand my jibberish
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat May 10, 2008 12:07 pm   
 
It's always easier to understand if you show as well as explain.
Show us what's coming from the mud
Show us what you've tried
Show us what you expected it to do, and what it did instead.
Its pretty difficult to misunderstand if you do all that.

Anyways maybe this is what you were after
Code:
#REGEX {^(\a+(?: \a+)?) (\d+)} {
 #echo SKILL:%1
 #echo NUMBER:%2
}


You may or not want to remove the ^ I'm not sure if the match should start at the beginning of the line
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
njkc07
Beginner


Joined: 09 May 2008
Posts: 15

PostPosted: Sat May 10, 2008 7:48 pm   
 
apologies. Here is what I get from the mud when I type "prac energy sphere"

Code:
You have 6 practice sessions remaining.
energy sphere        47


I have an autoprac script that practices a spell/skill I have in the variable @spell. I want to expand the autoprac script I have to work off a string list of different skills/spells that I pick out. When one skill is at 90 it changes over to the next in the string list while removing the one in @spell fromt he string list. String lists I can work with fairly well. I just can't seem to figure out how to capture both words for the skill name if there are two or only a single if there is only one word for the skill name. That way I could sy something along the line of

#if (pracingskil = 90) then remove pracing skill from stringlist; @spell = next skill in stringlist.

As far as what I have tried....

I keep trying al different combinations of wildcards to place in the trigger line.


*yay spaces now there


Last edited by njkc07 on Sat May 10, 2008 8:02 pm; edited 2 times in total
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat May 10, 2008 7:57 pm   
 
Code:
#REGEX {^(\a+(?: \a+)?)\s{6,8}(\d+)} {
 #echo SKILL:%1
 #echo NUMBER:%2
}
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
njkc07
Beginner


Joined: 09 May 2008
Posts: 15

PostPosted: Sat May 10, 2008 8:04 pm   
 
you are genious!! Thank you tons!

*edit

Thanks again, I now have a fully functional autoprac script. I can finally catch up on all my skill pracing by just adding those left behind to the list. You have helped make my life much much easier!
Reply with quote
njkc07
Beginner


Joined: 09 May 2008
Posts: 15

PostPosted: Sat May 10, 2008 9:34 pm   
 
real quick, the {6,8} refers to how much whitespace there could be?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat May 10, 2008 9:56 pm   
 
Yeah, between 6 and 8 spaces. You can change the numbers, or remove the whole {n,n} and replace it with a + to mean "one or more" if there's a very variable number of spaces there.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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