stick.mac (06.14.04b)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Re: re: fix...

Post by aChallenged1 » Tue Jul 06, 2004 6:36 am

bushdaka wrote:In the melee attack area, the 3rd melee auto attack check is wrong. Both the 2nd and 3rd one trigger on the status of the 2nd one. I'm not sure how to paste the fix but the 3rd melee check for status needs check the 3rd melee status, not the 2nd one. Line 250. <g> Clear as mud.
You mean this?
/if (!${MeleeAttack_1.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_1}]}) /doability ${MeleeAttack_1}
/if (!${MeleeAttack_2.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_2}]}) /doability ${MeleeAttack_2}
/if (!${MeleeAttack_3.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_
2}]}) /doability ${MeleeAttack_3}
Which should really be...
/if (!${MeleeAttack_1.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_1}]}) /doability ${MeleeAttack_1}
/if (!${MeleeAttack_2.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_2}]}) /doability ${MeleeAttack_2}
/if (!${MeleeAttack_3.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_
3}]}) /doability ${MeleeAttack_3}
?

(Couldn't get color to show up different in "code" do used quotes.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Tue Jul 06, 2004 9:37 am

The monk epic code is this part:

Code: Select all

   /if (${Me.Class.Name.Equal[Monk]}) { 
      /if (!${Me.Buff[Celestial Tranquility].ID} && !${Me.Buff[Speed of Vallon].ID} && !${Me.Buff[Vallon's Quickening].ID}) /cast item "Celestial Fists" 
   }
And it looks like it should work

If you want tho, heres some code from another of my macros you could substitute:

Code: Select all

/if (${HasteGloves.Equal[${Me.Inventory[hands]}]} && !${Me.Buff["Celestial Tranquility"].Duration}) /cast item "${HasteGloves}"
just make sure you declare and set HasteGloves to Celestial Fists (or Gauntlets of Enlightenment, for the lazy) somewhere up above.

LamahHerder
a hill giant
a hill giant
Posts: 299
Joined: Sat Jun 29, 2002 2:37 am

Post by LamahHerder » Wed Jul 07, 2004 5:55 pm

A Troll wrote:Can someone explain me how to use my Silver Hoop of Speed ?
i put it in the pc-ini leftear but didnt work :-(
Buff code is not in this version

My move is done (woot back to living on the west coast!)
but not much desire for eq atm but may start playing again
if i do will update some more

Just stopping by to see what has been done with MQ in the last month or so

the_horror
a lesser mummy
a lesser mummy
Posts: 36
Joined: Mon May 31, 2004 2:42 pm

Post by the_horror » Sat Jul 10, 2004 10:09 pm

unparsable calculation 'g'
stick.mac (196) /if (${Target.Distance}>150) /attack off
stick.mac (184) /if (${Me.Combat}) /call Attack
failed to parse /if condition (71.85&gt) non numeric

been getting this error message any help would be great

Banannaboy
a lesser mummy
a lesser mummy
Posts: 43
Joined: Tue Apr 13, 2004 9:59 pm

Post by Banannaboy » Sun Jul 11, 2004 12:12 am

the_horror. You should try searching for the error you are getting. You need to change all the

Code: Select all

>
to

Code: Select all

>
and all the

Code: Select all

<
to

Code: Select all

<

the_horror
a lesser mummy
a lesser mummy
Posts: 36
Joined: Mon May 31, 2004 2:42 pm

thanks

Post by the_horror » Sun Jul 11, 2004 2:57 am

thanks should have read back post sorry that was a stupid question

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Wed Jul 21, 2004 7:05 am

EDIT: Found the problem. I was using Mcdebug's version, not M0nk's.
Trying to run this macro and keep getting error:
/for loop using invalid variable

stick.mac@66(main):/for i=1 to 20

stick.mac ended
Could someone give me a clue? I've read through all the posts and can't find anything simular.

I don't have an ini, not sure how it would look so can't create one manually.

I start this: /macro stick 0 kick
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

User avatar
surveyor
decaying skeleton
decaying skeleton
Posts: 8
Joined: Fri Jul 30, 2004 4:04 pm
Location: South Florida, Jamaica, Hong Kong

No error but macro ends

Post by surveyor » Tue Aug 03, 2004 1:07 pm

Trying to use this macro. When I load it I get this:

"Subroutine Main not found"
"Macro ended"

Any clue what I'm doing wrong?

EDIT: NM. Runs fine and I'm a freak.
Beer is proof that the good lord loves us - Ben Franklin
True power does not lie in the voters but rather those that count the votes - Joseph Stalin
None are more hopelessly enslaved than those who falsely beleive they are free - Johann Wolfgang von Goethe
Im not happy here so I left and will return when it suits me. I prefer wine, women and song. Stress, grief and pressure are not on my wish list - Me

mackster
a ghoul
a ghoul
Posts: 95
Joined: Mon Sep 09, 2002 3:02 pm

Post by mackster » Sun Aug 08, 2004 5:46 pm

I added in a special event to /beep and /echo in order to give me a better cue for when a mob is trying to gate. Sometimes I don't see the message, so an audio cue is helpful.

Here is the code:

Up at the top:

Code: Select all

#event GateWatch "#*#begins to cast the gate spell.#*#" 
Under :attackMeleeLoop

Code: Select all

/doevents GateWatch 
And finally the event itself, which can be added to the end of the macro:

Code: Select all

Sub event_GateWatch
  /echo STUN THIS BEFORE IT GATES!
  /beep
/return

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Sun Aug 08, 2004 10:56 pm

Code: Select all

 /popup STUN THIS BEFORE IT GATES!
vs

Code: Select all

/echo STUN THIS BEFORE IT GATES!
might be even better since it should get IN your face. Just a thought.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

Grimvall
decaying skeleton
decaying skeleton
Posts: 4
Joined: Sun Aug 15, 2004 8:06 pm

Post by Grimvall » Sat Aug 21, 2004 3:36 pm

I made some changes to the original code. I'm not using the ini file to set the MeleeDistance. I simply set MeleeDistance to Target.MaxRangeTo at the beginning of fight. As you know Target.MaxRangeTo doesn't return the right maxrange on all mobs. To avoid this problem I added a hitcheck in the :attackloop. Basically it works like this: when you select a target to attack and hit Melee attack, the MeleeDistance is set to Target.MaxRangeTo. If the hitflag is set (aka you are hitting or trying to hit a mob from maxdistance) then MeleeDistance will stay at it's initial value, otherwise it will decrease MeleeDistance by 2 until the hit flag is set.

Code: Select all

|===========| 
| 06.14.04b | 
|___________| 
|           | 
| stick.mac | 
| by m0nk   | 
|___________| 
| 
| Startup: 
|  /mac stick "OpenCorpse (0 or 1)" "MeleeAbility_1" "MeleeAbility_2" "MeleeAbility_3" 
|  /mac stick (will use stick-pc.ini settings) 
|  /mac stick 0 "bash" (will not loot and only bash) 
|  /mac stick 1 "Flying Kick" "Disarm" "mend" (will Open Corpse, Flying Kick ,disarm, mend, when avail) 
| 
| Toggles: 
|  /echo tt (Will Toggle Tanking) - Not Implemented 
|  /echo toc (Will Toggle Opening Corpses) 
|  /echo tal (Will Toggle Auto Looting) - Not Implemented 
| 
| 
#turbo 
#event Miss "#*#You try to#*#but miss#*#"
#event Hit "#*#You#*#for#*#points of damage#*#"
#event slain "#*#has been slain by#*#" 
#event RageON "#*#has become ENRAGED.#*#" 
#event RageOFF "#*#is no longer enraged#*#" 
#event MobGate "#*# Gates.#*#" 
#event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#" 
#event StunON "#*#You are stunned#*#" 
#event StunON "#*#You lose control of yourself!#*#" 
#event StunOFF "#*#You are unstunned#*#" 
#event StunOFF "#*#You have control of yourself again.#*#" 
|#event TankThisRound "#*#to ignore others and attack you!#*#" 
|#event ToggleTank "#*#[MQ2] tt#*#" 
#event ToggleOpenCorpse "#*#[MQ2] toc#*#" 

Sub main 
  :setDeclares 
    /declare PCini outer 
    /declare NPCini outer 
    /declare MA_SB outer 
    /declare MobID outer 
    /declare CharX outer 
    /declare CharY outer 
    /declare MOBini outer 
    /declare AutoLoot outer 
    /declare OpenCorpse outer 
    /declare TankToggle outer 
    /declare MeleeAttack_1 outer 
    /declare MeleeAttack_2 outer 
    /declare MeleeAttack_3 outer 
    /declare MeleeDistance outer 
    /declare DefaultMeleeDistance outer 
    /declare HitFlag outer

  :setGenericVars 
    /varset MA_SB NULL 
    /varset TankToggle NULL 
    /varset PCini stick-pc.ini 
    /varset NPCini stick-npc.ini 
  
  :NewCharacterCheck 
    /varset OpenCorpse ${Ini[${PCini},${Me.Name},OpenCorpse]} 
    /if (${OpenCorpse.Equal[NULL]}) /goto :NewCharacter 

  :setParams 
    /if (${Defined[Param0]}) { 
      /varset OpenCorpse ${Param0} 
        } else { 
          /varset OpenCorpse ${Ini[${PCini},${Me.Name},OpenCorpse]} 
          } 
        } 
    /if (${Defined[Param1]}) { 
      /varset MeleeAttack_1 ${Param1} 
        } else { 
          /varset MeleeAttack_1 ${Ini[${PCini},${Me.Name},MeleeAttack_1]} 
          } 
        } 
    /if (${Defined[Param2]}) { 
      /varset MeleeAttack_2 ${Param2} 
        } else { 
          /varset MeleeAttack_2 ${Ini[${PCini},${Me.Name},MeleeAttack_2]} 
          } 
        } 
    /if (!${Defined[Param3]}) { 
      /varset MeleeAttack_3 ${Param3} 
        } else { 
          /varset MeleeAttack_3 ${Ini[${PCini},${Me.Name},MeleeAttack_3]} 
          } 
        } 

  :setINIvalues 
    /if (${OpenCorpse.Equal[NULL]}) /varset OpenCorpse ${Ini[${PCini},${Me.Name},OpenCorpse]} 
    /if (${MeleeAttack_1.Equal[NULL]}) /varset MeleeAttack_1 ${Ini[${PCini},${Me.Name},MeleeAttack_1]} 
    /if (${MeleeAttack_2.Equal[NULL]}) /varset MeleeAttack_2 ${Ini[${PCini},${Me.Name},MeleeAttack_2]} 
    /if (${MeleeAttack_3.Equal[NULL]}) /varset MeleeAttack_3 ${Ini[${PCini},${Me.Name},MeleeAttack_3]} 
    /varset DefaultMeleeDistance ${Ini[${PCini},${Me.Name},DefaultMeleeDistance]} 

  :StickBegin 
    /if (!${MeleeAttack_1.Equal[NONE]}) /echo Auto ${MeleeAttack_1} when available. 
    /if (!${MeleeAttack_2.Equal[NONE]}) /echo Auto ${MeleeAttack_2} when available. 
    /if (!${MeleeAttack_3.Equal[NONE]}) /echo Auto ${MeleeAttack_3} when available. 
    /if (!${OpenCorpse.Equal[0]}) /echo Auto Open Corpse 
  /goto :mainloop 
  
  :NewCharacter 
    /ini "${PCini}" ${Me.Name} AutoLoot 0 
    /ini "${PCini}" ${Me.Name} OpenCorpse 0 
    /ini "${PCini}" ${Me.Name} DefaultMeleeDistance 13 
      
    /ini "${PCini}" ${Me.Name} MeleeAttack_1 NONE 
    /ini "${PCini}" ${Me.Name} MeleeAttack_2 NONE 
    /ini "${PCini}" ${Me.Name} MeleeAttack_3 NONE 

    /ini "${PCini}" ${Me.Name} ClickItem_1 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_1 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_1 NONE 
    /ini "${PCini}" ${Me.Name} ClickItem_2 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_2 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_2 NONE 
    /ini "${PCini}" ${Me.Name} ClickItem_3 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_3 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_3 NONE 
    /ini "${PCini}" ${Me.Name} ClickItem_4 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_4 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_4 NONE 
    /ini "${PCini}" ${Me.Name} ClickItem_5 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_5 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_5 NONE 
    /ini "${PCini}" ${Me.Name} ClickItem_6 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_6 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_6 NONE 
    /ini "${PCini}" ${Me.Name} ClickItem_7 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_7 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_7 NONE 
    /ini "${PCini}" ${Me.Name} ClickItem_8 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSlot_8 NONE 
    /ini "${PCini}" ${Me.Name} ClickItemSpell_8 NONE 
    
    /ini "${PCini}" ${Me.Name} RestSpellName_1 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_1 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellName_2 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_2 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellName_3 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_3 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellName_4 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_4 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellName_5 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_5 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellName_6 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_6 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellName_7 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_7 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellName_8 NONE 
    /ini "${PCini}" ${Me.Name} RestSpellBuff_8 NONE 
    
    /ini "${PCini}" ${Me.Name} InstantClickItem_1 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_1 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_1 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItem_2 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_2 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_2 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItem_3 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_3 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_3 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItem_4 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_4 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_4 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItem_5 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_5 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_5 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItem_6 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_6 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_6 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItem_7 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_7 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_7 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItem_8 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSlot_8 NONE 
    /ini "${PCini}" ${Me.Name} InstantClickItemSpell_8 NONE 

  /echo ${Me.Name} has been added to ${PCini}. Please re-run macro (also go edit ${PCini}) 
/endmacro 
  
  :mainloop 
    /if (${Me.Combat}) /call Attack 
    /doevents 
  /goto :mainloop 
/endmacro 

Sub attack 
  :attackCheck 
    /if (!${Target.Type.Equal["NPC"]}) { 
      /attack off 
      /return 
      } 

    /if (${Target.Distance}>300) /attack off 

  :attackSetup 
    /varset MobID ${Target.ID} 
    /varset HitFlag 0
  :attackPreFight 
    /call ClearReturn 
    /if (${Me.Pet.ID}) /pet attack 
    /varset MeleeDistance ${Target.MaxRangeTo}
    
    |**--Old code, setting MeleeDistance via ini-file--
    /varset MeleeDistance ${Ini[${NPCini},${Zone.ShortName},${Target.CleanName}.DistanceMelee]} 
    /if (${MeleeDistance.Equal[NULL]}) { 
      /ini "${NPCini}" "${Zone.ShortName}" "${Target.CleanName}.DistanceMelee" "${DefaultMeleeDistance}" 
      /varset MeleeDistance ${Ini[${NPCini},${Zone.ShortName},${Target.CleanName}.DistanceMelee]} 
      } 
    **|

  :attackMeleeLoop 
    
    /doevents slain 
    /doevents RageOn 
    /doevents MobGate 
    /doevents StunON 
    /doevents ToggleTank 
    /doevents TankThisRound
    /if (${HitFlag}==0) /goto :hitCheck
    :continue 
    /if (${Target.ID}!=${MobID}) /goto :attackend 
    /if (${Macro.Return.Equal["EndATK"]}) /goto :attackend 
    /if (!${Me.Combat}) /goto :attackend
    /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID} && ${Me.FeetWet})  /face fast 
    /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID} && !${Me.FeetWet}) /face fast nolook  
    /if (${Target.ID}==${MobID} && !${Me.Casting.ID}) /if (${Target.Distance}>${MeleeDistance}) /keypress FORWARD HOLD 
    /if (${Target.ID}==${MobID} && !${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /keypress FORWARD 
    /if (${Target.ID}==${MobID} && !${Me.Casting.ID}) /if (${Target.Distance}<=${Math.Calc[${MeleeDistance}-5]}) /keypress BACK HOLD 
    /if (!${MeleeAttack_1.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_1}]}) /doability ${MeleeAttack_1} 
    /if (!${MeleeAttack_2.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_2}]}) /doability ${MeleeAttack_2} 
    /if (!${MeleeAttack_3.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_2}]}) /doability ${MeleeAttack_3} 
    /if (${TankToggle.NotEqual[NULL]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[Tank]}) /doability "Tank" 
    |** --monk epic (optional)--, if epic buff not active and epic is equipped
     then rightclick hotbutton3 (which should contain epic)--   
    /if (!${Me.Buff[Celestial Tranquility].Name.Equal[Celestial Tranquility]} && ${Me.Inventory[12].Name.Equal[celestial fists]}) {
    	/notify hotbuttonwnd HB_Button3 rightmouseup
    	/delay 5
        } else { 	
    }
    **|  
  /if (${Me.Class.Name.Equal[Shadow Knight]}) /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /goto :attackSpellsSK 
  /if (${HitFlag}==0 && ${Target.Distance}<=${MeleeDistance}) {
      /varcalc MeleeDistance ${MeleeDistance}-2
      /delay 5
      } else {
  }
  /goto :attackMeleeLoop 

  :attackSpellsSK 
    /if (${Me.Gem[Zevfeer's Bite]}>0) /if (${Me.PctMana}>20) /if (${Target.PctHPs}<90) /call cast "Zevfeer's Bite" 
    /if (${Me.Gem[Aura of Hate]}>0) /if (${Me.PctMana}>20) /if (${Target.PctHPs}<90) /call cast "Aura of Hate" 
    /if (${Me.Gem[Spear of Decay]}>0) /if (${Me.PctMana}>50) /if (${Target.PctHPs}<90) /call cast "Spear of Decay" 
    /if (${Me.Gem[Spear of Plague]}>0) /if (${Me.PctMana}>50) /if (${Target.PctHPs}<90) /call cast "Spear of Plague" 
    /if (${Me.PctHPs}<90) /if (!${Me.Buff[Bond of Death Recourse]}) /if (${Me.Gem[Bond of Death]}>0)  /if (${Me.PctMana}>20) /if (${Target.PctHPs}<90) /call cast "Bond of Death" 
  /goto :attackMeleeLoop 

  :hitCheck
    /doevents Hit
    /doevents Miss
    /goto :continue
  :attackend 
   

/if (${OpenCorpse}==1) { 
    /doevents slain

      } 
    /varset MobID 0 
    /if (${TankToggle.NotEqual[NULL]}) /varset TankToggle NULL 
    /attack off 
    /pet backoff 
    /pet hold 
    /keypress FORWARD 
/return 

Sub ClearReturn 
/return NULL 



Sub event_slain 
  /if (${Target.CurrentHPs}>0) /return 

  /if (${OpenCorpse}==0) /return EndATK 
  |/if (${Target.Type.NotEqual[Corpse]}) 
  /target id ${MobID} 
  /loot 
  /keypress FORWARD HOLD
  /loot 
  /loot 
  /loot 
/return EndATK 

Sub event_Hit
  /varset HitFlag 1
/return

Sub event_Miss
  /varset HitFlag 1
/return

Sub event_RageOn 
  /if (${Target.CurrentHPs}>15) /return 
  /if (${Target.CurrentHPs}==0) /return 
  /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID}) /keypress FORWARD 
  /call ClearReturn 
  /echo Rage On 
  /attack off 
  /pet back off 
  /pet hold 
  /call ClearReturn 

  :waitRage 
    /doevents 
    /if (${Target.ID}!=${MobID}) /return EndATK 
    /if (${Macro.Return.Equal["EndATK"]}) /return EndATK 
    /if (${Macro.Return.Equal["RageOFF"]}) /return 
/goto :waitRage 

Sub event_RageOFF 
  /echo Rage OFF 
  /attack on 
/return RageOFF 


Sub event_MobGate 
  /if (${Target.Distance}<100) /return 
  /echo MOB GATED! 
  /attack off 
/return EndATK 

Sub event_Invited 
  /invite 
/return 

Sub event_StunON 
  /doevents flush StunOFF 
  /call ClearReturn 

  :LoopStunOFF 
    /doevents StunOFF 
    /if (${Macro.Return.Equal["StunOFF"]}) { 
    /call ClearReturn 
    /return 
      } 
/goto :LoopStunOFF 

Sub event_StunOFF 
/return StunOFF 

Sub event_TankThisRound 
  /if (${TankToggle.NotEqual[Yes]}) /if (${MeleeAttack_1.NotEqual[Tank]}) /if (${MeleeAttack_2.NotEqual[Tank]}) /if (${MeleeAttack_3.NotEqual[Tank]) { 
  /echo Tanking this round against %t 
  /varset TankToggle Yes 
    } 
/return 

Sub event_ToggleTank 
  /if (${MeleeAttack_1.Equal[Tank]}) { 
    /varset MeleeAttack_1 NULL 
    /echo Will no longer Tank. 
    /return 
    } 
  /if (${MeleeAttack_2.Equal[Tank]}) { 
    /varset MeleeAttack_2 NULL 
    /echo Will no longer Tank. 
    /return 
    } 
  /if (${MeleeAttack_3.Equal[Tank]}) { 
    /varset MeleeAttack_3 NULL 
    /echo Will no longer Tank. 
    /return 
    } 
  /if (${MeleeAttack_1.Equal[NULL]}) { 
    /varset MeleeAttack_1 Tank 
    /echo Auto ${MeleeAttack_1} when availiable. 
    /return 
    } 
  /if (${MeleeAttack_2.Equal[NULL]}) { 
    /varset MeleeAttack_2 Tank 
    /echo Auto ${MeleeAttack_2} when availiable. 
    /return 
    } 
  /if (${MeleeAttack_3.Equal[NULL]}) { 
    /varset MeleeAttack_3 Tank 
    /echo Auto ${MeleeAttack_3} when availiable. 
    /return 
    } 
/return 

Sub event_ToggleOpenCorpse 
  /if (${OpenCorpse}==0) { 
    /varset OpenCorpse 1 
    /echo OpenCorpse On 
    /return 
    } 
  /if (${OpenCorpse}==1) { 
  /varset OpenCorpse 0 
    /echo OpenCorpse Off 
    } 
/return 

cbiebers
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Apr 30, 2004 5:49 pm

Post by cbiebers » Sun Aug 22, 2004 2:54 am

Here's the version of stick that i've been using... saw Grimvall's changes for MaxRangeTo and figured that I should use them as well.

Basically i've stripped out the autoloot/ tt / toc functionality, the instant click / clickie item stuff and the rest of the unused "features"as well as the SK spell cast and the monk epic cast since i play neither.

I dropped in exptrack.inc functionallity so that I can see how im doing.

I also took the code from Wait4Rez (in this forum) and while i liked the idea of accepting rezzes i don't want to accept TL's or Sacrifice windows so I added a manual /echo LootMe event that will target your own corpse and loot it.

Code: Select all

| Startup: 
|  /mac stick (will use stick-pc.ini settings) 
|  /mac stick disarm kick taunt  (will set your 3 melee actions.)
|
| To loot your own corpe:
|  /echo LootMe
|

#turbo 
#event Miss "#*#You try to#*#but miss#*#" 
#event Hit "#*#You#*#for#*#points of damage#*#" 
#event RageON "#*#has become ENRAGED.#*#" 
#event RageOFF "#*#is no longer enraged#*#" 
#event MobGate "#*# Gates.#*#" 
#event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#" 
#event StunON "#*#You are stunned#*#" 
#event StunON "#*#You lose control of yourself!#*#" 
#event StunOFF "#*#You are unstunned#*#" 
#event StunOFF "#*#You have control of yourself again.#*#" 
#event LootMyCorpse "#*#LootMe#*#"

#include expreport.inc

Sub main 
  :setDeclares 
    /declare PCini outer 
    /declare NPCini outer 
    /declare MA_SB outer 
    /declare MobID outer 
    /declare CharX outer 
    /declare CharY outer 
    /declare MOBini outer 
    /declare MeleeAttack_1 outer 
    /declare MeleeAttack_2 outer 
    /declare MeleeAttack_3 outer 
    /declare MeleeDistance outer 
    /declare DefaultMeleeDistance outer 
    /declare HitFlag outer 

  :setGenericVars 
    /varset MA_SB NULL 
    /varset TankToggle NULL 
    /varset PCini stick-pc.ini 
    /varset NPCini stick-npc.ini 
  
  :NewCharacterCheck 
    /varset DefaultMeleeDistance ${Ini[${PCini},${Me.Name},DefaultMeleeDistance]} 
    /if (${DefaultMeleeDistance.Equal[NULL]}) /goto :NewCharacter 

  :setParams 
    /if (${Defined[Param0]}) { 
      /varset MeleeAttack_1 ${Param0} 
        } else { 
          /varset MeleeAttack_1 ${Ini[${PCini},${Me.Name},MeleeAttack_1]} 
          } 
        } 
    /if (${Defined[Param1]}) { 
      /varset MeleeAttack_2 ${Param1} 
        } else { 
          /varset MeleeAttack_2 ${Ini[${PCini},${Me.Name},MeleeAttack_2]} 
          } 
        } 
    /if (!${Defined[Param2]}) { 
      /varset MeleeAttack_3 ${Param2} 
        } else { 
          /varset MeleeAttack_3 ${Ini[${PCini},${Me.Name},MeleeAttack_3]} 
          } 
        } 

  :setINIvalues 
    /if (${OpenCorpse.Equal[NULL]}) /varset OpenCorpse ${Ini[${PCini},${Me.Name},OpenCorpse]} 
    /if (${MeleeAttack_1.Equal[NULL]}) /varset MeleeAttack_1 ${Ini[${PCini},${Me.Name},MeleeAttack_1]} 
    /if (${MeleeAttack_2.Equal[NULL]}) /varset MeleeAttack_2 ${Ini[${PCini},${Me.Name},MeleeAttack_2]} 
    /if (${MeleeAttack_3.Equal[NULL]}) /varset MeleeAttack_3 ${Ini[${PCini},${Me.Name},MeleeAttack_3]} 
    /varset DefaultMeleeDistance ${Ini[${PCini},${Me.Name},DefaultMeleeDistance]} 

  :StickBegin 
    /echo Starting Experience Tracking
    /call StartExpTrack

    /if (!${MeleeAttack_1.Equal[NONE]}) /echo Auto ${MeleeAttack_1} when available. 
    /if (!${MeleeAttack_2.Equal[NONE]}) /echo Auto ${MeleeAttack_2} when available. 
    /if (!${MeleeAttack_3.Equal[NONE]}) /echo Auto ${MeleeAttack_3} when available. 
  /goto :mainloop 
  
  :NewCharacter 
    /ini "${PCini}" ${Me.Name} DefaultMeleeDistance 13 
    /ini "${PCini}" ${Me.Name} MeleeAttack_1 NONE 
    /ini "${PCini}" ${Me.Name} MeleeAttack_2 NONE 
    /ini "${PCini}" ${Me.Name} MeleeAttack_3 NONE 
    /echo ${Me.Name} has been added to ${PCini}. Please re-run macro (also go edit ${PCini}) 
