|
yskar Newbie
Joined: 25 Aug 2004 Posts: 7
|
Posted: Wed Aug 25, 2004 7:55 pm
While loop with toggled variables |
What Im trying to do here is have a macro that will toggle a set of actions:
When its clicked it sets a variable @aw to 'on' and issues the command 'autoloot on' plus it starts performing an alias called 1mg every 4 seconds. When I toggle the macro off I want to set the @aw to 'off', issue the command 'autoloot off' and stop the loop.
Heres the code i have so far.
#if (@aw = "on") {
autoloot off
mgcount=300
aw = "off"
} {
autoloot on
aw = "on"
mgcount=1
#while (@mgcount < 300) {
1mg
#add @mgcount+1
#wait 4000
}
}
But this ends up sending most of the above to zmud as code. Where am I going wrong?
thanks |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Wed Aug 25, 2004 8:25 pm |
#IF (@aw = "on") {autoloot off;#T- mg_alarm;aw="off"} {autoloot on;#VAR mgcount 1;#ALARM mg_alarm *4 {1mg;#IF (@mgcount = "300") {#T- mg_alarm};#ADD mgcount 1};aw="on"}
|
|
|
|
yskar Newbie
Joined: 25 Aug 2004 Posts: 7
|
Posted: Thu Aug 26, 2004 5:43 am |
Its not quite working.
The first click with the autoloot off starts the loop ok. The second click doesnt disable it and is sent to the mud as
#if (on = on) {
autowake off
} {autowake on;aw = on} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Sep 01, 2004 6:57 pm |
Mr Kent's #IF commands are correct. You probably left out one or more }'s.
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
|
|