stick.mac (Version: 2.25.04a)

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

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

Post by LamahHerder » Sun Mar 14, 2004 1:32 pm

C247 thanks for the catch
The appropiate fix is

Code: Select all

/if "@MA_SB"!="No"
to

Code: Select all

/if "@MA_SB"!="NULL"
in the combat section near the bottom.

romezidane
orc pawn
orc pawn
Posts: 12
Joined: Mon Mar 15, 2004 7:48 pm

Post by romezidane » Wed Mar 17, 2004 9:13 am

was wondering if it is possible to add code in to watch for directional push, so you automatically turn to the opposite direction of what was called in raid or guild chat :) thanks

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Thu Apr 15, 2004 12:18 am

Anyone still updating this? With latest version of MQ2 keyboard locks up while attacking.

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

Post by mackster » Fri Apr 16, 2004 9:37 am

Flea wrote:Anyone still updating this? With latest version of MQ2 keyboard locks up while attacking.
I'm having the same thing too now =\

This macro still rules, though. I have a hotkey for it that is in turn tied to my programmable gamepad, which means I can kick back and run macros within macros and easy assist/attack on raids, which my achy wrists are thankful for =)

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Fri Apr 16, 2004 10:46 am

for lag type lock-ups set #turbo to #turbo 10

kasodo
a lesser mummy
a lesser mummy
Posts: 64
Joined: Fri Feb 13, 2004 9:41 am

/keypress implemented

Post by kasodo » Fri Apr 16, 2004 10:58 am

I updated the /sendkey and /press...

Also set Turbo to 20 might need adjusting im at work can someone test this?

Code: Select all

|===========| 
| 02.25.04a | 
|___________| 
| | 
| stick.mac | 
| by m0nk | 
|___________| 
| 
| -Syntax = /mac stick "NinjaLoot (0 or 1)" "MeleeAbility_1" "MeleeAbility_2" "MeleeAbility_3" 
| example = /mac stick 0 "bash" (will not loot and only bash) 
| example = /mac stick 1 "Flying Kick" "Disarm" (will loot, Flying Kick ,disarm) 
| example = /mac stick (will do what the defaults are set to in the stick-pc.ini file) 
| 
#turbo 20
#define MOBini "stick-npc.ini" 
#define PCini "stick-pc.ini 
|#include spellcast.inc 

#event EXP "experience!!" 
#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 TauntThisRound "to ignore others and attack you!" 
#event ToggleTaunt "[MQ2] tt" 
#event ToggleNinja "[MQ2] nl" 

Sub main 
:setupDeclare 
/zapvars 
/declare MA_SB global 
/declare MobID global 
/declare CharX global 
/declare CharY global 
/declare Time_MA_SB timer 
/declare NinjaLewt global 
/declare RestBuff_1 global 
/declare RestBuff_2 global 
/declare RestBuff_3 global 
/declare RestBuff_4 global 
/declare RestBuff_5 global 
/declare RestBuff_6 global 
/declare RestBuff_7 global 
/declare RestBuff_8 global 
/declare CmbtBuff_1 global 
/declare CmbtBuff_2 global 
/declare CmbtBuff_3 global 
/declare CmbtBuff_4 global 
/declare CmbtBuff_5 global 
/declare CmbtBuff_6 global 
/declare CmbtBuff_7 global 
/declare CmbtBuff_8 global 
/declare TauntToggle global 
/declare MA_Timer_SB global 
/declare MeleeAttack_1 global 
/declare MeleeAttack_2 global 
/declare MeleeAttack_3 global 
/declare MeleeDistance global 
/declare RestItemBuff_1 global 
/declare RestItemBuff_2 global 
/declare RestItemBuff_3 global 
/declare RestItemBuff_4 global 
/declare RestItemBuff_5 global 
/declare RestItemBuff_6 global 
/declare RestItemBuff_7 global 
/declare RestItemBuff_8 global 
/declare CmbtItemBuff_1 global 
/declare CmbtItemBuff_2 global 
/declare CmbtItemBuff_3 global 
/declare CmbtItemBuff_4 global 
/declare CmbtItemBuff_5 global 
/declare CmbtItemBuff_6 global 
/declare CmbtItemBuff_7 global 
/declare CmbtItemBuff_8 global 
/declare DefaultMeleeDistance global 

:setupVarset 
/varset MA_SB "NULL" 
/varset MeleeAttack_1 "@Param1" 
/varset MeleeAttack_2 "@Param2" 
/varset MeleeAttack_3 "@Param3" 
/varset MA_Timer_SB 60 
/varset TauntToggle NULL 
/varset NinjaLewt "@Param0" 

:setPCiniOther 
/if $defined(Param0)!=TRUE /varset NinjaLewt $ini("PCini","$char(name)","NinjaLewt") 
/if "@NinjaLewt"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "NinjaLewt" "0" 
/delay 0 
/varset NinjaLewt $ini("PCini","$char(name)","NinjaLewt") 
} 

/if $defined(Param1)!=TRUE /varset MeleeAttack_1 $ini("PCini","$char(name)","MeleeAttack_1") 
/if "@MeleeAttack_1"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "MeleeAttack_1" "NULL" 
/delay 0 
/varset MeleeAttack_1 $ini("PCini","$char(name)","MeleeAttack_1") 
} 

/if $defined(Param2)!=TRUE /varset MeleeAttack_2 $ini("PCini","$char(name)","MeleeAttack_2") 
/if "@MeleeAttack_2"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "MeleeAttack_2" "NULL" 
/delay 0 
/varset MeleeAttack_2 $ini("PCini","$char(name)","MeleeAttack_2") 
} 

/if $defined(Param3)!=TRUE /varset MeleeAttack_3 $ini("PCini","$char(name)","MeleeAttack_3") 
/if "@MeleeAttack_3"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "MeleeAttack_3" "NULL" 
/delay 0 
/varset MeleeAttack_3 $ini("PCini","$char(name)","MeleeAttack_3") 
} 

/varset DefaultMeleeDistance $ini("PCini","$char(name)","DefaultMeleeDistance") 
/if "@DefaultMeleeDistance"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "DefaultMeleeDistance" "15" 
/delay 0 
/varset DefaultMeleeDistance $ini("PCini","$char(name)","DefaultMeleeDistance") 
} 

