|
Y3KPanic Novice
Joined: 21 Apr 2004 Posts: 34
|
Posted: Mon May 17, 2004 12:59 am
Why Doesn't This Loop Structure Work? |
This is a prompt-based trigger that (or is supposed to) cycle through the list of things to do, do the next thing that my character is able to (whether it be something in the string list attacks, actions, or smoking), and then delete that thing from my to do list. The problem is, when I test it, all it does is return an empty line instead of issuing the command specified in my todo list. Is there something wrong with my loop structure? I'd greatly appreciate any help.
didsomething = 0
#FORALL @todolist {
#IF (%numitems( @todolist) > 0) {
#IF (@canfight and %ismember( %i, @attacks) and !@didsomething) {
%item( @todolist, i)
#delitem todolist %item( @todolist, i)
didsomething = 1
}
#IF (@cando and %ismember( %i, @actions) and !@didsomething) {
%item( @todolist, i)
#delitem todolist %item( @todolist, i)
didsomething = 1
}
#IF (@cansmoke and %ismember( %i, @smoking) and !@didsomething) {
%item( @todolist, i)
#delitem todolist %item( @todolist, i)
didsomething = 1
}
}
}
didsomething = 0
Also, I'd like to execute the commands on my todolist in the order I put them in, if possible. I am at a loss as to where I went wrong. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon May 17, 2004 3:14 am |
Anywhere that you have %item( @todolist, i) change it to %item( @todolist, %i) and try it again.
|
|
|
|
Y3KPanic Novice
Joined: 21 Apr 2004 Posts: 34
|
Posted: Mon May 17, 2004 3:45 am |
Thanks. I changed it to %i, which also did the trick.
|
|
|
|
|
|
|
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
|
|