/endmacro 
  
  :mainloop 
    /if (${Me.Combat}) /call Attack 
    /doevents 
  /goto :mainloop 
/endmacro 

Sub attack 
  :attackCheck 
    /if (!${Target.Type.Equal["NPC"]}) { 
      /echo Not an NPC
      /attack off 
      /return 
      } 

    /if (${Target.Distance}>150) {
      /attack off 
      /echo Target too far: ${Target.Distance}
      }

  :attackSetup 
    /varset MobID ${Target.ID} 
    /varset HitFlag 0 
    /echo ${Target.CleanName} [${Target.Level} ${Target.Class}] MaxRangeTo: ${Target.MaxRangeTo}   
  :attackPreFight 
    /call ClearReturn 
    /if (${Me.Pet.ID}) /pet attack 
    /varset MeleeDistance ${Target.MaxRangeTo} 

  :attackMeleeLoop 
    
    /doevents RageOn 
    /doevents MobGate 
    /doevents StunON 

    /if (${HitFlag}==0) /goto :hitCheck 
    :continue 
    /if (${Target.ID}!=${MobID}) /goto :attackend 
    /if (${Macro.Return.Equal["EndATK"]}) /goto :attackend 
    /if (!${Me.Combat}) /goto :attackend 
    /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID} && ${Me.FeetWet})  /face fast 
    /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID} && !${Me.FeetWet}) /face fast nolook  
    /if (${Target.ID}==${MobID} && !${Me.Casting.ID}) /if (${Target.Distance}>${MeleeDistance}) /keypress FORWARD HOLD 
    /if (${Target.ID}==${MobID} && !${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /keypress FORWARD 
    /if (${Target.ID}==${MobID} && !${Me.Casting.ID}) /if (${Target.Distance}<=${Math.Calc[${MeleeDistance}-5]}) /keypress BACK HOLD 
    /if (!${MeleeAttack_1.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_1}]}) /doability ${MeleeAttack_1} 
    /if (!${MeleeAttack_2.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_2}]}) /doability ${MeleeAttack_2} 
    /if (!${MeleeAttack_3.Equal[NONE]}) /if (!${Me.Casting.ID}) /if (${Target.Distance}<=${MeleeDistance}) /if (${Me.AbilityReady[${MeleeAttack_2}]}) /doability ${MeleeAttack_3} 
  
    /if (${HitFlag}==0 && ${Target.Distance}<=${MeleeDistance}) { 
      /varcalc MeleeDistance ${MeleeDistance}-4 
      /echo DBG: MeleeDistance change: ${MeleeDistance}
      /delay 5 
      } else { 
    } 
  /goto :attackMeleeLoop 

  :hitCheck 
    /doevents Hit 
    /doevents Miss 
    /goto :continue 
  :attackend 
    
    /varset MobID 0 
    /attack off 
    /pet backoff 
    /pet hold 
    /keypress FORWARD 
