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
Serael
Newbie


Joined: 29 May 2006
Posts: 8

PostPosted: Wed Aug 09, 2006 4:12 am   

Problem with %pop
 
Hello, I've got yet another problem...

I've got a trigger based on my prompt, to check a stringlist and run the first thing in it.

Pattern: (%d)/(%d)h (%d)/(%d)m
Value : #if {@powbal=1} {%pop( powq)}

Problem is, when @powbal=1, and the powq stringlist is empty, zMUD starts entering blanks, and scrolls needlessly. How would I stop this?

Thanks in advance.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Aug 09, 2006 4:17 am   
 
Check for this in the #IF:

#IF (@powbal = 1 & %numitems(@powq) > 0) {%pop(powq)}
_________________
Kjata
Reply with quote
Serael
Newbie


Joined: 29 May 2006
Posts: 8

PostPosted: Wed Aug 09, 2006 4:26 am   
 
Ah, that works wonderfully. Thanks!
Reply with quote
Serael
Newbie


Joined: 29 May 2006
Posts: 8

PostPosted: Wed Aug 09, 2006 5:05 am   
 
EDIT: Another problem with %pop...

#if {@powbal = 1 & %numitems( @powq)>0} {%pop( powq)} is the trigger off my prompt now.

Now, @powq stringlist gets filled by:
#TR {blahblah} {#VAR powq %additem( "eat blah", @powq)}
#TR {blahblah2} {#VAR powq %additem( "eat blah2", @powq)}

Everything works right if blahblah hits, but if blahblah2 hits also at the same time, %pop doesn't just fire off the first string on the stringlist, but fires off both "eat blah"s.

Thanks in advance.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 10, 2006 3:23 am   
 
Use the $ delimiter in the trigger's pattern to tell zMUD that nothing else should come after it.
_________________
Kjata
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Thu Aug 10, 2006 3:42 pm   
 
Yeah, because when you trigger blahblah, it doesn't matter if you have blahblah2343424234 or not, it still sees the blahblah and fires.

So, like Kjata said, you'd want something like #TR {blahblah$} and #TR {blahblah2$}
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