:setPCiniBuffs 
/varset RestBuff_1 "$ini("PCini","$char(name)","RestBuff_1")" 
/if "@RestBuff_1"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_1" "NULL" 
/delay 0 
/varset RestBuff_1 $ini("PCini","$char(name)","RestBuff_1") 
} 
/varset RestBuff_2 $ini("PCini","$char(name)","RestBuff_2") 
/if "@RestBuff_2"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_2" "NULL" 
/delay 0 
/varset RestBuff_2 $ini("PCini","$char(name)","RestBuff_2") 
} 
/varset RestBuff_3 $ini("PCini","$char(name)","RestBuff_3") 
/if "@RestBuff_3"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_3" "NULL" 
/delay 0 
/varset RestBuff_3 $ini("PCini","$char(name)","RestBuff_3") 
} 
/varset RestBuff_4 $ini("PCini","$char(name)","RestBuff_4") 
/if "@RestBuff_4"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_4" "NULL" 
/delay 0 
/varset RestBuff_4 $ini("PCini","$char(name)","RestBuff_4") 
} 
/varset RestBuff_5 $ini("PCini","$char(name)","RestBuff_5") 
/if "@RestBuff_5"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_5" "NULL" 
/delay 0 
/varset RestBuff_5 $ini("PCini","$char(name)","RestBuff_5") 
} 
/varset RestBuff_6 $ini("PCini","$char(name)","RestBuff_6") 
/if "@RestBuff_6"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_6" "NULL" 
/delay 0 
/varset RestBuff_6 $ini("PCini","$char(name)","RestBuff_6") 
} 
/varset RestBuff_7 $ini("PCini","$char(name)","RestBuff_7") 
/if "@RestBuff_7"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_7" "NULL" 
/delay 0 
/varset RestBuff_7 $ini("PCini","$char(name)","RestBuff_7") 
} 
/varset RestBuff_8 $ini("PCini","$char(name)","RestBuff_8") 
/if "@RestBuff_8"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestBuff_8" "NULL" 
/delay 0 
/varset RestBuff_8 $ini("PCini","$char(name)","RestBuff_8") 
} 
/varset CmbtBuff_1 "$ini("PCini","$char(name)","CmbtBuff_1")" 
/if "@CmbtBuff_1"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_1" "NULL" 
/delay 0 
/varset CmbtBuff_1 $ini("PCini","$char(name)","CmbtBuff_1") 
} 
/varset CmbtBuff_2 $ini("PCini","$char(name)","CmbtBuff_2") 
/if "@CmbtBuff_2"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_2" "NULL" 
/delay 0 
/varset CmbtBuff_2 $ini("PCini","$char(name)","CmbtBuff_2") 
} 
/varset CmbtBuff_3 $ini("PCini","$char(name)","CmbtBuff_3") 
/if "@CmbtBuff_3"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_3" "NULL" 
/delay 0 
/varset CmbtBuff_3 $ini("PCini","$char(name)","CmbtBuff_3") 
} 
/varset CmbtBuff_4 $ini("PCini","$char(name)","CmbtBuff_4") 
/if "@CmbtBuff_4"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_4" "NULL" 
/delay 0 
/varset CmbtBuff_4 $ini("PCini","$char(name)","CmbtBuff_4") 
} 
/varset CmbtBuff_5 $ini("PCini","$char(name)","CmbtBuff_5") 
/if "@CmbtBuff_5"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_5" "NULL" 
/delay 0 
/varset CmbtBuff_5 $ini("PCini","$char(name)","CmbtBuff_5") 
} 
/varset CmbtBuff_6 $ini("PCini","$char(name)","CmbtBuff_6") 
/if "@CmbtBuff_6"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_6" "NULL" 
/delay 0 
/varset CmbtBuff_6 $ini("PCini","$char(name)","CmbtBuff_6") 
} 
/varset CmbtBuff_7 $ini("PCini","$char(name)","CmbtBuff_7") 
/if "@CmbtBuff_7"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_7" "NULL" 
/delay 0 
/varset CmbtBuff_7 $ini("PCini","$char(name)","CmbtBuff_7") 
} 
/varset CmbtBuff_8 $ini("PCini","$char(name)","CmbtBuff_8") 
/if "@CmbtBuff_8"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtBuff_8" "NULL" 
/delay 0 
/varset CmbtBuff_8 $ini("PCini","$char(name)","CmbtBuff_8") 
} 
/varset RestItemBuff_1 "$ini("PCini","$char(name)","RestItemBuff_1")" 
/if "@RestItemBuff_1"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_1" "NULL" 
/delay 0 
/varset RestItemBuff_1 $ini("PCini","$char(name)","RestItemBuff_1") 
} 
/varset RestItemBuff_2 $ini("PCini","$char(name)","RestItemBuff_2") 
/if "@RestItemBuff_2"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_2" "NULL" 
/delay 0 
/varset RestItemBuff_2 $ini("PCini","$char(name)","RestItemBuff_2") 
} 
/varset RestItemBuff_3 $ini("PCini","$char(name)","RestItemBuff_3") 
/if "@RestItemBuff_3"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_3" "NULL" 
/delay 0 
/varset RestItemBuff_3 $ini("PCini","$char(name)","RestItemBuff_3") 
} 
/varset RestItemBuff_4 $ini("PCini","$char(name)","RestItemBuff_4") 
/if "@RestItemBuff_4"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_4" "NULL" 
/delay 0 
/varset RestItemBuff_4 $ini("PCini","$char(name)","RestItemBuff_4") 
} 
/varset RestItemBuff_5 $ini("PCini","$char(name)","RestItemBuff_5") 
/if "@RestItemBuff_5"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_5" "NULL" 
/delay 0 
/varset RestItemBuff_5 $ini("PCini","$char(name)","RestItemBuff_5") 
} 
/varset RestItemBuff_6 $ini("PCini","$char(name)","RestItemBuff_6") 
/if "@RestItemBuff_6"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_6" "NULL" 
/delay 0 
/varset RestItemBuff_6 $ini("PCini","$char(name)","RestItemBuff_6") 
} 
/varset RestItemBuff_7 $ini("PCini","$char(name)","RestItemBuff_7") 
/if "@RestItemBuff_7"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_7" "NULL" 
/delay 0 
/varset RestItemBuff_7 $ini("PCini","$char(name)","RestItemBuff_7") 
} 
/varset RestItemBuff_8 $ini("PCini","$char(name)","RestItemBuff_8") 
/if "@RestItemBuff_8"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "RestItemBuff_8" "NULL" 
/delay 0 
/varset RestItemBuff_8 $ini("PCini","$char(name)","RestItemBuff_8") 
} 
/varset CmbtItemBuff_1 "$ini("PCini","$char(name)","CmbtItemBuff_1")" 
/if "@CmbtItemBuff_1"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_1" "NULL" 
/delay 0 
/varset CmbtItemBuff_1 $ini("PCini","$char(name)","CmbtItemBuff_1") 
} 
/varset CmbtItemBuff_2 $ini("PCini","$char(name)","CmbtItemBuff_2") 
/if "@CmbtItemBuff_2"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_2" "NULL" 
/delay 0 
/varset CmbtItemBuff_2 $ini("PCini","$char(name)","CmbtItemBuff_2") 
} 
/varset CmbtItemBuff_3 $ini("PCini","$char(name)","CmbtItemBuff_3") 
/if "@CmbtItemBuff_3"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_3" "NULL" 
/delay 0 
/varset CmbtItemBuff_3 $ini("PCini","$char(name)","CmbtItemBuff_3") 
} 
/varset CmbtItemBuff_4 $ini("PCini","$char(name)","CmbtItemBuff_4") 
/if "@CmbtItemBuff_4"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_4" "NULL" 
/delay 0 
/varset CmbtItemBuff_4 $ini("PCini","$char(name)","CmbtItemBuff_4") 
} 
/varset CmbtItemBuff_5 $ini("PCini","$char(name)","CmbtItemBuff_5") 
/if "@CmbtItemBuff_5"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_5" "NULL" 
/delay 0 
/varset CmbtItemBuff_5 $ini("PCini","$char(name)","CmbtItemBuff_5") 
} 
/varset CmbtItemBuff_6 $ini("PCini","$char(name)","CmbtItemBuff_6") 
/if "@CmbtItemBuff_6"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_6" "NULL" 
/delay 0 
/varset CmbtItemBuff_6 $ini("PCini","$char(name)","CmbtItemBuff_6") 
} 
/varset CmbtItemBuff_7 $ini("PCini","$char(name)","CmbtItemBuff_7") 
/if "@CmbtItemBuff_7"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_7" "NULL" 
/delay 0 
/varset CmbtItemBuff_7 $ini("PCini","$char(name)","CmbtItemBuff_7") 
} 
/varset CmbtItemBuff_8 $ini("PCini","$char(name)","CmbtItemBuff_8") 
/if "@CmbtItemBuff_8"=="NOTFOUND" { 
/ini "PCini" "$char(name)" "CmbtItemBuff_8" "NULL" 
/delay 0 
/varset CmbtItemBuff_8 $ini("PCini","$char(name)","CmbtItemBuff_8") 
} 