/return 

Sub ClearReturn 
/return NULL 



Sub event_Hit 
  /varset HitFlag 1 
/return 

Sub event_Miss 
  /varset HitFlag 1 
/return 

Sub event_RageOn 
  /if (${Target.CurrentHPs}>15) /return 
  /if (${Target.CurrentHPs}==0) /return 
  /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID}) /keypress FORWARD 
  /call ClearReturn 
  /popup MOB ENRAGE
  /echo Rage On 
  /attack off 
  /pet back off 
  /pet hold 
  /call ClearReturn 

  :waitRage 
    /doevents 
    /if (${Target.ID}!=${MobID}) /return EndATK 
    /if (${Macro.Return.Equal["EndATK"]}) /return EndATK 
    /if (${Macro.Return.Equal["RageOFF"]}) /return 
/goto :waitRage 

Sub event_RageOFF 
  /echo Rage OFF 
  /popup MOB ENRAGE DONE
  /attack on 
/return RageOFF 


Sub event_MobGate 
  /if (${Target.Distance}<100) /return 
  /echo MOB GATED! 
  /attack off 
/return EndATK 

Sub event_Invited 
  /invite 
/return 

Sub event_StunON 
  /doevents flush StunOFF 
  /call ClearReturn 

  :LoopStunOFF 
    /doevents StunOFF 
    /if (${Macro.Return.Equal["StunOFF"]}) { 
    /call ClearReturn 
    /return 
      } 
