Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!
Moderator: MacroQuest Developers
-
Eat_the_meek
- orc pawn

- Posts: 11
- Joined: Sat Feb 07, 2004 9:03 pm
Post
by Eat_the_meek » Wed Mar 24, 2004 11:26 pm
I am getting the follow error message when I run this macro, can anyone help?
Ending macro: Bad variable in /var function.
fight.mac@24 (Main)/varset wepdelayTimer 30
Code: Select all
#turbo
/declare WepdelayTimer timer
/varset WepdelayTimer 0
Sub Main
:Main
/if n @WepdelayTimer<=0 /goto :Engage
/if n $target(distance)<30 /goto Moveaway
/if n $target(distance)>70 /goto Movein
/if n $target(distance)>50 /goto Strafe
/if "$target()"=="TRUE" /goto :Main
/end
/return
:Engage
/face fast
/if n $target(distance)>5 /keypress forward hold
/if n $target(distance)<5 /keypress forward
/if n $target(distance)<20 {
/if n $target(distance)>15 /goto :Engage
/attack on
/attack off
/varset wepdelayTimer 30
}
/if n @WepdelayTimer>0 /goto :Main
/goto :Engage
:Strafe
/face fast
/keypress strafe_right hold
/face fast
/delay 3
/keypress strafe_right
/goto :Main
:Movein
/face fast
/keypress forward hold
/face fast
/delay 3
/keypress forward
/goto :Main
:Moveaway
/face heading ($abs(180-$target(heading))
/keypress forward hold
/face heading ($abs(180-$target(heading))
/delay 3
/keypress forward
/goto :Main
And a big thanks to who ever put the /keypress in, big improvment thanks.
-
Lax
- We're not worthy!

- Posts: 3524
- Joined: Thu Oct 17, 2002 1:01 pm
- Location: ISBoxer
-
Contact:
Post
by Lax » Thu Mar 25, 2004 1:16 am
Thats nice and all but i'll kill you for posting in the wrong place
-
Falco72
- a hill giant

- Posts: 215
- Joined: Fri Sep 26, 2003 3:24 am
Post
by Falco72 » Thu Mar 25, 2004 2:24 am
Change this
Code: Select all
:Engage
/face fast
/if n $target(distance)>5 /keypress forward hold
/if n $target(distance)<5 /keypress forward
/if n $target(distance)<20 {
/if n $target(distance)>15 /goto :Engage
/attack on
/attack off
/varset wepdelayTimer 30
}
/if n @WepdelayTimer>0 /goto :Main
/goto :Engage
so
Code: Select all
:Engage
/face fast
/if n $target(distance)>5 /keypress forward hold
/if n $target(distance)<5 /keypress forward
/if n $target(distance)<20 {
/if n $target(distance)>15 /goto :Engage
/attack on
/attack off
[color=red]/varset WepdelayTimer 30[/color]
}
/if n @WepdelayTimer>0 /goto :Main
/goto :Engage
Commands and variables are case sensitive.
-
wassup
- Official Guardian and Writer of TFM

- Posts: 1487
- Joined: Sat Oct 26, 2002 5:15 pm
Post
by wassup » Thu Mar 25, 2004 2:43 am
Your problem is in the first 4 lines...
What is wrong here...
Code: Select all
#turbo
/declare WepdelayTimer timer
/varset WepdelayTimer 0
Sub Main
:Main
/declare has to be within a Sub, as well as /varset.