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


Joined: 13 Oct 2000
Posts: 114
Location: USA

PostPosted: Mon Feb 09, 2004 5:49 am   

List problem (simple oversight most likely)
 
Hi again, me with another silly syntax problem.

What I am trying to do is cycle through a list of forageable items and when I get to the end of the list start the list over.

The list is.

foragelist="leaf|rock|root|stick|twig|wood chip"
foragecount=1

Now here is the trigger I have, not including the pattern since that part is working fine.

Code:

#IF (@Foragecount<=%numitems( @foragelist)) {#ALARM +%1 {put %item(@foragelist,@foragecount) in @bin;#add foragecount 1;forage careful %item(@foragelist,@foragecount)} {#ALARM +%1 {put %item(@foragelist,@foragecount) in @bin;foragecount 1;forage careful %item(@foragelist,@foragecount)}



Thanks..

Alan
Reply with quote
Reddytedy
Apprentice


Joined: 13 Oct 2000
Posts: 114
Location: USA

PostPosted: Mon Feb 09, 2004 5:51 am   
 
Nevermind I found the problem hehe, I knew it was a simple one. Or two.

Alan

Code:

#IF (@Foragecount<%numitems( @foragelist)) {#ALARM +%1 {
    put %item( @foragelist, @foragecount) in @bin
    #add foragecount 1
    forage careful %item( @foragelist, @foragecount)
    }} {#ALARM +%1 {
    put %item( @foragelist, @foragecount) in @bin
    foragecount=1
    forage careful %item( @foragelist, @foragecount)
    }}
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