/goto :LoopStunOFF 

Sub event_StunOFF 
/return StunOFF 

Sub event_LootMyCorpse
   /declare t int outer 0 
   /declare loottotal int outer 
   /declare lootslot int outer 
   /declare lootleft int outer 1 

  /echo "Looting My Corpse"

   :corpsepull 
   /target mycorpse 
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]} 

   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) { 
      /echo No corpse in this zone 
      /return 
   } 

   /delay 3s 
   /corpse 
   /delay 1s ${Target.Distance}<20 

   /if (${Target.Distance}>20) { 
      /echo Corpse is too far away 
      /return 
   } 

   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
      /loot 
   } 

   /delay 5s ${Me.State.Equal[BIND]} 
   /if (${Me.State.NotEqual[BIND]}) /goto :corpsepull 

   /varset loottotal 0 
   :LootLag 
   /if (${loottotal}!=${Corpse.Items}) { 
      /varset loottotal ${Corpse.Items} 
      /delay 1s 
      /goto :LootLag 
   } 

   /if (${loottotal}<=${lootleft}) { 
      /echo Looting aborted.  Error in number items to be left on corpse. 
      /notify LootWnd DoneButton leftmouseup 
      /return 
   } 

   /for lootslot 1 to ${loottotal} 
   :LootItem 
   /itemnotify loot${lootslot} rightmouseup 
   /delay 5 !${Corpse.Item[${lootslot}].ID} 
   /if (!${Corpse.Item[${lootslot}].ID}) { 
      /next lootslot 
   } else /goto :LootItem 

   /if (${Math.Calc[${Corpse.Items}-${lootleft}]}>0) /goto :LootLag 
   :DoneLooting 
   /notify LootWnd DoneButton leftmouseup 
   /echo Done looting.  