:setupSBCheck 
/if ("@MeleeAttack_1"=="bash" || "@MeleeAttack_1"=="slam") { 
/echo Auto @MeleeAttack_1 every @MA_Timer_SB. 
/varset MA_SB "@MeleeAttack_1" 
/varset MeleeAttack_1 "NULL" 
} 
/if ("@MeleeAttack_2"=="bash" || "@MeleeAttack_2"=="slam") { 
/echo Auto @MeleeAttack_2 every @MA_Timer_SB 
/varset MA_SB "@MeleeAttack_2" 
/varset MeleeAttack_2 "NULL" 
} 
/if ("@MeleeAttack_3"=="bash" || "@MeleeAttack_3"=="slam") { 
/echo Auto @MeleeAttack_3 every @MA_Timer_SB 
/varset MA_SB "@MeleeAttack_3" 
/varset MeleeAttack_3 "NULL" 
} 

:start 
/if "@MeleeAttack_1"!="NULL" /echo Auto @MeleeAttack_1 when availiable. 
/if "@MeleeAttack_2"!="NULL" /echo Auto @MeleeAttack_2 when availiable. 
/if "@MeleeAttack_3"!="NULL" /echo Auto @MeleeAttack_3 when availiable. 
/if n @NinjaLewt==1 /echo Auto Ninja Loot 

:mainloop 
/if $combat==TRUE /call Attack 
/doevents 
/goto :mainloop 
/endmacro 

Sub attack 
:attackCheck 
/varset MobID $target(id) 

:attackSetup 
/if $target(type)!=NPC { 
/attack off 
/delay 5 
/return 
} 
/if n $target(distance)>150 { 
/attack off 
/delay 5 
/return 
} 

:attackPreFight 
/call ClearReturn 
/if n $char(pet)!=0 /pet attack 
/varset MeleeDistance $ini("MOBini","$zone","$target(name,clean).DistanceMelee") 
/if "@MeleeDistance"=="NOTFOUND" { 
/ini "MOBini" "$zone" "$target(name,clean).DistanceMelee" @DefaultMeleeDistance 
/delay 0 
/varset MeleeDistance $ini("MOBini","$zone","$target(name,clean).DistanceMelee") 
} 

:attackMeleeLoop 
/doevents exp 
/doevents RageOn 
/doevents MobGate 
/doevents StunON 
/doevents ToggleTaunt 
/doevents TauntThisRound 
/if n $target(id)!=@MobID /goto :attackend 
/if $return==EndATK /goto :attackEnd 
/if $combat!=TRUE /goto :attackend 
/if $char(casting)!=TRUE /if n $char(feetwet)!=0 /face fast 
/if $char(casting)!=TRUE /if n $char(feetwet)==0 /face fast nolook 
/if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)>@MeleeDistance /keypress FORWARD hold  
/if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /keypress FORWARD 
/if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=$calc(@MeleeDistance-5) /keypress BACK hold 
/if "@MeleeAttack_1"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"@MeleeAttack_1")>0 /doability "@MeleeAttack_1" 
/if "@MeleeAttack_2"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"@MeleeAttack_2")>0 /doability "@MeleeAttack_2" 
/if "@MeleeAttack_3"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"@MeleeAttack_2")>0 /doability "@MeleeAttack_3" 
/if "@TauntToggle"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"taunt")>0 /doability "taunt" 
/if "@MA_SB"!="No" /if n "@Time_MA_SB"=="0" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance { 
/doability "@MA_SB" 
/varset Time_MA_SB @MA_Timer_SB 
} 
|/if "$char(class)"=="Shadow Knight" /if $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /goto :attackSpellsSK 
/goto :attackMeleeLoop 

:attackSpellsSK 
/if n $char(gem,"Zevfeer's Bite")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Zevfeer's Bite" 
/if n $char(gem,"Aura of Hate")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Aura of Hate" 
/if n $char(gem,"Spear of Decay")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Decay" 
/if n $char(gem,"Spear of Plague")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Plague" 
/if n $char(hp,pct)<90 /if n $char(buff,"Bond of Death Recourse")==0 /if n $char(gem,"Bond of Death")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Bond of Death" 
/goto :attackMeleeLoop 

