Monk macro that doesnt work anymore

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

hardarac
a lesser mummy
a lesser mummy
Posts: 37
Joined: Sat Nov 30, 2002 2:25 pm

Monk macro that doesnt work anymore

Post by hardarac » Wed Sep 22, 2004 3:43 pm

Okies so this macro used to work ... not more than 3 weeks ago ...... or at least if I have copied the correct file it did :wink:

Could someone PLEASE tell me if there is a fault with it now ... cos I cant get it to work. The forage bit works ... but the fighting bit fails all the time .... :(

TIA ... I hope


|/mac monk
|
|/echo Set Tank (Sets tank (assist) to your target)
|/echo Drop Anchor (Drops anchor (where you return after every fight))
#Event move "Your target is too far away, get closer!"
#Event anchor "#*#Drop Anchor"
#Event back "You cannot see your target."
#Event exp "You gain party experience!!"
#Event exp "You gain raid experience!"
#Event tank "#*#Set Tank"

Sub Main
/declare AnchorY int outer
/declare AnchorX int outer
/declare tank string outer
/varset tank none
/varset AnchorY 0
/varset AnchorX 0
:Loop
/call CheckHealth
/if (!$tank.Equal[none]}) {
|/if (!${String[$tank}].Equal[none]}) {
/assist ${tank}
| /if (${Target.PctHPs}<=96 && ${String[${Target.Type}].Equal[NPC]}) {
/if (${Target.PctHPs}<=96 && $Target.Type.Equal[NPC]}) {
/attack on
}
}
/doevents
/if (${Me.Combat}) {
/if (${Me.AbilityReady[Flying Kick]}) /doability "Flying Kick"
/if (!${Me.Buff[Celestial Tranquility].ID} && !${Me.Buff[Speed of Vallon].ID} && !${Me.Buff[Vallon's Quickening].ID}) /cast item "Gloves of Enlightenment"
/call GetBehind
}
/if (!${Me.Combat}) {
/if (${Me.AbilityReady[Forage]}) {
/doability "Forage"
/delay 1s
/autoinventory
}
}
/goto :Loop
/endmacro

Sub Event_move
/keypress forward hold
:Checker
/face fast nolook
/if (${Target.Distance}<=15) {
/face fast nolook
/keypress forward
/return
}
/goto :Checker
/return

Sub Event_anchor
/varset AnchorX ${Me.X}
/varset AnchorY ${Me.Y}
/echo Anchor dropped at ${AnchorX} , ${AnchorY}
/return

Sub Event_back
/face fast nolook
/return

Sub Event_exp
/delay 1s
/attack off
/newif (${AnchorX}==0 || ${AnchorY}==0) {
/echo No anchor is set.
/return
}
:AnchorMoveLoop

/if (${Me.State.NotEqual[STAND]}) /stand
/face nolook loc ${AnchorY},${AnchorX}
/if (${Math.Distance[${AnchorY},${AnchorX}]}>5) /keypress forward hold
/if (${Math.Distance[${AnchorY},${AnchorX}]}<=5) {
/keypress forward
/if (${Me.State.NotEqual[STAND]}) /stand
/face away nolook loc ${AnchorY},${AnchorX}
/return
}
/goto :AnchorMoveLoop
/return

Sub Event_tank
/echo Setting tank...
/varset tank ${Target}
/echo Tank set to ${tank}
/return

Sub GetBehind
/if (${Target.ID}==0) {
/keypress forward
/goto :nomob
}
/if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.DegreesCCW}]}*10]},${Math.Calc[${Target.X}-${Math.Sin[${Target.Heading.DegreesCCW}]}*10]}]}<4) /goto :noneed
/face nolook fast loc ${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.DegreesCCW}]}*10]},${Math.Calc[${Target.X}-${Math.Sin[${Target.Heading.DegreesCCW}]}*10]}
/keypress Ctrl+R
/keypress forward hold
:gobehindloop
/delay 1
/if (${Target.ID}==0) {
/keypress forward
/goto :nomob
}
/face nolook fast loc ${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.DegreesCCW}]}*10]},${Math.Calc[${Target.X}-${Math.Sin[${Target.Heading.DegreesCCW}]}*10]}
/if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.DegreesCCW}]}*10]},${Math.Calc[${Target.X}-${Math.Sin[${Target.Heading.DegreesCCW}]}*10]}]}>3) /goto :gobehindloop
/keypress Ctrl+R
/keypress forward
:noneed
/face nolook fast
:nomob
/return

Sub CheckHealth
/if (${Me.PctHPs}<=30) {
/echo Feigning
/attack off
/delay 2
/doability "Feign Death"
/delay 1s
:Loopsie
/if (${Me.PctHPs}>=60 || ${String.Equal[STAND]}) {
| /if (${Me.PctHPs}>=60 || ${String[${Me.State}].Equal[STAND]}) {
/return
}
/goto :Loopsie
}
/return

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Wed Sep 22, 2004 3:52 pm

Only looked over the first few lines... but

/if (!$tank.Equal[none]})

should be
/if (!${tank.Equal[none]})

and

/if (${Target.PctHPs}<=96 && $Target.Type.Equal[NPC]})

should be
/if ((${Target.PctHPs}<=96) && (${Target.Type.Equal[NPC]}))

(double parentheses not needed but makes it look better to me)

Seems you have some strange hybrid of Parms and MQ2Data going on... that script as written definately would not have worked three weeks ago... look for things like that though (missing openening brace) and see if it fixes it.

oh, and it's
[ code]

not [ quote]

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Wed Sep 22, 2004 3:53 pm

Code tags help a lil bit more than quotes . . . and what error does it give you? Do you think we are psychic or something?
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

hardarac
a lesser mummy
a lesser mummy
Posts: 37
Joined: Sat Nov 30, 2002 2:25 pm

Post by hardarac » Wed Sep 22, 2004 5:04 pm

Guys You are brilliant

I know trhat you didnt give a defiate answer .. but your comments have made me realise what I did wrong .. and I now realise that the version I posted (and Used) is the wrong one .. and I need to search to find the corerect version ... which is buried somewhere ...



Many Thanks

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Wed Sep 22, 2004 5:21 pm

Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]