/return

Grimvall
decaying skeleton
decaying skeleton
Posts: 4
Joined: Sun Aug 15, 2004 8:06 pm

Post by Grimvall » Wed Aug 25, 2004 3:29 am

Neat. I made some additional changes in the attackloop.

The if statements were cleaned up, since they were evaluating the same variables multiple times.

Added a new event OOR which sets TargetOOR to True if it occurs. This enables MeleeDistance updates, incase the mob change runspeed or move too far away along the Z axis. TargetOOR (type bool) replaces the HitFlag in previous macro, because it's a more convenient name.

Enabled NPC pet killing which wasn't possible before, because Target.Type returns pet if you target a NPC pet :)

This macro should be ready to run without any modifications. If you want to use the exptracker you need to uncomment 3 lines:

Line 22:
|#include expreport.inc

Line 79, 80:
:StickBegin
|/echo Starting Experience Tracking
|/call StartExpTrack

Code: Select all

| Startup: 
|  /mac stick (will use stick-pc.ini settings) 
|  /mac stick disarm kick taunt  (will set your 3 melee actions.) 
| 
| To loot your own corpe: 
|  /echo LootMe 
| 

#turbo 
#event RageON "#*#has become ENRAGED.#*#" 
#event RageOFF "#*#is no longer enraged#*#" 
#event MobGate "#*# Gates.#*#" 
#event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#" 
#event StunON "#*#You are stunned#*#" 
#event StunON "#*#You lose control of yourself!#*#" 
#event StunOFF "#*#You are unstunned#*#" 
#event StunOFF "#*#You have control of yourself again.#*#" 
#event LootMyCorpse "#*#LootMe#*#" 
#event OOR "#*#Your target is too far away, get closer!#*#"
#event Miss "#*#You try to#*#but miss#*#"
#event Hit "#*#You#*#for#*#points of damage#*#"
|#include expreport.inc 

