Moderator: MacroQuest Developers
Code: Select all
$char(option [,"param")
ability,"ability name" Returns what /doability # you have a skill set to
ability,# Returns the ability name in a specific /doability slot
Can also return:
0: Skill not on an ability button
-1: You do not have that skill
-2: The ability is on a button but unusable right now
Code: Select all
/if n $char(ability,"Flying Kick")>0 /echo this ability is set to doability # $char(ability,"Flying Kick")
/if n $char(ability,"Flying Kick")>-1 /doability "Flying Kick"
/if n $char(ability,"Flying Kick")==0 /echo I have this skill however it is not assigned to a /doability button
/if n $char(ability,"Flying Kick")==-1 /echo You don't have this skill.
/if n $char(ability,"Flying Kick")==-2 /echo This is not ready to be used just yet.
You are and you're notcal_zero wrote:I ended up just setting a timer for it but would be cool to see this working again. Like I said I went thru several current macros and could not fine where the true -2 variable response was used as a check. Everyone seemed to just go with /doability and I guess hope it was there and ready. I also was trying to use this writting a macro for a guild friend that always tends to die to Enrage mobs as a rogue and was looking for the ability check to setup backstab, hide, and escape options with out having to set timers for them. As it is now I am just running a count down timer and if its 0 then the char will try to use the ability. This runs into huge problems when trying to sync it with the char current haste %. The one I am working on I am just setting input values for if the char is at 41% haste up to bard exceed cap haste. And then doing an Evade action if the backstab sub acually goes off. Will post it when I get it finished its really my first macro from scratch so want to work the kinks out before I post it here for everyone to nit pick it.
Thanks for the help btw thought maybe I was going nuts, hell maybe I am.
Code: Select all
/if n $char(ability,hide)>0 /doability hideCode: Select all
/if n $char(ability,"hide")>0 /doability "hide"Code: Select all
/if n $char(ability,"hide")==1 /doability "hide"Code: Select all
|------------------------------------------------
|Cal_zero Backstab.mac
| BackStab/Evade Macro usage /macro backstab.mac <Haste> <EvadeTime>
| 0 = No Haste
| 1 = 41%
| 2 = 70%
| 3 = Max Haste
| 4 = Unlimited BS does not check time sparatic.
| EvadeTime = How long you want to hide after an Evade attempt Default 10 = 1 second
| You must have an NPC targeted, attack on, be in melee range, and behind the mob for BackStab to go off.
| Macro will try to Evade after Backstab if Hide is avalible.
| Macro will also check for ENRAGED while facing you and try to save you.
| Macro will re-engage mob if mob is no longer enraged or if he just turns away from you.
| Manually turning auto attack off will pause the Macro until you turn attack on again.
|
|-------------------------------------------------
#turbo 300
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event AutoattackON "Auto attack is on."
#Event AutoattackOFF "Auto attack is off."
Sub Main
/zapvars
/declare checktarget global
/declare attacktarget global
/declare backstabtimer timer
/declare hidetimer timer
/declare roguehaste global
/declare hasteinput global
/declare mobenrage global
/declare hidedelay global
/declare ragecatch global
/varset checktarget 0
/varset attacktarget 0
/varset backstabtimer 0
/varset hidetimer 0
/varset hasteinput @Param0
/varset mobenrage 0
/varset hidedelay @Param1
/varset ragecatch 0
/call backstabspeed
/echo /Macro Backstab.mac /help for usage and info about this macro.
/echo Backstab Macro running at speed @hasteinput/4
/if n @hasteinput==4 /echo For Evade control when Backstab goes off please set it to your current Haste.
/if n @hidedelay>=10 /echo You will Pause for $left(1,"@hidedelay").$right(1,"@hidedelay") second(s) after every Evade attempt.
/if n @hidedelay<10 /echo You will Pause for 0.@hidedelay tenth's of a second after every Evade attempt.
:meleeloop
/doevents
/if n @attacktarget==0 /goto :meleeloop
/call targetcheck
/if n @checktarget==0 /goto :meleeloop
/if @mobenrage==1 /call mobenrage
/doevents
/call pokeit
/goto :meleeloop
/return
Sub targetcheck
/if $target()==FALSE {
/varset checktarget 0
/attack off
/varset attacktarget 0
/return
}
/if $target(type)==NPC /varset checktarget 1
/return
Sub mobenrage
/if @attacktarget==0 /return
/if n $abs($calc($calc(360-$target(heading))-$calc(360-$char(heading))))<100 /attack on
/if n $abs($calc($calc(360-$target(heading))-$calc(360-$char(heading))))<100 /varset ragecatch 0
/if n $abs($calc($calc(360-$target(heading))-$calc(360-$char(heading))))<=100 /return
/if n $abs($calc($calc(360-$target(heading))-$calc(360-$char(heading))))>100 /attack off
/if n @ragecatch==1 /return
/if n @hidetimer==0 /doability hide
/echo Attack was turned off for your protection!
/varset ragecatch 1
/return
Sub pokeit
/if n @backstabtimer>0 /return
/if $target(distance,predict)>$target(maxrange) /return
/if n $abs($calc($calc(360-$target(heading))-$calc(360-$char(heading))))>80 /return
/if n $abs($calc($calc(360-$target(heading))-$calc(360-$char(heading))))<80 /doability backstab
/varadd backstabtimer @roguehaste
/if n @hidetimer==0 /call evade
/doevents
/return
Sub evade
/attack off
/doability hide
/doevents
/delay @hidedelay
/attack on
/if n @hidetimer==0 /varadd hidetimer 75
/return
Sub backstabspeed
/if @hasteinput==/help /call help
/if @hasteinput>=4 /varset roguehaste 0
/if @hasteinput==3 /varset roguehaste 50
/if @hasteinput==2 /varset roguehaste 60
/if @hasteinput==1 /varset roguehaste 70
/if @hasteinput==0 /varset roguehaste 90
/if @hasteinput==*Param0 /varset roguehaste 90
/if @hidedelay==*Param1 /varset hidedelay 50
/if @roguehaste==90 /varset hasteinput 0
/return
Sub help
/echo Cal_zero BackStab/Evade Macro usage /macro backstab.mac <Haste> <EvadeTime>
/echo 0 = No Haste
/echo 1 = 41%
/echo 2 = 70%
/echo 3 = Max Haste
/echo 4 = Unlimited BS does not check time sparatic.
/echo EvadeTime = How long you want to hide after an Evade attempt Default 10 = 1 second
/echo You must have an NPC targeted, attack on, be in melee range, and behind the mob for BackStab to go off.
/echo Macro will try to Evade after Backstab if Hide is avalible.
/echo Macro will also check for ENRAGED while facing you and try to save you.
/echo Macro will re-engage mob if mob is no longer enraged or if he just turns away from you.
/echo Manually turning auto attack off will pause the Macro until you turn attack on again.
/endmacro
/return
Sub Event_Enraged
/varset mobenrage 1
/return
Sub Event_Offrage
/varset mobenrage 0
/if @attacktarget==1 /attack on
/return
Sub Event_AutoattackON
/varset attacktarget 1
/return
Sub Event_AutoattackOFF
/varset attacktarget 0
/return
Heh, not to beat a dead horse but I've coded, and re-coded a rogue script for my own toon. The check I posted and you quoted *works*. As for your second snippet (==1), well yeah, which is why I stated earlier use either >0 or =>1 :). For giggles I checked it under the 3/31 zip code and it still functions as intended, -2 if used/notavailable, 0 if not setup, 1-6 if on a hotkey. Hence >0 or >=1 working regardless of what ability button the toon's UI has Hide on.cal_zero wrote:As far as using
your still going to get incorrect information with the way the current output is. The only thing this code is checking is if you have hte skill on an combat ability key. So at a key time when I need the evade its may not be avalible.Code: Select all
/if n $char(ability,"hide")>0 /doability "hide"
I know I am nit picking at something that really doesnt matter but if I am going to write it might as well do it to the best of my ability. But if you look at it this way
if you had hide assisgned to combatability key 2 you would get a NULL from this expression.Code: Select all
/if n $char(ability,"hide")==1 /doability "hide"
Code: Select all
Sub evade
/attack off
/doability hide
/attack on
/return
Code: Select all
/if n @mobenrage==1 /call mobenrage