This is my first attempt at macroing =)
My ideas actually came from a few scripts.. the doability sub was inspried by some of Catt's code, I took it and modified it with some of my own logic from my experience in coding.. I found that it would do the dragon punch and eagle strike only once, then it would only do the flying kick.. modified it by putting it into a for loop instead, makes it level up each skill more evenly.. =)
Basically what this code will do is when you attack a mob, it will automatically Disarm, Dragon Punch/tail rake (you will need to edit that part to suit your monk.. may change that in the future release), it will check your health each round, and if you're below 50% it will use mend if it's available.. if you drop to 25% health while in battle it will automatically FD for you, if FD fails, then it will continue to attempt until it hits, or you die.. of course :)
Questions, comments, criticizm all welcome.
Thanks 8)
Code: Select all
|---------------------------------------------------------
|
| MonkeyFight.mac v1.0
|
|---------------------------------------------------------
#turbo
|---------------------------------------------------------
| Events
|---------------------------------------------------------
#event FDF " has fallen to the ground"
#event MendFail "You have failed to mend your wounds."
#event MendSucces "You mend your wounds to heal some dammage."
#event Scowls " scowls at you, ready to attack."
#event Glares " glares at you threateningly"
#event AttackOff "Auto attack is off."
#event AttackOn "Auto attack is on."
#event Slain "You have slain "
#event Exp "You gain experience!!"
|---------------------------------------------------------
| Main process and declarations
|---------------------------------------------------------
sub main
/declare minHealth global
/declare maxHealth global
/declare skill global
/declare FdFail global
/declare Scowl global
/declare Glare global
/declare Atk global
/declare AtkButton global
/varset minHealth 25
/varset maxHealth 50
/varset FdFail 0
/varset Atk FALSE
/varset AtkButton q
| Define Atkbutton to whatever you press to auto attack..
| for me it's the default of q
|---------------------------------------------------------
| Start main loop
|---------------------------------------------------------
:start
/doevents AttackOn
/doevents AttackOff
/doevents Slain
/doevents Exp
/if n $char(hp,pct)<=@maxHealth {
/if n $char(ability,"Mend")>0 /doability "Mend"
}
/if @Atk==TRUE {
/if n $char(hp,pct)<=@minHealth {
/if $char(state)=="FEIGN" /goto :start
/call Feign
/goto :start
}
/for skill 1 to 3
/call DoAbility "@skill"
/call DoDisarm
/next skill
|/goto :endloop
} else {
/delay 5s
/goto :start
}
/goto :start
:endloop
/end
|---------------------------------------------------------
| End main loop
|---------------------------------------------------------
|---------------------------------------------------------
| Sub Routines
|---------------------------------------------------------
sub DoAbility(skill)
/if n @skill==1 {
:Eagle
/delay 1s
/if n $char(ability,"Eagle Strike")<0 /goto :Eagle
/if n $char(ability,"Eagle Strike")>0 {
/doability "Eagle Strike"
/return
}
}
/if n @skill==2 {
:Dragon
/delay 1s
/if n $char(ability,"Tail Rake")<0 /goto :Dragon
/if n $char(ability,"Tail Rake")>0 {
/doability "Tail Rake"
/return
}
}
/if n @skill==3 {
:Flying
/delay 1s
/if n $char(ability,"Flying Kick")<0 /goto :Flying
/if n $char(ability,"Flying Kick")>0 {
/doability "Flying Kick"
/varset skill 0
/return
}
}
/return
Sub DoDisarm
/if n $char(ability,"Disarm")>0 {
/if n $target(distance)<=10 /doability "Disarm"
}
/return
Sub Feign
/press @AtkButton
/delay 1s
/doevents AttackOff
:Floop
/if n $char(ability,"Feign Death")>0 /doability "Feign Death"
/delay 1s
/doevents FDF
/if n @FdFail==1 {
/varset FdFail 0
/stand
/goto :Floop
}
/press c
/delay 1s
/doevents Scowls
/if n @Scowl==1 {
/varset Scowl 0
/stand
/goto :Floop
}
/doevents Glares
/if n @Glare==1 {
/varset Glare 0
/stand
/goto :Floop
}
:endFloop
/return
|---------------------------------------------------------
| Sub Events
|---------------------------------------------------------
Sub Event_FDF
/varset FdFail 1
/return
Sub Event_Scowls
/varset Scowl 1
/return
Sub Event_Glares
/vareset Glare 1
/return
Sub Event_AttackOn
/varset Atk TRUE
/return
Sub Event_AttackOff
/varset Atk FALSE
/return
Sub Event_Exp
/varset Atk FALSE
/return
Sub Event_Slain
/varset Atk FALSE
/return


