Me.AbilityReady stuff.. little help here.. :)

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

Moderator: MacroQuest Developers

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Me.AbilityReady stuff.. little help here.. :)

Post by loadingpleasewait » Mon May 17, 2004 3:16 pm

Hey, got my autoattack/autoarchery macro to work, but theres somthing I want to work better..

Heres the code.

Code: Select all

|arch.mac Auto-Archery
/zapvars
#include spellcast.inc
#turbo 40
#Event exp "#*#experience!#*#" 
#Event Casting "#*#You begin casting#*#" 
#event haste "#*#The quickening spirit departs#*#"
#event eagle "#*#The avian presence departs#*#"


Sub Main
   /echo "Auto-Arch Macro has begun."
   /declare startexp int outer 
   /declare startaaxp int outer 
   /declare currentxp int outer 
   /declare xpgain int outer 
   /declare currentaa int outer 
   /declare aagain int outer 
   /declare targetarray[4] string outer 

   /varset startexp ${Math.Calc[${Me.Exp}/3.33]} 
   /varset startaaxp ${Math.Calc[${Me.AAExp}/3.33]}

/if (${Defined[Param0]} && ${String[${Param0}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   } 

      :mainloop 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
        /doevents 
      /goto :mainloop 
/return 


Sub Archery 
  /attack off 
  /varset targetarray[1] ${Target.CleanName} 
  /varset targetarray[2] ${Target.Level} 
  /varset targetarray[3] ${Target.Name} 
  /varset targetarray[4] ${Target.ID} 
    
   /echo Fighting a ${targetarray[2]} ${targetarray[1]} 
  /face nolook 
  :CloserAF    
/if (${Target.Distance}>30) /ranged 
         /if (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
    /doevents
    /if (${Target.Distance}<18) /call closecombat

    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
    /goto :CloserAF 
    /return
:EndAF
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /keypress Num_5 
/return 


Sub closecombat
   /attack on
   /face nolook
   :stillclose
            /if (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) { 
               /attack off
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
            /attack on
         } 

[color=red]/doability Disarm
/doability Kick[/color] 
      /if (${Target.ID}!=${targetarray[4]}) /goto :endclose
    /doevents 
    /if (!${Target.ID}) /goto :endclose 
    /if (${Target.Distance}<18 && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose
:endclose
    /attack off
   
    /return



Sub Event_exp 
   /varset currentxp ${Math.Calc[${Me.Exp}/3.33]} 
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]} 
   /varset currentaa ${Math.Calc[${Me.AAExp}/3.33]} 
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]}
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${currentxp}% xp - ${currentaa}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${currentxp}% xp - ${currentaa}% aa" 
   /varset startexp ${Math.Calc[${Me.Exp}/3.33]} 
   /varset startaaxp ${Math.Calc[${Me.AAExp}/3.33]}
/return 

Sub event_eagle
      /call Cast "Eagle Eye" gem6
      /delay 5s
/return

Sub event_haste
      /call Cast "Eyepatch of Plunder" item
      /delay 4s
/return   


sub Event_Casting 
   :checkcast 
    /delay 1 
    /if (${Me.Casting.ID}) /goto :checkcast 
/return 
Ok, what I want to work is ...

I want to use

Code: Select all

/if (${Me.RangeAttackReady}) /ranged 
instead of just /ranged... but it doesnt work??

I want to use

Code: Select all

/if (${Me.AbilityReady[Kick]}) /doability Kick
/if (${Me.AbilityReady[Disarm]}) /doability Disarm
instead of just /doability kick or disarm.. but that doesnt work either.. :( whats wrong?

also, in the experience display code, It used to display the decimal experience, now it rounds it.. I want the decimals back.. any idea how?

This is updated code from my old archery macro, with proximity checking added to auto melee when in range of mob, and only do archery when you are far enough away from the mob to use archery.

help please.. = ) 8)
LOADING PLEASE WAIT...

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Mon May 17, 2004 3:34 pm

Code: Select all

  /declare startexp [color=red]int[/color] outer 
   /declare startaaxp [color=red]int[/color] outer 
   /declare currentxp [color=red]int[/color] outer 
   /declare xpgain [color=red]int [/color]outer 
   /declare currentaa [color=red]int [/color]outer 
   /declare aagain [color=red]int [/color]outer 
That be why you don't have any floats after your number. Ints are integers, they don't have floats. Floats have floats :lol:

As far as the abilities you'll have to wait for someone else to post the answer. I don't play with em.

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Mon May 17, 2004 3:49 pm

Just taking a stab into thin air, but from looking around, it seems most use it like this:

Code: Select all

/if (${Me.AbilityReady["Kick"]}) /doability "Kick"
/if (${Me.AbilityReady["Disarm"]}) /doability "Disarm"
...but I'm not really sure if the quotes make a difference in this case.

Marze
a lesser mummy
a lesser mummy
Posts: 60
Joined: Wed Apr 14, 2004 12:08 pm

Post by Marze » Mon May 17, 2004 7:16 pm

The doability stuff you posted should work. Quotes are not needed. It must be something else before that which isn't letting those two lines executue.

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Mon May 17, 2004 7:51 pm

Throw some echos in and around.