|
Reddytedy Apprentice
Joined: 13 Oct 2000 Posts: 114 Location: USA
|
Posted: 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 |
|
|
|
Reddytedy Apprentice
Joined: 13 Oct 2000 Posts: 114 Location: USA
|
Posted: 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)
}}
|
|
|
|
|
|
|
|
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
|
|