:attackend 
/if n @NinjaLewt!=0 /doevents exp 
/varset MobID NULL 
/if @TauntToggle!=NULL /varset TauntToggle NULL 
/attack off 
/pet backoff 
/pet hold 
/keypress FORWARD 
/return 

Sub ClearReturn 
/return NULL 

Sub event_exp 
/if n $target(hp,pct)>0 /return 
/if n @NinjaLewt==0 /return EndATK 
/if $target(type)!=CORPSE /target id @MobID 
/loot 
/keypress FORWARD 
/loot 
/loot 
/loot 
/return EndATK 

Sub event_RageOn 
/if n $target(hp,pct)>15 /return 
/if n $target(hp,pct)==0 /return 
/if $target(id)==@MobID /if $char(casting)!=TRUE /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 $return==EndATK /return EndATK 
/if $return==RageOFF /return 
/goto :waitRage 

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

Sub event_MobGate 
/if n $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 "$return"=="StunOFF" { 
/call ClearReturn 
/return 
} 
/goto :LoopStunOFF 

Sub event_StunOFF 
/return StunOFF 

Sub event_TauntThisRound 
/if "@TauntToggle"!="Yes" /if "@MeleeAttack_1"!="taunt" /if "@MeleeAttack_2"!="taunt" /if "@MeleeAttack_3"!="taunt") { 
/echo Taunting this round against %t 
/varset TauntToggle Yes 
} 
/return 

Sub event_ToggleTaunt 
/if "@MeleeAttack_1"=="taunt" { 
/varset MeleeAttack_1 "NULL" 
/echo Will no longer taunt. 
/return 
} 
/if "@MeleeAttack_2"=="taunt" { 
/varset MeleeAttack_2 "NULL" 
/echo Will no longer taunt. 
/return 
} 
/if "@MeleeAttack_3"=="taunt" { 
/varset MeleeAttack_3 "NULL" 
/echo Will no longer taunt. 
/return 
} 
/if "@MeleeAttack_1"=="NULL" { 
/varset MeleeAttack_1 taunt 
/echo Auto @MeleeAttack_1 when availiable. 
/return 
} 
/if "@MeleeAttack_2"=="NULL" { 
/varset MeleeAttack_2 taunt 
/echo Auto @MeleeAttack_2 when availiable. 
/return 
} 
/if "@MeleeAttack_3"=="NULL" { 
/varset MeleeAttack_3 taunt 
/echo Auto @MeleeAttack_3 when availiable. 
/return 
} 
/return 

Sub event_ToggleNinja 
/if n "@NinjaLewt"=="0" { 
/varset NinjaLewt 1 
/echo NinjaLewt On 
/return 
} 
/if n "@NinjaLewt"=="1" { 
/varset NinjaLewt 1 
/echo NinjaLewt Off 
} 
/return

kasodo
a lesser mummy
a lesser mummy
Posts: 64
Joined: Fri Feb 13, 2004 9:41 am

Tested?

Post by kasodo » Fri Apr 16, 2004 12:57 pm

Has anyone tested the code I posted yet? Was curious if that helped anything..

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

Post by mackster » Fri Apr 16, 2004 1:09 pm

thanks kasodo, that works great

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Anyone have an idea why !

Post by Fuergrissa » Sat Apr 17, 2004 3:17 am

i allways use "stick" in conjunction with genbot on my cleric and i have never had any problems with it, i have added a few little tweaks to cast my Fabledjboots and stuff and these lines to use begging for aggro.

