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
Firey
Wanderer


Joined: 30 Dec 2003
Posts: 61
Location: Norway

PostPosted: Sun May 30, 2004 5:47 pm   

eatqueue
 
I wonder how I can put stuff first in a stringlist if there's already some other stuff in the Stringlist..

ALIAS:

Name:
Eatq

Value:
#IF ((@eat=0) and (%item( @eatqueue, 1) = "")) {
outr %1
eat %1
#VAR eat 1
} {#IF (%2 = 1) {#VAR eatqueue %concat( %1, "|", @eatqueue)} {#VAR eatqueue %additem( %1, @eatqueue)}}


Trigger:

Pattern:
You are paralysed and unable to do that.

Value:
#cw 900
#echo EB-BLOODROOT
eatq bloodroot
eat bloodroot

That's how it is... how can I make the Eatq bloodroot put bloodroot first in the eatqueue list?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun May 30, 2004 7:23 pm   
 
These two functions might help you a little
#HELP %push
#HELP %pop

#IF (%2 = 1) {#VAR eatqueue %push("%1",@eatqueue)} {#VAR eatqueue %additem( %1, @eatqueue)}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun May 30, 2004 10:20 pm   
 
Do you not understand your own alias? If you want something added to the beginning of the queue, use
eatq bloodroot 1

If you want it added to the end of the queue, use
eatq bloodroot

The alias might need a small modification in order to have items added at the end of the queue. Remove the = 1 after %2.
Value:
#IF ((@eat=0) and (%item( @eatqueue, 1) = "")) {
outr %1
eat %1
#VAR eat 1
} {#IF (%2) {#VAR eatqueue %concat( %1, "|", @eatqueue)} {#VAR eatqueue %additem( %1, @eatqueue)}}
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