Sub main 
  :setDeclares 
    /declare PCini outer 
    /declare NPCini outer 
    /declare MA_SB outer 
    /declare MobID outer 
    /declare CharX outer 
    /declare CharY outer 
    /declare MOBini outer 
    /declare MeleeAttack_1 outer 
    /declare MeleeAttack_2 outer 
    /declare MeleeAttack_3 outer 
    /declare MeleeDistance outer 
    /declare DefaultMeleeDistance outer 
    /declare TankToggle outer
    /declare TargetOOR outer 
    	
  :setGenericVars 
    /varset MA_SB NULL 
    /varset TankToggle NULL 
    /varset PCini stick-pc.ini 
    /varset NPCini stick-npc.ini 
  
  :NewCharacterCheck 
    /varset DefaultMeleeDistance ${Ini[${PCini},${Me.Name},DefaultMeleeDistance]} 
    /if (${DefaultMeleeDistance.Equal[NULL]}) /goto :NewCharacter 

  :setParams 
    /if (${Defined[Param0]}) { 
      /varset MeleeAttack_1 ${Param0} 
        } else { 
          /varset MeleeAttack_1 ${Ini[${PCini},${Me.Name},MeleeAttack_1]} 
          } 
        } 
    /if (${Defined[Param1]}) { 
      /varset MeleeAttack_2 ${Param1} 
        } else { 
          /varset MeleeAttack_2 ${Ini[${PCini},${Me.Name},MeleeAttack_2]} 
          } 
        } 
    /if (!${Defined[Param2]}) { 
      /varset MeleeAttack_3 ${Param2} 
        } else { 
          /varset MeleeAttack_3 ${Ini[${PCini},${Me.Name},MeleeAttack_3]} 
          } 
        } 

  :setINIvalues 
    /if (${OpenCorpse.Equal[NULL]}) /varset OpenCorpse ${Ini[${PCini},${Me.Name},OpenCorpse]} 
    /if (${MeleeAttack_1.Equal[NULL]}) /varset MeleeAttack_1 ${Ini[${PCini},${Me.Name},MeleeAttack_1]} 
    /if (${MeleeAttack_2.Equal[NULL]}) /varset MeleeAttack_2 ${Ini[${PCini},${Me.Name},MeleeAttack_2]} 
    /if (${MeleeAttack_3.Equal[NULL]}) /varset MeleeAttack_3 ${Ini[${PCini},${Me.Name},MeleeAttack_3]} 
    /varset DefaultMeleeDistance ${Ini[${PCini},${Me.Name},DefaultMeleeDistance]} 

  :StickBegin 
    |/echo Starting Experience Tracking 
    |/call StartExpTrack 

    /if (!${MeleeAttack_1.Equal[NONE]}) /echo Auto ${MeleeAttack_1} when available. 
    /if (!${MeleeAttack_2.Equal[NONE]}) /echo Auto ${MeleeAttack_2} when available. 
    /if (!${MeleeAttack_3.Equal[NONE]}) /echo Auto ${MeleeAttack_3} when available. 
  /goto :mainloop 
  
  :NewCharacter 
    /ini "${PCini}" ${Me.Name} DefaultMeleeDistance 13 
    /ini "${PCini}" ${Me.Name} MeleeAttack_1 NONE 
    /ini "${PCini}" ${Me.Name} MeleeAttack_2 NONE 
    /ini "${PCini}" ${Me.Name} MeleeAttack_3 NONE 
    /echo ${Me.Name} has been added to ${PCini}. Please re-run macro (also go edit ${PCini}) 