Code: Select all

      /if n $char(ability,begging)>0 {
      /attack off
      /doability begging
      /attack on
up until the latest patch its allways been fine but with this code in, it just locks my keyboard up saying "You cant use this command now", any kind person have any idea why it might do this, the core code is the same as the code on this page.

Many Thanks in advance

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

Post by LamahHerder » Sun Apr 18, 2004 4:04 pm

I have been holding off on updates for this till MQ2Data is fully implemented.

Finally going to get to be home for a week come tuesday so may post new version then, but most likely waiting for MQ2Data, still have yet to convert over to that system and dont want to add too much new stuff without getting that done yet...

Have ALOT of new ideas that will be comming out.
Will be a large overhaul.

Current plans....
-Toggle/Logic for getbehind
-Toggle/Logic for assist-someone
-Toggle for follow-someone
-InstaClick/SpellCast buffs downtime and fighttime
-RangedFighting
-Class Specific calls (evade/hide - hybrid combat spells etc...)
-Alot of stick-pc.inc options


My end goal of stick.mac is to be a FAST multi-class fight macro that can be used while actually seriously playing the character but can also be put into a mode to be completley automatic and also work in a Hive type enviroment amongst other bots, melee portion is first half. Just need the time to get around to completeing everything without loosing speed because of so many options.

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

Post by mackster » Sun Apr 18, 2004 7:44 pm

My end goal of stick.mac is to be a FAST multi-class fight macro that can be used while actually seriously playing the character but can also be put into a mode to be completley automatic and also work in a Hive type enviroment amongst other bots, melee portion is first half. Just need the time to get around to completeing everything without loosing speed because of so many options.
There are some really interesting possibilities that's for sure. I'd just like to say big thanks for this macro. I have some pretty nasty tendosynovitis and my wrists ache all the time. Can actually play my toon really well again with this macro.

I have done a very very rudimentary job adding in some commands that the stick.mac relays to a genbot toon, so that level of synchronization helps even more.

If you're taking suggestions, it would be really cool if this macro had some features like genbot where a paladin could automatically spot heal and use group heals based on the ini.

apollo5145
orc pawn
orc pawn
Posts: 26
Joined: Wed Feb 25, 2004 8:14 pm

Post by apollo5145 » Sun Apr 18, 2004 9:46 pm

Here's my heavily modified stick.mac for berserkers. It has the auto assist, anchor, attack from behind, and a few more things in it. It also auto stuns gating mobs, evades or taunts (berserker style). Berserkers need to modify the /keypress hotx commands though since there is no /doability for bers stun/evade/snare. Other normal stick.mac stuff should still be functional too.

Code: Select all

#turbo 
#define NPCini "stick-NPC.ini" 
#define PCini "stick-PC.ini 
|#include spellcast.inc 
|
|            
| bersstick.mac  
|  
|___________ 
| 
| -Syntax = /mac stick "NinjaLoot (0 or 1)" "MeleeAbility_1" "MeleeAbility_2" "MeleeAbility_3" 
| example = /mac stick 0 "bash" (will not loot and only bash) 
| example = /mac stick 1 "bash" (will not loot and only bash) 
| example = /mac stick 1 "Flying Kick" "Disarm" (will loot, Flying Kick ,disarm) 
| example = /mac stick (will do what the defaults are set to in the :editDefaults section) 
| 
#event EXP "experience!!" 
#event RageON "has become ENRAGED." 
#event RageOFF "is no longer enraged" 
#event MobGate " Gates." 
#event StopGate "the gate spell"
#event Invited "To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel" 
#event StunON "You are stunned" 
#event StunOFF "You are unstunned" 
#event TauntThisRound "to ignore others and attack you!" 
#event ToggleTaunt "[MQ2] tt" 
#event getbehind "[MQ2] behind"


Sub main 
   :setupDeclare 
      /zapvars 
      /declare movetimes global
      /declare MA_1 global 
      /declare MA_2 global 
      /declare MA_3 global 
      /declare MA_SB global 
      /declare TauntToggle global 
      /declare MA_Timer_SB global 
      /declare MobID global 
      /declare NinjaLewt global 
      /declare MeleeDistance global 
      /declare ChangeDistance global
      /declare Time_MA_SB timer 
      /declare staybehind global
      /declare catimer timer
      /declare taunting global
      /declare settaunt global
      /declare tankname global 
      /declare tempvar global
      /declare engagedistance global
      /declare assisthealth global
      /declare countdown global
      /declare MyXLoc global
      /declare MyYLoc global
      /declare followdistance global
      /declare followtarget global
      /declare followdistancechange global
      /declare followtargetchange global
      /declare setanchor global
      /declare anchoron global
      /declare anchoronchange global
      /alias /distance /varset ChangeDistance
      /alias /dist /varset ChangeDistance
      /alias /behind /varset staybehind 1
      /alias /front /varset staybehind 0
      /alias /taunt /varset settaunt 1
      /alias /evade /varset settaunt 2
      /alias /stop /varset settaunt 0
      /alias /tank /varset tankname
      /alias /engage /varset engagedistance
      /alias /killat /varset assisthealth
      /alias /anchor /varset followtargetchange
      /alias /anchordist /varset followdistancechange
      /alias /anchoron /varset anchoronchange 1
      /alias /anchoroff /varset anchoronchange 0
   :setupVarset 
      /varset MA_1 "@Param1" 
      /varset MA_2 "@Param2" 
      /varset MA_3 "@Param3" 
      /varset MA_SB "NULL" 
      /varset NinjaLewt @Param0 
      /varset taunting 0
      /varset TauntToggle NULL 
      :editDefaults 
      /varset MA_Timer_SB 60 
      /if $defined(Param0)!=TRUE /varset NinjaLewt 0 

      /if $defined(Param1)!=TRUE /varset MA_1 "Frenzy" 
      /if $defined(Param2)!=TRUE /varset MA_2 "NULL" 
      /if $defined(Param3)!=TRUE /varset MA_3 "NULL" 

   :setupCheck 
      /if ("@MA_1"=="bash" || "@MA_1"=="slam") { 
         /echo Auto @MA_1 every @MA_Timer_SB. 
         /varset MA_SB "@MA_1" 
         /varset MA_1 "NULL" 
         } 
      /if ("@MA_2"=="bash" || "@MA_2"=="slam") { 
         /echo Auto @MA_2 every @MA_Timer_SB 
         /varset MA_SB "@MA_2" 
         /varset MA_2 "NULL" 
         } 
      /if ("@MA_3"=="bash" || "@MA_3"=="slam") { 
         /echo Auto @MA_3 every @MA_Timer_SB 
         /varset MA_SB "@MA_1" 
         /varset MA_3 "NULL" 
         } 

   :start 
      /if "@MA_1"!="NULL" /echo Auto @MA_1 when availiable. 
      /if "@MA_2"!="NULL" /echo Auto @MA_2 when availiable. 
      /if "@MA_3"!="NULL" /echo Auto @MA_3 when availiable. 
      /if n @NinjaLewt==1 /echo Auto Ninja Loot 
      /echo @TauntToggle 
   :mainloop 
      /if $combat==TRUE /call Attack 
      /doevents
      /call CheckTriggers
      /call CheckAnchor
      /if @tankname!="NULL" /call AutoAssist
      /delay 1
   /goto :mainloop 
/endmacro 

Sub attack 
   /declare CasterMob local
   :attackCheck 
      /varset MobID $target(id) 

   :attackSetup 
      /if $target(type)!=NPC { 
         /attack off 
         /delay 5 
         /return 
         } 
      /if n $target(distance)>150 { 
         /attack off 
         /delay 5 
         /return 
         } 

   :attackPreFight 
      /call ClearReturn 
      /if n $char(pet)!=0 /pet attack 
      /varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee") 
      /if "@MeleeDistance"=="NOTFOUND" { 
     	 /echo Normal Sized mob, edit range if it's bad.
		 /ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" 10 
  	
    /delay 0 
    /varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee") 
    } 
    /varset ChangeDistance @MeleeDistance 

   :attackMeleeLoop 
      /doevents exp 
      /doevents RageOn 
      /doevents MobGate 
      /doevents StunON 
      /doevents ToggleTaunt 
      /doevents TauntThisRound 
      /call CheckTriggers
      /if @staybehind==1 /call getbehind
      /if "$char(class)"=="Berserker" /doability frenzy
      /if @MeleeDistance=="NULL" /echo MeleeDistance NULL
      }	
      /varset CasterMob 0
      /if "$char(class)"=="Berserker" {
	/if "$target(class)"=="Cleric" /varset CasterMob 1
        /if "$target(class)"=="Druid" /varset CasterMob 1
	/if "$target(class)"=="Enchanter" /varset CasterMob 1
	/if "$target(class)"=="Magician" /varset CasterMob 1
	/if "$target(class)"=="Necromancer" /varset CasterMob 1 
	/if (n $target(hp,pct)>20 || n @CasterMob==0) {
           /if n $char(endurance,cur)>500 {
              /if @catimer<=0 {
                 /varset catimer 120
                 /if n @taunting==1 {
                    /echo Taunting
                    /doability disarm	
                    /keypress hot2	   
	         } 
                 /if n @taunting==2 {
                    /if $target(hp,pct)>=50 {
                       /echo Evading
                       /keypress hot4
	            }
                 }
              }
           }
         }
      }
      /if n $target(id)!=@MobID /goto :attackend 
      /if $return==EndATK /goto :attackEnd 
      /if $combat!=TRUE /goto :attackend 
      /if $char(casting)!=TRUE /if n $char(feetwet)!=0 /face fast 
      /if $char(casting)!=TRUE /if n $char(feetwet)==0 /face fast nolook 
      /if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)>$calc(@MeleeDistance+5) {
       /call Move FORWARD
      }
