 |
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Thu Oct 17, 2002 4:12 pm
Loop stopping |
#ALIAS har {#loop %1 {punch @target;#wait 4000};#wait 4000;get @punched @target} "punching"
#ALIAS h {target = %1;punched = 0} "punching"
#ALIAS hcl {plant=0;harvested=0} "punching"
#VAR punched {40} {_nodef} "punching"
#VAR target {dude} {_nodef} "punching"
#TRIGGER {You punch } {#add punched 1} "punching"
#TRIGGER {You hit } {#add puncheded 1} "punching"
#STAT {Hit @target |||| Hit so far @punched} "punching
here is my little class how do I make it so that I can abort the loop?
also I want the status bar to show how many loops I inputted like HAR 10
should be:
hit dude 40 ||||| hit so far 10 |
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Thu Oct 17, 2002 8:09 pm |
I don’t have zmud on this computer, but I think something like this should help you out.
Use a variable to store the number of loops instead of using the #loop command. Then you can set this variable to -1 to turn off the loop.
#ALIAS har {#var loop_count %1;har_loop} “punching”
#alias har_loop {#add loop_count -1;#if (loop_count > 0) {punch @target;#alarm +4 {har_loop}};#if (loop_count = 0) {get @punched @target;#alarm +4 {har_loop}}} "punching"
#alias abort_har {var loop_count -1} “punching”
#ALIAS h {target = %1;punched = 0} "punching"
#ALIAS hcl {plant=0;harvested=0} "punching"
#VAR punched {40} {_nodef} "punching"
#VAR target {dude} {_nodef} "punching"
#VAR loop_count {0} {0} “punching”
#TRIGGER {You punch } {#add punched 1} "punching"
#TRIGGER {You hit } {#add puncheded 1} "punching"
#STAT {Hit @target |||| Hit so far @punched | Loops so Far @loop_count} "punching
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.34
Zmapper Version 1.10 |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Oct 17, 2002 10:22 pm |
Also, entering #ABORT 1 in the command line end any loops that are currently running.
Kjata |
|
|
 |
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Fri Oct 18, 2002 3:43 am |
hmmm it seemed to have created an infinite loop and i wasnt able to stop it either......
*scratch* I just need it to tell me how many i inputted to be harvested in the status bar =) thanks for the help though if there are any other ideas......i seem to have copied some wrong stuff though so ill repost it to make sure
#ALIAS pun {#loop %1 {punch @target;#wait 4000};#wait 4000;get @punched @target} "punching"
#ALIAS p {target = %1;punched = 0} "punching"
#VAR punched {10} {_nodef} "punching"
#VAR target {dude} {_nodef} "punching"
#TRIGGER {You punch } {#add punched 1} "punching"
#STAT {punching @target |||| punched so far @punched} "punching"
there I think thats cleaner also if I can make it beep when its done that be great |
|
|
 |
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Sat Oct 19, 2002 2:39 am |
still need help here.......and how do I make it so that instead of #wa 4000 I make it wait for a line? like a trigger or something
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Oct 20, 2002 3:18 pm |
How about you re-define the logic of the script:
#ALIAS pun {#VAR punched 0;#VAR punches %1;punch @target}
#TRIGGER {You punch } {#ADD punched 1;#IF (@punched < @punches) {punch @target} {get @punched @target}}
Kjata |
|
|
 |
|
|