/endmacro 
  
  :mainloop 
    /if (${Me.Combat}) /call Attack 
    /doevents Invited
    /doevents LootMyCorpse
  /goto :mainloop 
/endmacro 

Sub attack 
  :attackCheck 
    /if (!${Target.Type.Equal["NPC"]}) { 
      /if (!${Target.Type.Equal["PET"]} && !${Target.Master.Type.Equal["NPC"]}) {
        /echo Not an NPC or NPC pet!
        /attack off 
        /return 
        }
      }
    /if (${Target.Distance}>250) { 
      /attack off 
      /echo Target too far: ${Target.Distance} 
      } 

  :attackSetup 
    /varset MobID ${Target.ID}  
    /echo ${Target.CleanName} [${Target.Level} ${Target.Class}] MaxRangeTo: ${Target.MaxRangeTo}    
  
    
  :attackPreFight 
    /call ClearReturn 
    /if (${Me.Pet.ID}) /pet attack 
    /varset MeleeDistance ${Target.MaxRangeTo} 
    /varset TargetOOR ${Bool[True]}    
    
  :attackMeleeLoop 
    /doevents RageOn 
    /doevents MobGate 
    /doevents StunON 
    /doevents OOR 
    /if (${Target.ID}!=${MobID} || ${Macro.Return.Equal["EndATK"]} || !${Me.Combat}) {
      /goto :attackend 
      }	
    /if (${Target.ID}==${MobID} && !${Me.Casting.ID}) {
      /if (!${Me.FeetWet}) {
        /face fast nolook 
        } else /face fast  
      /if (${Target.Distance}>${MeleeDistance}) {
        /keypress FORWARD HOLD 
        }
      /if (${Target.Distance}<=${MeleeDistance}) {
        /keypress FORWARD          
        /if (${TargetOOR}) {
          /varcalc MeleeDistance ${MeleeDistance}-0.5 
          /delay 4   
          /echo DBG: MeleeDistance: [${MeleeDistance}]
          /doevents Hit
          /doevents Miss 
          } 
        /keypress FORWARD        
        }        
      /if (${Target.Distance}<=${Math.Calc[${MeleeDistance}-5]}) {
        /keypress BACK HOLD
        }
      }
          
    /if (!${Me.Casting.ID} && ${Target.Distance}<=${MeleeDistance} && ${Me.AbilityReady[${MeleeAttack_1}]}) {
      /if (!${MeleeAttack_1.Equal[NONE]}) {
        /doability ${MeleeAttack_1} 
        }
      /if (!${MeleeAttack_2.Equal[NONE]}) {
        /doability ${MeleeAttack_2} 
        }
      /if (!${MeleeAttack_3.Equal[NONE]}) {
        /doability ${MeleeAttack_3} 
        }
      }
  
  /goto :attackMeleeLoop 

  :attackend 
    
    /varset MobID 0 
    /attack off 
    /pet backoff 
    /pet hold 
    /keypress FORWARD 