|      /if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance {
|      /call Move FORWARD
|      }
      /if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=$calc(@MeleeDistance-5) {
       /call Move BACK
      }
         /if "@MA_SB"!="No" /if n "@Time_MA_SB"=="0" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance { 
          /varset Time_MA_SB @MA_Timer_SB 
         } 
|      /if "$char(class)"=="Shadow Knight" /if $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /goto :attackSpellsSK 
   /goto :attackMeleeLoop 

   :attackSpellsSK 
      /if n $char(gem,"Zevfeer's Bite")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Zevfeer's Bite" 
      /if n $char(gem,"Aura of Hate")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Aura of Hate" 
      /if n $char(gem,"Spear of Decay")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Decay" 
      /if n $char(gem,"Spear of Plague")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Plague" 
   /goto :attackMeleeLoop 

   :attackend 
      /if n @NinjaLewt!=0 /doevents exp 
      /varset MobID NULL 
      /if @TauntToggle!=NULL /varset TauntToggle NULL 
      /attack off 
      /pet backoff 
      /pet hold 
      /call Move FORWARD
/return 

Sub ClearReturn 
/return NULL 

Sub event_exp 
   /if n $target(hp,pct)>0 /return 
   /if n @NinjaLewt==0 /return EndATK 
   /if $target(type)!=CORPSE /target id @MobID 
   /loot 
   /call Move FORWARD
   /loot 
   /loot 
   /loot 
/return EndATK 

Sub event_RageOn 
   /if n $target(hp,pct)>15 /return 
   /if n $target(hp,pct)==0 /return 
   /if $target(id)==@MobID /if $char(casting)!=TRUE /call Move FORWARD
   /call ClearReturn 
   /echo Rage On 
   /attack off 
   /pet back off 
   /pet hold 
   /call ClearReturn 

   :waitRage 
      /doevents 
      /if $target(id)!=@MobID /return EndATK 
      /if $return==EndATK /return EndATK 
      /if $return==RageOFF /return 
/goto :waitRage 

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

Sub event_MobGate 
   /echo MOB GATED! 
   /attack off 
/return EndATK 

Sub event_StopGate 
   /keypress hot2
/return EndATK 

Sub event_Invited 
   /invite 
/return 

Sub event_StunON 
   /doevents flush StunOFF 
   /call ClearReturn 

   :LoopStunOFF 
      /doevents StunOFF 
      /if "$return"=="StunOFF" { 
         /call ClearReturn 
         /return 
         } 
/goto :LoopStunOFF 

Sub event_StunOFF 
/return StunOFF 

Sub event_ToggleTaunt 
      /if "@MA_1"=="taunt" { 
         /varset MA_1 "NULL" 
         /echo Will no longer taunt. 
         /return 
         } 
      /if "@MA_2"=="taunt" { 
         /varset MA_2 "NULL" 
         /echo Will no longer taunt. 
         /return 
         } 
      /if "@MA_3"=="taunt" { 
         /varset MA_3 "NULL" 
         /echo Will no longer taunt. 
         /return 
         } 
      /if "@MA_1"=="NULL" { 
         /varset MA_1 "taunt" 
         /echo Auto @MA_1 when availiable. 
         /return 
         } 
      /if "@MA_2"=="NULL" { 
         /varset MA_2 "taunt" 
         /echo Auto @MA_2 when availiable. 
         /return 
         } 
      /if "@MA_3"=="NULL" { 
         /varset MA_3 "taunt" 
         /echo Auto @MA_3 when availiable. 
         /return 
         } 
/return 

Sub getbehind
   /declare TtoM local
   /declare relative_heading local
   /varcalc TtoM 180+$target(headingto)
   /varcalc relative_heading $abs(@TtoM-$target(heading))
|   /echo @relative_heading
   /if n @relative_heading<130 /call Move STRAFE_RIGHT
   /if n @relative_heading>200 /call Move STRAFE_LEFT
|   /face fast
:noneed 
/return 

sub Move(direction)
   /keypress @direction hold
   /delay 1
   /keypress @direction
/return

sub CheckTriggers
   /if n @ChangeDistance!=@MeleeDistance {
      	/varset MeleeDistance @ChangeDistance
        /echo Changed Melee Distance to @ChangeDistance
        /ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" @MeleeDistance
   }
   /if n @settaunt!=@taunting {
        /varset taunting @settaunt
        /if n @taunting==1 /echo Taunt turned on
        /if n @taunting==2 /echo Evade turned on
        /if n @taunting==0 /echo Taunt and Evade both off
   }
   /if n @followdistance!=@followdistancechange {
        /varset followdistance @followdistancechange
        /echo Follow distance set to @followdistance
   }
   /if "@followtarget"!="@followtargetchange" {
        /varset followtarget @followtargetchange
        /echo Now using @followtarget as an anchor
   }
   /if n @anchoron!=@anchoronchange {
        /varset anchoron @anchoronchange
        /if n @anchoron==0 /echo Anchor turned off, roam free.
        /if n @anchoron==1 /echo Anchor on, keeping with @followtarget.
   }
/return

sub AutoAssist
    /assist @tankname 
    /delay 5 
    /if ("$target()"=="FALSE" || "$target(type)"!="NPC" || "$target(name,clean)"=="$char(name)") { 
        /return
    } 
    /if n @tempvar!="$target(hp,pct)" { 
        /echo $target(name,clean) targeted at $target(hp,pct)% at distance $target(distance). 
    } 
    /varset tempvar "$target(hp,pct)" 
    /if n "$target(hp,pct)"<=@assisthealth { 
        /if (n "$target(distance,nopredict)"<@engagedistance || n @engagedistance<=0) { 
            /if n "$target(pet)==0" {
            /attack on
            /call Attack 
            }
        } 
    }   
/return

Sub CheckAnchor 
    /varset setanchor 2
    /if n @setanchor==1 /if n $distance(@AnchorX,@AnchorY)>@followdistance) /call MoveToAnchor 
    /if n @anchoron==1 { 
        /if n $spawn($searchspawn(@followtarget,pc),distance)>@followdistance /call MoveTo
    }      
/return 

Sub MoveTo 
    /varset countdown 0 
    /varset MyXLoc $char(x) 
    /varset MyYLoc $char(y) 
|    /target @followtarget
    /echo "Moving to Target: @followtarget." 

