Ok I have been working and trying to update a pull mac that i got from the mq2 site years ago. I made some major changes to this make, but I would like to recive feedback on this mac as this is the first mac that i have changed to fit my group. Most of the code is hardcoded in so plz let me know what you think of this.
I did make sure to credit the people that made this mac. If I did not give credit to you sorry and let me know i will add it in.
I only added and deleted stuff and redid some of the code.
I run this mac with a 85 war, 85 cleric, 82 rogue, 83 Wiz, and 85 Enchanter.
Code:
| Pullit Macro
| Pullit.mac
| Author : robdawg :Ripped by Jdelpheki :Ripped Again By hakcenter :Ripped again by cactusdan
| Version : v4.1 2010-09-10 12:05pm PST
| Useage : /macro pullit
| Description : This macro will run your character around Pulling any mobs.
| This is definitely a work in progress and I am sure
| someone can think of plenty of upgrades for this.
| : Ripped section Jdelpheki
| Modified for pull to area where Macro is started. I have been using this
| 2 level 45's Cleric Running genbot and Warrior running Pull2. Ran for 4 hours
| Max with one cleric death. Needs Throwing weapon or arch support too
| Needs Genbot to announce its getting hit or get a new cleric script
| : Ripped section hakcenter
| Pulls Any Mobs within radius (regardless of level)
| No Mob Array Required
| Looting Added
| *Looting -stuck on corpse bug fixed-
| Loot Table Array Support
| *Puller runs to pull spot after mob looting is finished
| *Removed Target Fail Counters
| *Checks for mobs every 30seconds, 1second 50radius checks
| *Reformated
| *On zoning(death whatever), quits everquest
| *Added more checks
|
| 2010-09-10
|
| Removed all buff areas as I use melee for my buffs
| Added I did take from other macs to add the following I stole from Warrior with Auto Pull by Nils v1.0 Jan 24/08 and another pull mac that I got from mq2 website
| gmcheck
| HP check
| Endurance check
| Make Arrows
| Changed the pullsub also along with adding disc for Named mobs and add in fort if health is below 20
| All the changes I made are for a war
| I also added in some hardcoded bcaa commands for when mac zones and when gm zones in
| Thanks for help with the disc part of the code unity0110 and blujahz (eventhough I did not use yours) also to devestator for HP snippet and to JimJohnson for making look at the code and put it in the right spot to call the hp and endurance check.
|
| 2004-12-11
|
| Added some squelching, always looking for mobs within range, 5 distance intervals
| Jacked Item Coding from Rogue Helper
| Fixed UI locking up
| Fixed Long Buff Casts
| Added Disarm to the Special Combat abilities
|
| 2004-12-16
| Revamped Close mob checking to 0.1second 100radius squelched
| Revamped Item casting to check for local mobs during.. and interupt if mob is near 100radius
| Removed mass escaping.. cause its retarded
| Fixed cool errors when accidently pushing esc while on a mob
| Fixed cool errors when accidently pushing esc while pulling a mob
| Added 1second before first item cast, incase item is worn... you get interupted cause its too fast
|
|------------------------------------------------------------------------------------
#turbo 10
#event Slain "#*# slain#*#"
#event Zoned "LOADING, PLEASE WAIT..."
#event GotHit "#*#hits YOU for#*#"
#event GotHit "#*#slashes YOU for#*#"
#event GotHit "#*#crushes YOU for#*#"
#event GotHit "#*#bashes YOU for#*#"
#event GotHit "#*#kicks YOU for#*#"
#event GotHit "#*#smashes YOU for#*#"
#event GotHit "#*#mauls YOU for#*#"
#event GotHit "#*#gores YOU for#*#"
#event GotHit "#*#pierces YOU for#*#"
#event GotHit "#*#kicks YOU for#*#"
#event GotHit "#*#bashes YOU for#*#"
Sub Main
|------------------------------------------------------------
|How far would you like to target a mob?
|------------------------------------------------------------
/declare RV_MaxRadius int outer 200
|------------------------------------------------------------
|How far is the fast movement range?
|------------------------------------------------------------
/declare RV_FastRange int outer 10
|------------------------------------------------------------
|How far is the maximum combat range?
|------------------------------------------------------------
/declare RV_RangeMax int outer 30
|------------------------------------------------------------
|How far is the minimum combat range?
|------------------------------------------------------------
/declare RV_RangeMin int outer 8
|------------------------------------------------------------
|What is the minimum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MinZRange int outer -1000
|------------------------------------------------------------
|What is the maximum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MaxZRange int outer 1000
|------------------------------------------------------------
|Loot Array Information.
|------------------------------------------------------------
/call ReadINI PullLoot.ini "${Zone.Name}" Loot
/if (!${Defined[RV_LootArray]}) {
/echo No Loot Array Created...
}
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare RV_MyTargetID int outer 0
/declare RV_MyTargetName string outer
/declare RV_MyTargetDead int outer 0
/declare RV_InvalidTargetID int outer 0
/declare RV_HasTarget int outer 0
/declare RV_RandomWait int outer 0
/declare RV_LootSlot int outer 0
/declare RV_CheckLook int outer 0
/declare RV_Fighting int outer 0
/declare RV_TargetDead int outer 0
/declare RV_MyXLOC int outer 0
/declare RV_MyYLOC int outer 0
/declare RV_ObstacleCount int outer 0
/declare RV_hitcount int outer 0
/declare RV_healcheck int outer 0
/declare RT_MyXLOC int outer ${Me.X}
/declare RT_MyyLOC int outer ${Me.Y}
/declare RT_Engaged outer FALSE
/declare lastevent string outer None
/declare CheckStats int outer 0
/varset CheckStats 1
:Start
/doevent
/hidecorpse looted
/call GMCheck
/call GetTarget
/if (${RV_HasTarget}) /call Pull
/if (${RV_HasTarget}) /call CombatSub
/call ResetSub
/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
/goto :Start
/return
|--------------------------------------------------------------------------------
|SUB: Reading from an INI File
|--------------------------------------------------------------------------------
Sub ReadINI(FileName,Loot,ArrayType)
/echo Attempting to Read Information from ${FileName}...
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName}]}
/if (${Ini[${FileName},Loot,-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1s
/return
}
:CounterLoop
/if (${String[${Ini[${FileName},Loot,${ArrayType}${nValues}]}].Equal[null]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop
:MakeArray
/if (!${nValues}) /return
/if (${FileName.Equal["PullLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare RV_LootArray[${nValues}] string outer
/declare RV_LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["PullLoot.ini"]}) {
/varset RV_LootArray[${nArray}] ${Ini[${FileName},Loot,${ArrayType}${nArray}]}
/varset RV_LootStats[${nArray}] 0
}
/next nArray
/echo Information Read Successfully from ${FileName}...
/delay 1s
/return
|--------------------------------------------------------------------------------
|SUB: GM Check
|--------------------------------------------------------------------------------
Sub GMCheck
/if (${Spawn[gm].ID}) {
/beep
/beep
/beep
/echo GM has entered the zone!
/echo FUCK HIM but ending the macro...
/keypress forward
/keypress back
/bcaa //melee plugin=0
/bcaa //camp desktop
/endmacro
}
/return
|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub GetTarget
/doevent
/declare SpawnTimer int local
/declare RV_CurrentRadius int local
/declare RV_TargetSub int local
/echo Looking for Close Range Mobs
:Acquire
/doevent
/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 5
/squelch /target radius ${RV_CurrentRadius} npc
/varset RV_MyTargetID ${Target.ID}
/varset RV_MyTargetDead 0
/if (${Target.ID}) {
/if (${Int[${Target.Z}]}<${RV_MinZRange}) {
/echo Mob is BELOW Min Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}>${RV_MaxZRange}) {
/echo Mob is ABOVE Max Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/varset RV_HasTarget 1
/varset RV_MyTargetName ${Target.Name}
/varset RT_Engaged TRUE
/echo Acquired << ${Target.CleanName} >> at range << ${Int[${Target.Distance}]} >>
/if (${Int[${Target.Distance}]} < 150) /call pull
/return
}
/if (${CheckStats}>0) {
/call GMCheck
/echo Checking Stats
/echo Checking arrows. I Have ${Melee.Ammunition} arrows right now.
/call MakeArrows
/echo checking HPs ${Me.PctHPs}%
/call HpCheck
/echo checking Endurance ${Me.PctEndurance}%
/call EndCheck
/echo Aquiring Long Range Mobs
}
/varset CheckStats 0
/next RV_CurrentRadius
/goto :Acquire
/return
|--------------------------------------------------------------------------------
|SUB: Pull
|--------------------------------------------------------------------------------
Sub Pull
/doevent
/echo Pulling Mob
/call GMCheck
/declare TargDist float local
:PullLoop
/if (!${RV_HasTarget}) /return
/if (${RV_HasTarget} && !${Target.LineOfSight}) {
/face fast
/call MoveToMob
/attack on
/if (${Me.CombatAbilityReady[Maelstron Blade Rk. II]} && ${Target.Distance}<10) /disc Maelstron Blade Rk. II
/if (${Target.PctHPs}==100) /goto :PullLoop
/Echo ${Target.CleanName} is not in line of sight Going to run it down and bring it back
} else /if (${RV_HasTarget} && ${Int[${Target.Distance}]} < 150 && ${Target.LineOfSight}) {
/face fast
/Ranged
/if (${Int[${Target.Distance}]}<30) /attack on
/if (${Int[${Target.Distance}]}<30) /Stick on
/if (${Target.PctHPs}==100) /goto :PullLoop
/echo within 150 range pulling
} else /if (${RV_HasTarget} && ${Int[${Target.Distance}]} > 151) {
/face fast
/if (${Me.CombatAbilityReady[Sneer Rk. II]}) /disc Sneer Rk. II
/call MoveToMob
/attack on
/if (${Target.PctHPs}==100) /goto :PullLoop
/echo outside of 150 range puling Going to run it down and bring it back
}
/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
:Engage
/varset TargDist ${Math.Distance[${Target.Y},${Target.X},0:${Me.Y},${Me.X},0]}
/if ( ${TargDist}<30 ) /return
/delay 1s
/goto :Engage
/return
|--------------------------------------------------------------------------------
|SUB: Got hit
|--------------------------------------------------------------------------------
Sub Event_GotHit
/if (!${RT_Engaged}) {
/doevent
/face fast
/if (${Math.Distance[${RT_MyyLOC},${RT_MyXLOC}]}>30) {
/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
} else /if (${RT_Engaged} && ${Target.ID}){
/call CombatSub
/if (${Target.ID}) {
/varset RT_Engaged TRUE
/call CombatSub
}
}
/return
|--------------------------------------------------------------------------------
|SUB: Move to Mob
|--------------------------------------------------------------------------------
Sub MoveToMob
/doevent
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/varset RV_ObstacleCount 0
:MovementLoop
/doevent
/if (!${Target.ID}) /return
/face fast
/varcalc RV_ObstacleCount ${RV_ObstacleCount}+1
/if (${Int[${Target.Distance}]}>${RV_FastRange}) /keypress forward hold
/if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) /keypress forward
/if (${Int[${Target.Distance}]}<${RV_RangeMin}) /keypress back
/if (${RV_ObstacleCount}>=15) {
/call CheckObstacle
/goto :Movementloop
}
/if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop
/return
|--------------------------------------------------------------------------------
|SUB: Move To Location
|--------------------------------------------------------------------------------
Sub MoveToLoc(MoveToY, MoveToX)
/doevent
/declare running int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/declare distanceTimer timer 15
/varset running 0
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceModifier 1
/echo Moving to Location: ${MoveToY}, ${MoveToX}.
/echo Distance: ${distanceBefore}
:moveToLocation
/doevent
/face fast nolook loc ${MoveToY},${MoveToX}
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/call HitObstacle
}
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) {
/varset running 0
/keypress forward
}
}
/goto :moveToLocation
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle Check
|--------------------------------------------------------------------------------
Sub CheckObstacle
/doevent
/if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/varset RV_ObstacleCount 0
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle Avoidance
|--------------------------------------------------------------------------------
Sub HitObstacle
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay 3
/keypress back
/if (${Math.Rand[2]}) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 5
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub CombatSub
/doevent
/varset RV_Fighting 1
/varset RV_TargetDead 0
/echo Attacking Mob NOW! Kill this bitch!!!!
/face fast
:CombatLoop
/if (!${Me.Combat}) /attack on
/if (!${Target.ID}) /return
/call SpecialIT
/if (!${RV_TargetDead}) /goto :CombatLoop
/doevent
/return
|--------------------------------------------------------------------------------
|SUB: Special Combat
|--------------------------------------------------------------------------------
Sub SpecialIt
/doevent
/declare TempID int inner 0
/if (${Target.Named} && ${Me.CombatAbilityReady[Fellstrike Discipline]} && !${Melee.DiscID}) {
/disc Fellstrike Discipline
}
/if (${Target.Named} && ${Me.CombatAbilityReady[Brutal Onslaught discipline Rk. II]} && !${Melee.DiscID}) {
/disc Brutal Onslaught discipline Rk. II
}
/if (${Me.PctHPs} < 20 && ${Me.CombatAbilityReady[Fortitude discipline]}) {
/disc Fortitude discipline
/echo about dead hitting Fort, heal me
/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
/bca cast epic
}
/return
|--------------------------------------------------------------------------------
|SUB: Slain
|--------------------------------------------------------------------------------
Sub Event_Slain
/varset RV_TargetDead 1
/varset RV_Fighting 0
/attack off
/target clear
/keypress forward
/keypress back
/squelch /target radius 30 corpse
/face fast
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
/Call ResetSub
/return
|--------------------------------------------------------------------------------
|SUB: Make Arrows
|--------------------------------------------------------------------------------
Sub MakeArrows
/if (${Me.State.Equal[Hover]} || ${Me.State.Equal[Dead]}) /return
/if (!${FindItem[Bloody Ancille's Pouch].ID} || !${FindItem[Purified Crystal].ID} || ${FindItemCount[Hunter's Barbs]}<2) {
/echo You either lost your Bloody Ancille's Pouch or you have run out of Purified Crystal's. Turning Make Arrows off!!!
/call Event_Zoned
/return
}
/if (${FindItemCount[Hunter's Barbs]}<2) {
/echo Holding pulls to make some arrows!!! I Have ${Melee.Ammunition} arrows right now.
:Make_More_Arrows
/if (${FindItem[Bloody Ancille's Pouch].ID} && ${Me.FreeInventory} && ${FindItem[Purified Crystal].ID}) {
/Casting "Bloody Ancille's Pouch"
/delay 6s !${Me.Casting.ID}
/if (${Cursor.ID}) /autoinventory
/delay 1s !${Cursor.ID}
/echo I Have ${Melee.Ammunition} arrows right now.
}
/if (${FindItemCount[Hunter's Barbs]}>180 || !${FindItem[Purified Crystal].ID} || !${Me.FreeInventory}) /return
/goto :Make_More_Arrows
}
/return
|--------------------------------------------------------------------------------
|SUB: HP Check
|--------------------------------------------------------------------------------
Sub hpCheck(int sitHPs, int standHPs)
/if (!${Defined[sitHPs]}) /declare sitHPs int local 90
/if (!${Defined[standHPs]}) /declare standHPs int local 70
:sitLoop
/if (${Me.PctHPs} < ${sitHPs}) {
/if (!${Me.Sitting}) /sit on
/delay 1s
/doevent
} else /if (${Me.PctHPs} > ${standHPs}) {
/echo All healed up. Let's rock! Now at ${Me.PctHPs}%
/stand
/return
}
/goto :sitLoop
/return
|--------------------------------------------------------------------------------
|SUB: Endurance Check
|--------------------------------------------------------------------------------
Sub EndCheck(int sitEnd, int standEnd)
/if (!${Defined[sitEnd]}) /declare sitEnd int local 90
/if (!${Defined[standEnd]}) /declare standEnd int local 40
:sitLoopend
/if (${Me.PctEndurance} < ${sitEnd}) {
/if (!${Me.Sitting}) /sit on
/if (!${Melee.DiscID} && ${Me.CombatAbilityReady[Fourth Wind Rk. II]} && ${Me.PctEndurance}<70 ) /disc Fourth Wind Rk. II
/delay 1s
/doevent
} else /if (${Me.PctEndurance} > ${standEnd}) {
/echo All Enduranced up. Let's rock! Now at ${Me.PctEndurance}%
/stand
/return
}
/goto :sitLoopend
/return
|--------------------------------------------------------------------------------
|SUB: Zoned
|--------------------------------------------------------------------------------
Sub Event_Zoned
/echo Zoned camping everyone out
/delay 60s
/bcaa //melee plugin=0
/bcaa //casting "group invisibility"
/bcaa //camp desktop
/endmacro
|--------------------------------------------------------------------------------
|SUB: Looting
|--------------------------------------------------------------------------------
Sub LootMob
/doevent
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/keypress forward
/keypress back
/fastdrop on
/lootn never
/Echo Looting
/loot
/varset CheckStats 1
/delay 1s
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/notify LootWnd DoneButton leftmouseup
/return
} else {
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/nomodkey /shift /itemnotify loot${LootSlot} leftmouseup
/delay 1s
/if (${RV_LootAllItems}) {
/echo Keeping a ${Cursor.Name}... WOOT! Money in the bank
/autoinventory
/delay 1s
} else {
/for LootCheck 1 to ${RV_LootArray.Size}
/if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1
/autoinventory
/delay 1s
}
/next LootCheck
}
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}... Its a pice of Shit any way
/destroy
/delay 1s
}
/next LootSlot
/notify LootWnd DoneButton leftmouseup
}
/keypress esc
/return
|--------------------------------------------------------------------------------
|SUB: Reset
|--------------------------------------------------------------------------------
Sub ResetSub
/doevent
/varset RV_HasTarget 0
/varset RV_TargetDead 0
/varset RV_Fighting 0
/return
I did make sure to credit the people that made this mac. If I did not give credit to you sorry and let me know i will add it in.
I only added and deleted stuff and redid some of the code.
I run this mac with a 85 war, 85 cleric, 82 rogue, 83 Wiz, and 85 Enchanter.
Attachments
Last edited: