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


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Wed Jan 29, 2003 7:22 am   

A really simple question that i just can't fix :(
 
A line in the mud is like this

Level: 3 Mental barrier Mana: 5 Learned: 84%


(hope that turned out ok..its all one line anyways)
What i want to do is capture the lvl, mana amount, and learned amount AND the name of the spell

I tried this... but i dunno how to access all the %n etcs, i know i'm not doing it right...but i'm still pretty new and the help file sorta sucks on this.

Level:%s%n%s&Spellname%sMana:%s%n%sLearned:%s%n~%


And another question, WHY when i click on the triggers button is it always in some subfolder and not in the main directory or in the last directory i was working in, its starting to really annoy me!

V6.40 if that helps
Reply with quote
Kitana
Newbie


Joined: 04 Jul 2002
Posts: 6
Location: Germany

PostPosted: Wed Jan 29, 2003 7:38 am   
 
try..

^Level: (%d) (*) Mana: (%d) Learned: (%d)~%$

now %1 should be the lvl, %2 the name of the spell, %3 mana amount and %4 learned amount..
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Wed Jan 29, 2003 7:42 am   
 
your going in the right direction, but here's what i would recommend: lose the & and use () to save patterns. the trigger would look something like this:

#tr {Level:%s(%d)%s(*) Mana:%s(%d)%sLearned:%s(%d)~%} {
#var level %1
#var name %trimright(%2)
#var mana %3
#var learned %4
}

the key is putting () around a pattern, everything inside the parenthesis will be stored to a parameter %1 - %99, in the order they came in the line, that you can access in the commands of your trigger.

--note: i added the %trimright function call because it looks like we might not be sure how many spaces are between each of the words. if you know for sure how many spaces there will be, then you can cut out the %s wildcards and put the spaces in the pattern.

--------

moon.icebound.net:9000
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Wed Jan 29, 2003 7:42 am   
 
No that doesn't work because it is trying to match the number of spaces b4 the trigger is set off, that is why i had the %s's in there... so, its useless for when a double digit number comes along :(


but even they way you had it, it didn't work at all...so something else must be wrong as well
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Wed Jan 29, 2003 7:43 am   
 
aah ok thanks Emit, i'll try your idea now :)
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Wed Jan 29, 2003 7:45 am   
 
i love when everyone posts at the same time

--------

moon.icebound.net:9000
Reply with quote
tbone235
Apprentice


Joined: 02 Nov 2002
Posts: 107
Location: Australia

PostPosted: Wed Jan 29, 2003 7:45 am   
 
Works perfectly! :) thanks!
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