:fastmoveloop 
   /delay 1 
    
    /face fast $spawn($searchspawn(@followtarget,pc),name)

    /if n $spawn($searchspawn(@followtarget,pc),distance)>@followdistance { 
        /keypress forward 
        /keypress forward hold 
    } 
    
    /if n $spawn($searchspawn(@followtarget,pc),distance)<=@followdistance { 
        /keypress forward 
        /return 
    } 
    /if n $target(distance)=>$calc(@followdistance*3) /varadd countdown 1 
    /goto :fastmoveloop 
/return 


Sub MoveToAnchor 
    /varset MyXLoc $char(x) 
    /varset MyYLoc $char(y) 
    /varset countdown 0 

    /echo "Moving to Anchor at Loc: @AnchorX,@AnchorY." 

:AnchorMoveLoop  
    /delay 1 

    /face nolook loc @AnchorX,@AnchorY 
    
    /if n $distance(@AnchorX,@AnchorY)>@followdistance { 
          /keypress forward 
          /keypress forward hold 
    } else { 
          /keypress forward 
        /return 
    } 

    /if n @countdown>=3 { 
        /call Detectobst 
        /varset countdown 0 
    } 
    
    /varadd countdown 1 
    /goto :AnchorMoveLoop 
/return 


apollo5145
orc pawn
orc pawn
Posts: 26
Joined: Wed Feb 25, 2004 8:14 pm

Post by apollo5145 » Sun Apr 18, 2004 9:52 pm

Forgot to mention you can modify yer melee range with /dist and it saves to the ini.

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Wed Apr 21, 2004 7:46 pm

Getting

Code: Select all

Cleared the following: Timers Vars Arrays
[color=red]Ending macro: Failed to parse /if command[/color]
stick.mac@91 (main): /if $defined(Param0)!=TRUE /varset NinjaLewt $ini("PCini","$char(name)","NinjaLewt") 
Cleared the following: Timers Arrays
The current macro has ended.
[color=red]Usage: /if <(conditions)> <command>[/color]
When I try to run it with latest zip, any ideas? tried changing it to /newif, did nothing. Im no coding expert unfortunately.

Dursum
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Apr 25, 2004 12:57 pm

Post by Dursum » Sun Apr 25, 2004 1:28 pm

I have more or less converted the stick.mac from m0nk. I haven't tested all the stuff yet but it should get close. Let me know what bugs you find.

I am working on a fix for slam so that it will check for the Ability being ready but haven't gotten working yet. Also Taunt is broken so I commented it for the time being.


04/27/2004 -
Added back in some of the missing stuff. This is still a work in progress. The AltTimer stuff is working in that it detects when slam is ready to be used but the doability isn't working quite right.

Also, added back in the stick-npc.ini. It works again.

Code: Select all

|===========|
| 02.25.04a |
|___________|
|           |
| stick.mac |
|  by m0nk  |
|___________|
|
| -Syntax = /mac stick "NinjaLoot (0 or 1)" "MeleeAbility_1" "MeleeAbility_2" "MeleeAbility_3"
| example = /mac stick 0 "bash" (will not loot and only bash)
| example = /mac stick 1 "Flying Kick" "Disarm" (will loot, Flying Kick ,disarm)
| example = /mac stick (will do what the defaults are set to in the stick-pc.ini file)
|
#define MOBini "stick-npc.ini"
#define PCini "stick-pc.ini
|#include spellcast.inc

#event EXP "experience!!"
#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 TauntThisRound "to ignore others and attack you!"
#event ToggleTaunt "[MQ2] tt"
#event ToggleNinja "[MQ2] nl"

Sub main
   :setupDeclare
      /zapvars
      /declare MA_SB global
      /declare MobID global
      /declare CharX global
      /declare CharY global
      /declare Time_MA_SB timer
      /declare NinjaLewt global
      /declare TauntToggle global
      /declare MA_Timer_SB global
      |/declare Attacks local array
      /declare MeleeAttack_1 global
      /declare MeleeAttack_2 global
      /declare MeleeAttack_3 global
      /declare MeleeDistance global
      /declare DefaultMeleeDistance global
      /declare i local

   :setupVarset
	/echo Setting up Vars
      /varset MA_SB "NULL"
      |/varset Attack(1) "@Param1"
      /varset MeleeAttack_1 "@Param1"
      /varset MeleeAttack_2 "@Param2"
      /varset MeleeAttack_3 "@Param3"
      /varset MA_Timer_SB 60
      /varset TauntToggle NULL
      /varset NinjaLewt "@Param0"

   :setPCiniOther
	/echo Setting up Ini for ${Me.Name}

	| Read in and/or set up the NinjaLewt variable
	/newif (!${Defined[Param0]}) /varset NinjaLewt ${Ini[PCini,${Me.Name},NinjaLewt,0]}
	/ini PCini ${Me.Name} NinjaLewt @NinjaLewt
	|/echo NinjaLewt: @NinjaLewt

	| Read in and/or set up the MeleeDistance variable
	/varset MeleeDistance ${Ini[PCini,${Me.Name},DefaultMeleeDistance,13]}
	/ini PCini ${Me.Name} DefaultMeleeDistance @MeleeDistance
	|/echo DefaultMeleeDistance: @MeleeDistance

	| Read in and/or set up the MeleeAttack variables
	/for i 1 to 3
		/newif (!${Defined[Param@i]}) /varset MeleeAttack_@i ${Ini[PCini,${Me.Name},MeleeAttack_@i,NULL]}
		/ini PCini ${Me.Name} MeleeAttack_@i @MeleeAttack_@i
		|/echo Created MeleeAttack_@i: @MeleeAttack_@i
	/next i

   :setPCiniBuffs

   :setupSBCheck
	| Trying out the new Ability Ready stuff and ${Me.AltTimerReady}
	|/for i 1 to 3
	|	|/echo Melee: ${String[@MeleeAttack_@i].Equal[slam]}
	| 	/newif (${String[@MeleeAttack_@i].Equal[bash]} || ${String[@MeleeAttack_@i].Equal[slam]}) {
        | 		/echo Auto @MeleeAttack_@i every @MA_Timer_SB.
        | 		/varset MA_SB "@MeleeAttack_@i"
        | 		/varset MeleeAttack_@i "NULL"
	|	}
	|/next i

   :start
	/newif (@NinjaLewt==1) /echo Auto Ninja Loot
	/for i 1 to 3
		/newif (${String[@MeleeAttack_@i].NotEqual[NULL]}) /echo Auto @MeleeAttack_@i when availiable.
	/next i

   :mainloop
      /newif (${Me.Combat}) /call Attack
      /doevents
   /goto :mainloop