/return 

Sub ClearReturn 
/return NULL 

Sub event_Hit
  /varset TargetOOR ${Bool[NULL]} 
  /doevents flush OOR
/return
  
Sub event_Miss
  /varset TargetOOR ${Bool[NULL]} 
  /doevents flush OOR
/return

Sub event_OOR 
  /varset TargetOOR ${Bool[True]}
  /doevents flush Hit
  /doevents flush Miss
/return 

Sub event_RageOn 
  /if (${Target.CurrentHPs}>15) /return 
  /if (${Target.CurrentHPs}==0) /return 
  /if (${Target.ID}==${MobID}) /if (!${Me.Casting.ID}) /keypress FORWARD 
  /call ClearReturn 
  /popup MOB ENRAGE 
  /echo Rage On 
  /attack off 
  /pet back off 
  /pet hold 
  /call ClearReturn 

  :waitRage 
    /doevents 
    /if (${Target.ID}!=${MobID}) /return EndATK 
    /if (${Macro.Return.Equal["EndATK"]}) /return EndATK 
    /if (${Macro.Return.Equal["RageOFF"]}) /return 
/goto :waitRage 

Sub event_RageOFF 
  /echo Rage OFF 
  /popup MOB ENRAGE DONE 
  /attack on 
/return RageOFF 


Sub event_MobGate 
  /if (${Target.Distance}<100) /return 
  /echo MOB GATED! 
  /attack off 
/return EndATK 

Sub event_Invited 
  /delay 10
  /invite 
/return 

Sub event_StunON 
  /doevents flush StunOFF 
  /call ClearReturn 

  :LoopStunOFF 
    /doevents StunOFF 
    /if (${Macro.Return.Equal["StunOFF"]}) { 
    /call ClearReturn 
    /return 
      } 
/goto :LoopStunOFF 

Sub event_StunOFF 
/return StunOFF 

Sub event_LootMyCorpse 
   /declare t int outer 0 
   /declare loottotal int outer 
   /declare lootslot int outer 
   /declare lootleft int outer 1 

  /echo "Looting My Corpse" 

   :corpsepull 
   /target mycorpse 
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]} 

   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) { 
      /echo No corpse in this zone 
      /return 
   } 

   /delay 3s 
   /corpse 
   /delay 1s ${Target.Distance}<20 

   /if (${Target.Distance}>20) { 
      /echo Corpse is too far away 
      /return 
   } 

   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
      /loot 
   } 

   /delay 5s ${Me.State.Equal[BIND]} 
   /if (${Me.State.NotEqual[BIND]}) /goto :corpsepull 

   /varset loottotal 0 
   :LootLag 
   /if (${loottotal}!=${Corpse.Items}) { 
      /varset loottotal ${Corpse.Items} 
      /delay 1s 
      /goto :LootLag 
   } 

   /if (${loottotal}<=${lootleft}) { 
      /echo Looting aborted.  Error in number items to be left on corpse. 
      /notify LootWnd DoneButton leftmouseup 
      /return 
   } 

   /for lootslot 1 to ${loottotal} 
   :LootItem 
   /itemnotify loot${lootslot} rightmouseup 
   /delay 5 !${Corpse.Item[${lootslot}].ID} 
   /if (!${Corpse.Item[${lootslot}].ID}) { 
      /next lootslot 
   } else /goto :LootItem 

   /if (${Math.Calc[${Corpse.Items}-${lootleft}]}>0) /goto :LootLag 
   :DoneLooting 
   /notify LootWnd DoneButton leftmouseup 
   /echo Done looting.  
/return 

Flatline
decaying skeleton
decaying skeleton
Posts: 2
Joined: Mon Oct 28, 2002 4:08 am

Post by Flatline » Sat Sep 04, 2004 3:31 am

Changed Grimvall's code slightly:

Code: Select all

    /if (!${Me.Casting.ID} && ${Target.Distance}<=${MeleeDistance} && ${Me.AbilityReady[${MeleeAttack_1}]}) { 
      /if (!${MeleeAttack_1.Equal[NONE]}) { 
        /doability "${MeleeAttack_1}"
	} 
      /if (!${MeleeAttack_2.Equal[NONE]}) { 
        /doability "${MeleeAttack_2}" 
        } 
      /if (!${MeleeAttack_3.Equal[NONE]}) { 
        /doability "${MeleeAttack_3}" 
        } 
      } 
Put quotes around the attack specials, it was erroring out when trying to do special attacks comprised of multiple words (i.e. Flying Kick.)

Another note for monks, adding this to the melee loop, from one of the other macros here, to Grimvalls code does work fine:

Code: Select all

    /if (${Me.Class.Name.Equal[Monk]}) { 
      /if (!${Me.Buff[Celestial Tranquility].ID} && !${Me.Buff[Speed of Vallon].ID} && !${Me.Buff[Vallon's Quickening].ID}) /cast item "Celestial Fists" 
   } 

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

Post by fearless » Wed Nov 17, 2004 1:02 pm

For anybody that might still be using this or the derivitives included in the thread, there is an error in :setParams.

Change

Code: Select all

/if (!${Defined[Param3]}) {
to

Code: Select all

/if (${Defined[Param3]}) {
The original post has been corrected.
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]