Question about waitfor on 03/04/2011 06:29 PM CST
Links-arrows 1
Reply Reply
Curious,

Is there a way to write a script to run with two similiar waitfor commands?

For instance

waitfor A green goblin runs into the room.
put Attack Green Goblin

waitfor A blue goblin runs into the room.
put Attack Blue Goblin


Is there a way to write the script so both actions could trigger either command that happens first?

Chris
Reply Reply
Re: Question about waitfor on 03/04/2011 06:45 PM CST
Links-arrows 2
Reply Reply
I would use a matchwait for that. An example for you would be:

PUT LOOK
match ATTACK a green goblin
match ATTACK a blue goblin
matchwait

ATTACK:
put attack goblin

And etc.


-Adam


"You guys took all the pretty places." ~Anonymous
Reply Reply
Re: Question about waitfor on 03/09/2011 11:42 AM CST
Links-arrows 3
Reply Reply
The above post needs some changes in syntax...

If the action you perform is identical regardless of the item matched, you can use the following:

put look
match greengobhere a green goblin
match bluegobhere a blue goblin
match redgobhere a red goblin
matchwait
greengobhere:
bluegobhere:
redgobhere:
put attack goblin


If the actions are separate, use the following:


put look
match greengobhere a green goblin
match bluegobhere a blue goblin
match redgobhere a red goblin
matchwait
greengobhere:
put [action1 here]
end
bluegobhere:
put [action2 here]
end
redgobhere:
put attack goblin
end


The put look command is used in case there is a goblin present in the room you are dealing with.

DISCLAIMER - AFK scripting is not allowed, that is all.
Reply Reply