I am new to vbscript, and I am attempting to script a flee steal routine. I have done extensive research and I haven't yet seen the problem I am having addressed here.
Any help would be appreciated.
Here is a general description of the problem.
I have a targeting system, similar to a pk targeting system. I have a victim, and a list of items to steal from the person put in an array via a variety of aliases.
What I am trying to do is execute an alias command that calls a script which in turn will do a variety of things:
1. execute a flee from battle
2. check to see if the victim is in the target list
3. check to see if the items to be stolen list has been populated
4. If yes to both, attempt to steal.
5. Continue trying to steal up to 5 times unless successful. If successful, stop trying to steal.
I am successful in doing all of this so far, except the last item. Right now, I have the steal command set up in a LOOP UNTIL routine, like so:
v_trigok = world.gettriggerinfo ("successfulsteal", 21) -- this gets the successful steal trigger matched option value before the loop
DO
world.sendimmediate v_string -- "this string is the steal item from victim string"
v_count = v_count + 1
v_trig1 = world.gettriggerinfo ("successfulsteal", 21) -- This gets the successful trigger matched option value during the loop
IF v_trig1 > v_trigok THEN
v_stop = 1
ELSE v_stop = 0
END IF
LOOP UNTIL v_count = 7 OR v_stop = 1 -- this is the evaluation phrase to end the loop.
This doesn't work, of course, because the client parses and sends all of the steal commands before the trigger ever gets matched. So, even if the trigger gets matched, the loop has already completed its interations and stop at 7.
Hopefully this is enough information. I really am stumped with this.
Thanks,
Pez
Any help would be appreciated.
Here is a general description of the problem.
I have a targeting system, similar to a pk targeting system. I have a victim, and a list of items to steal from the person put in an array via a variety of aliases.
What I am trying to do is execute an alias command that calls a script which in turn will do a variety of things:
1. execute a flee from battle
2. check to see if the victim is in the target list
3. check to see if the items to be stolen list has been populated
4. If yes to both, attempt to steal.
5. Continue trying to steal up to 5 times unless successful. If successful, stop trying to steal.
I am successful in doing all of this so far, except the last item. Right now, I have the steal command set up in a LOOP UNTIL routine, like so:
v_trigok = world.gettriggerinfo ("successfulsteal", 21) -- this gets the successful steal trigger matched option value before the loop
DO
world.sendimmediate v_string -- "this string is the steal item from victim string"
v_count = v_count + 1
v_trig1 = world.gettriggerinfo ("successfulsteal", 21) -- This gets the successful trigger matched option value during the loop
IF v_trig1 > v_trigok THEN
v_stop = 1
ELSE v_stop = 0
END IF
LOOP UNTIL v_count = 7 OR v_stop = 1 -- this is the evaluation phrase to end the loop.
This doesn't work, of course, because the client parses and sends all of the steal commands before the trigger ever gets matched. So, even if the trigger gets matched, the loop has already completed its interations and stop at 7.
Hopefully this is enough information. I really am stumped with this.
Thanks,
Pez