|
Serael Newbie
Joined: 29 May 2006 Posts: 8
|
Posted: 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. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Aug 09, 2006 4:17 am |
Check for this in the #IF:
#IF (@powbal = 1 & %numitems(@powq) > 0) {%pop(powq)} |
|
_________________ Kjata |
|
|
|
Serael Newbie
Joined: 29 May 2006 Posts: 8
|
Posted: Wed Aug 09, 2006 4:26 am |
Ah, that works wonderfully. Thanks!
|
|
|
|
Serael Newbie
Joined: 29 May 2006 Posts: 8
|
Posted: 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. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: 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$} |
|
|
|
|
|