/endmacro

Sub Attack
	/declare i local
   :attackCheck
      /varset MobID ${Target.ID}

   :attackSetup
      /newif (${Target.Type.NotEqual[NPC]} || !${Target.ID}) {
         /attack off
         /delay 5
         /return
         }
      /newif (${Target.Distance}>150) {
         /attack off
         /delay 5
         /return
         }

   :attackPreFight
      /call ClearReturn
      /newif (${Me.Pet.ID}) /pet attack
      /varset MeleeDistance ${Ini[MOBini,${Zone.Name},${Target.CleanName}.DistanceMelee,@MeleeDistance]}
      /ini MOBini ${Zone.Name} ${Target.CleanName}.DistanceMelee @MeleeDistance

   :attackMeleeLoop
	/doevents exp
	/doevents RageOn
	/doevents MobGate
	/doevents StunON
	/doevents ToggleTaunt
	/doevents TauntThisRound
	/newif (${Target.ID}!=@MobID) /goto :attackend
	|/docommand ${If[${Macro.Return.Equal[EndATK],/goto :attackEnd
	/newif (${Macro.Return.Equal[EndATK]}) /goto :attackEnd
	/newif (!${Me.Combat}) /goto :attackend
	/newif (!${Me.Casting.ID} && ${Me.FeetWet}) /face fast
	/newif (!${Me.Casting.ID} && !${Me.FeetWet}) /face fast nolook
	/newif (${Target.ID}==@MobID && !${Me.Casting.ID}) {
		/newif (${Target.Distance}>@MeleeDistance) /keypress FORWARD HOLD
		/newif (${Target.Distance}<=@MeleeDistance) /keypress FORWARD
		/newif (${Target.Distance}<=${Math.Calc[@MeleeDistance-5]}) /keypress BACK HOLD
	}
	/for i 1 to 3
		/newif (${String[@MeleeAttack_@i].NotEqual[NULL]} && !${Me.Casting.ID} && ${Target.Distance}<=@MeleeDistance) {
			|/echo AltTimer: ${Me.AltTimerReady} will try a doability @MeleeAttack_@i Ability0: ${Me.Ability[0]}
			/newif (${String[@MeleeAttack_@i].Equal[Slam]} && ${Me.AltTimerReady}) /doability Regeneration
			/newif (${String[@MeleeAttack_@i].NotEqual[Slam]} && ${Me.AbilityReady[@MeleeAttack_@i]}) /doability @MeleeAttack_@i
		}
	/next i
        /newif (${String[@TauntToggle].NotEqual[NULL]} && !${Me.Casting.ID} && ${Target.Distance}<=@MeleeDistance && ${Me.AbilityReady[Taunt]}) /doability Taunt
	|/newif (${String[@MA_SB].NotEqual[No]} && @Time_MA_SB==0 && !${Me.Casting.ID} && ${Target.Distance}<=@MeleeDistance) {
	|	/doability @MA_SB
	|	/varset Time_MA_SB @MA_Timer_SB
	|}
	/newif (${Target.ID}==@MobID && !${Me.Casting.ID} && ${Target.Distance}<=@MeleeDistance) /goto :attackSpells
    |${Class.CanCast} && 
   /goto :attackMeleeLoop

   :attackSpells
   	|/echo Mana: ${Me.PctMana} Target: ${Target.PctHPs}
	|/newif (${Me.Gem[Frost Rift]} && ${Me.PctMana}>60 && ${Target.PctHPs}<90) /call Cast "Frost Rift"
      |/newif n $char(gem,"Aura of Hate")>0 /newif n $char(mana,pct)>20 /newif n $target(hp,pct)<90 /call cast "Aura of Hate"
      |/newif n $char(gem,"Spear of Decay")>0 /newif n $char(mana,pct)>50 /newif n $target(hp,pct)<90 /call cast "Spear of Decay"
      |/newif n $char(gem,"Spear of Plague")>0 /newif n $char(mana,pct)>50 /newif n $target(hp,pct)<90 /call cast "Spear of Plague"
      |/newif n $char(hp,pct)<90 /newif n $char(buff,"Bond of Death Recourse")==0 /newif n $char(gem,"Bond of Death")>0 /newif n $char(mana,pct)>20 /newif n $target(hp,pct)<90 /call cast "Bond of Death"
   /goto :attackMeleeLoop

   :attackend
      /newif (@NinjaLewt) /doevents exp
      /varset MobID NULL
      /newif (@TauntToggle) /varset TauntToggle NULL
      /attack off
      /pet backoff
      /pet hold
      /keypress FORWARD
/return

Sub ClearReturn
/return NULL

Sub event_exp
   /newif (${Target.PctHPs}>0) /return
   /newif (@NinjaLewt==0) /return EndATK
   |/echo MobID: @MobID
   /delay 1
   |/newif (${Target.Type.NotEqual[CORPSE]}) /target id @MobID
   /target id @MobID
   /loot
   /keypress FORWARD
   /loot
   /loot
   /loot
/return EndATK

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

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

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

Sub event_MobGate
   /newif (${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
      /newif (${Macro.Return.Equal[StunOFF]}) {
         /call ClearReturn
         /return
         }
/goto :LoopStunOFF

Sub event_StunOFF
/return StunOFF

Sub event_TauntThisRound
   /newif (${String[@TauntToggle].NotEqual[Yes]} && ${String[@MeleeAttack_1].NotEqual[Taunt]} && ${String[@MeleeAttack_2].NotEqual[Taunt]} && ${String[@MeleeAttack_3].NotEqual[Taunt]}) {
      /echo Taunting this round against %t
      /varset TauntToggle Yes
   }
/return

Sub event_ToggleTaunt
	/declare i local
	/for i 1 to 3
	      /newif (${String[@MeleeAttack_@i].Equal[taunt]}) {
	         /varset MeleeAttack_@i "NULL"
	         /echo Will no longer taunt.
	         /return
	      }
	      /newif (${String[@MeleeAttack_@i].Equal[NULL]}) {
	         /varset MeleeAttack_@i taunt
	         /echo Auto @MeleeAttack_@i when availiable.
	         /return
	      }
	/next i
/return

Sub event_ToggleNinja
      /newif (${NinjaLewt}==0) {
         /varset NinjaLewt 1
         /echo NinjaLewt On
         /return
      }
      /newif (${NinjaLewt}==1) {
         /varset NinjaLewt 0
         /echo NinjaLewt Off
      }
/return
Last edited by Dursum on Wed Apr 28, 2004 1:13 am, edited 1 time in total.