Moderator: MacroQuest Developers


Code: Select all
Sub Haste
/declare t string local
/varset t ${Me.Buff["Celerity"]}
/if ( ${t.Equal[NULL]} ) {
/if ( !${Target.ID}!=${Me.ID} ) {
/target ${Me.Name}
}
/call Cast "tunic of the khati sha" item
}
/return


I'm having a similar problem. It does what he says once in awhile, 99% of the time the macro starts up just fine, even finds a target, but then just turns and starts running non-stop. The spam I get is...Prostetic Head wrote:I cannot get this to work..... I set my targets... say im in griegs. /macro nbh a shrouded willsapper. All it does is repeatidly target my pet, and keeps trying to find new target.
I am in a room w/ about 8 of these. I've messed w/ the distances, just cant seem to figure it out
Code: Select all
|TODO:
|-- Wishlist: Create a dryad hunter (jaggedpine forest)?
| Stuckfix - dont do when to many mobs nearby
| Pathnodes? Add points on the ground that we move to. That way we get better pathing.
| stuckfixhelp nodes? - on stuckfix, move to closest node and turn towards original target/spot
| put the nodes at intersections
| Save SELECT_SPAWNS and PATHNODES. LOAD them as well.
| Backing off for pet --> no obstacle check... neverending backing off
|-- Fixed: Stuckness on strafe. We now stop trying to strafe if something is blocking us.
|-- Fixed: (pull to homepoint)Removed a check that often resulted in casting the pull spell several times. Added new check "Target not moving AND outside attack range" -> try again.
|-- Fixed: (pull to homepoint)Halved the distance to wait for mobs on pulling. Should prevent outrunning them.
|-- Fixed: The macro should tolerate missing arrayitems (spelllists). It will display a warning on DEBUG_2 instead of neverending loop (newtarget, done downtimework)
|-- Fixed: Strafing around the target should work more properly now.
|-- Fixed: When pulling, we check if the target is out of sight or out of range. If so, add to ignore list.
|-- Changed: SEND_PET_BEFORE_SLOW. If False, you will cast slow, then WAIT for the mob. True you will send pet, cast slow, run into battle.
|-- Added: PULL_TARGET_ANGLE. If PULL_TO_HOMEPOINT is true, this one can be set to what degree we wish to pull from. 90 degrees = straight from in front of us and 45 degrees to each side. 360degrees = everyting. Can be usefull when pulling hallways, or when we want to ignore stuff behind us...
|-- New feature added: - "Select spawnpoints to hunt".
|-- You can now call the macro with this:
|-- "/macro nbh SELECT_SPAWNS"
|-- Then add spawnpoints by targetting each spawn at the spawnpoints and writing "/echo SPAWN ${Target.ID}".
|-- When done selecting the spawn(points) write "/echo DONE". You will then start hunting only these spawn(points).
|-- You can also add more points during the running macro ( just do the /echo SPAWN ${Target.ID} ).
|-- Add a hotkey for the spawn adding as it's easier than to write it each time.
|-- (Go invis, start the macro. Add all the spawns, run back to startup point, issue DONE)
| Natural Beastlord Hunter Macro
| nbh.mac
| Author : wolf5
| Version : v1.2.0 - 2004-07-13
| Useage : /macro nbh target
| /macro nbh target1|target2|target3|...|targetn
| Description : This macro will run your character around killing any mobs
| matching your targets.
| Then it will loot either all items or none.
| Features:
|
|- Pet allways up, and no further than a defined distance away before being
| autosummoned
|
|- Keep pet buffed (noncombat)
|
|- Keep myself buffed (noncombat)
|
|- During combat, keep myself buffed with critical spells (SoW)låæcghbnhi
|
|- Target from targetlist within a given radius (default 499) - rumor has it
| targetting above 500 gets logged by SoE ? But search for mobs outside
| this range if chosen.
|
|- Run towards target using a selfwritten /face to allow a "slack" of a given
| degree. Ie 45 degree means I wont turn 100% directly towards target
| but within 45 degrees making it look a little more natural.
|
|- Initiate attack at a given range: send in pet, slow, nuke, run to attack
|
|- Let pet tank if:
| Healthdifference in Pct between pet and myself differs more than a
| given percentage.
| If no mobs nearby.
| Only if pet is close.
|- When pet tanks:
| Nuke if mana above a given pct.
| Keep pet updated with buffs and heals.
| Keep self updated. ælæ
| When health of pet reaches same Pct as self, attack again.
|
|- Option to strafe around target to let pet attack the targets back.
|
|- Run to mob-corpse and loot if the mob was above a given level
| (to prevent looting low lvl greens)
|
|- Keep track of the items looted during the runtime of the macro.
|
|- Allways using pet as a reference on me being attacked. If pet has something
| targeted, help it.
|
|- Aquiring a new target:
| After about 6 attempts with a delay between and there is still no target,
| run back to homespot (where the script started) and sit down.
| Restless option. If nothing happens at homepoint, sooner or later we
| run to a random point nearby looking for mobs.
|
|-If my health should drops below a certain %, heal till I'm above
| (after fights or when pet tanks)
|
|-Alarm sound (/beep) if health gets below a certain level so prompt you to get
| back to the computer.
|
|-If pet health drops below a certain %, heal pet
| (after fights or when pet tanks)
|
|-If mana drops below a certain %, sit down and med till it's above.
|
|-Choice of sending in pet before or after slow.
|
|-Only nuke if we got excess mana (mana over a given %)
|
|-Obstacle avoidance. If we are stuck while running to a target, back off
| random length and turn left or right randomly. Setting the default
| "slack" degree of the /face sub to a high degree to prevent running
| into the same obstacle again, in effect letting u run in
| an arc around the obstacle.
|
|-Attack no matter what if mob is below a certain % - dont back off.
|
|-Max Range from homepoint to prevent running amokk on the map.
|
|-Option to pull to homespot all the time.
|-Option to allways run to homespot after a fight.
|
|-2 methods to select mobs. Either by distance or by mobname first.
|
|-Dont pull mobs that are closer to a NPC or PC than a defined radius
|
|-Select spawns to hunt instead of searching for mobs
|
|--------------------------------------------------------------------------------
#include spellcast.inc
#turbo 40
|Events for counting the money we loot.
#event CashLoot "You receive #1#"
#event AddSpawn "[MQ2] SPAWN #1#"
#event AddSpawnDone "[MQ2] DONE"
#event ImDead "You have been slain by#*#"
#event Zoned "LOADING, PLEASE WAIT..."
|-- The normal debug - for normal play. Enable: "/echo", Disable: "/squelch /echo"
#define DEBUG_1 "/echo"
|-- Deeper debugging - enable when trying to find bugs. Enable: "/echo", Disable: "/squelch /echo"
#define DEBUG_2 "/echo"
|-- The Deepest debugging - will spam a lot. Enable: "/echo", Disable: "/squelch /echo"
#define DEBUG_3 "/echo"
|-- Destroys Silver if you have more than the given amount! 0=disable
#define DESTROY_GOLD_IF_ABOVE 0
|-- Destroys Silver if you have more than the given amount! 0=disable
#define DESTROY_SILVER_IF_ABOVE 500
|-- Destroys Copper if you have more than the given amount! 0=disable
#define DESTROY_COPPER_IF_ABOVE 500
|-- The degree we face towards the target, so we dont run dead on.
#define THE_SLACK_DEGREE 20
|-- The max search radius for a mob (will not use /target untill closer than SEARCH_RADIUS).
#define MAXIMUM_SEARCH_RADIUS 90
|-- The max TARGET radius for a mob (above 500 could be bad, SoE logging?).
#define TARGET_RADIUS 100
|-- Define the Z radius on our pulls. To prevent pulling to far up or below (floors?)
#define Z_RADIUS_ON_PULLS 300
|-- How far is the max range we want to go from homespot?
#define MAX_RANGE_FROM_HOMEPOINT 90
|-- Target method. 1-Prioritize mob sequence or 2-Prioritize distance
#define TARGET_METHOD 2
|-- The closest a another PC can be to a target
#define AVOID_PEOPLE_RADIUS 1
|-- The closest a another NPC can be to a target - Only attack single mobs?
#define AVOID_CROWDED_RADIUS 1
|-- Also loot items?
#define LOOT_ITEMS True
|-- Loot all items?
#define LOOT_ALL_ITEMS False
|-- Destroy the remaining items -not in use atm
#define LOOT_ABOVE_LEVEL 1
|-- Keep loot record - Will display how much you have looted + items
#define LOOT_KEEP_RECORD True
|-- No matter other settings. If the value of the item is above this, GET IT! (Value is in copper)
|-- Not nodrop
#define LOOT_NORMAL_ITEMS_IF_VALUE_IS_ABOVE 10000
|-- No matter other settings. If the value of the item is above this and stackable, GET IT! (Value is in copper)
|-- Not lore, not nodrop
#define LOOT_STACKABLE_ITEMS_IF_VALUE_IS_ABOVE 1000
|#define LOOT_DESTROY False
|-- What lvl should the mob be before we bother looting it
|-- At what range do we slow/send in pet?
#define INITIALIZE_ATTACK_RANGE 10
|-- If we dont get any target for a while at homepoint, run somewhere else
#define ARE_WE_RESTLESS False
|-- How far do we want to run?
#define RESTLESS_RANGE 60
|-- We dont want to stay back when the mob is fleeing, now do we :-)
#define FORCE_ATTACK_WHEN_MOB_BELOW 30
|-- Do we want to stay on opposite side than the pet on the mob
#define STRAFE_TO_BACK True
|-- If the PCT of your pet and yourself differs from this number, let pet tank
#define LET_PET_TANK_IF_DIFFERENCE 8
|-- If there are more than 1 mob within this radius, just tank on
#define IGNORE_PETTANK_IF_MOBS_RADIUS 100
|-- Allways return to homepoint | can be li'l buggy?
#define RETURN_TO_HOMEPOINT False
|-- Should we allways pull to the same spot?
#define PULL_TO_HOMEPOINT True
|-- What spell should we use to pull ?
#define PULL_TO_HOME_SPELL_NAME "Drowsy"
|-- What spellgem slot should we use?
#define PULL_TO_HOME_SPELL_GEM 4
|-- Should I tell pet to back off while running back. False for those who have /pet hold
#define PULL_TO_HOME_PETBACKOFF True
|-- Shall we only pull what's in front of us? (<180 degrees) or everything (360 degrees)
|-- A value of 90 will pull only from straight ahead and 45 degrees to each side.
|-- Nice for pulling only hallways in front of you
#define PULL_TARGET_ANGLE 360
|-- If we dont have a pet, should we allways summon one?
#define ALLWAYS_HAVE_PET True
|-- What pet do we want?
#define PET_SPELL "Spirit of Keshuval"
|-- Favorite gem spot for the pet (1-8)
#define PET_GEM 2
|-- How far off should the pet be before we summon it?
#define MAX_PET_RANGE_BEFORE_SUMMON 500
|-- Should we slow when pulling?
#define DO_SLOW_ON_PULL True
|-- Should we send in pet before or after we slow? - If false we wait for the target to attack us
#define SEND_PET_BEFORE_SLOW False
|-- Only slow mobs above a certain level
#define SLOW_ABOVE_LEVEL 18
|-- What slow spell
#define SLOW_SPELL "Drowsy"
|-- Favorite gem spot for the slow (1-8)
#define SLOW_GEM 4
|-- Should we nuke when we pull?
#define DO_NUKE_ON_PULL False
|-- Prevent nuking when mana below % to not waste mana
#define NUKE_ABOVE_MANA_PCT 80
|-- Prevent nuking low lvls, they arent worth it
#define NUKE_ABOVE_LEVEL 13
|-- Name of nuke spell
#define NUKE_SPELL "Blast of Frost"
|-- Favorite gem spot for the nuke (1-8)
#define NUKE_GEM 1
|-- How low on health should I be before I heal myself (noncombat)
#define HEAL_BELOW_PCT 65
|-- Name of healing spell
#define HEAL_SPELL "Light Healing"
|-- Favorite gem spot for the heal (1-8)
#define HEAL_GEM 3
|-- If your health gets below this lvl start /beep'ing
#define ALARM_HEALTH_BELOW_PCT 20
|-- How low on health should the pet be before we heal it (noncombat)
#define HEAL_PET_BELOW_PCT 50
|-- Name of pet healing spell
#define HEAL_PET_SPELL "Keshuval`s Rejuvenation"
|-- Favorite gem spot for the petheal (1-8)
#define HEAL_PET_GEM 6
|-- What is the minimum mana I should have, sit down and med if below
#define MIN_MANA_BEFORE_MEDITATE 30
|----------------------------------------------------------------------------
|SUB: Main - Declarations and Initialization
|----------------------------------------------------------------------------
Sub Main
|Log to output file "/spew on" or turn it off "/spew off" (MacroQuest\logs\DebugSpew.log)
/spew on
|Buffs to be kept up on self (max 15) - "Buff" or "Buff|GemSlot"
/declare MyBuffs[6] string outer
/varset MyBuffs[1] "Spirit of Wolf|8"
/varset MyBuffs[2] "Inner Fire|5"
|Critical buffs to be kept up on self (max 15) - cast during fight
/declare CritBuffs[1] string outer
/varset CritBuffs[1] "Spirit of Wolf|8"
|Buffs to be kept up on petf (max 15) - "Buff" or "Buff|GemSlot"
/declare PetBuffs[4] string outer
/varset PetBuffs[1] "Spirit of Wolf|8"
/varset PetBuffs[2] "Inner Fire|5"
/varset PetBuffs[3] "Spirit of the Blizzard|7"
|Loot items we want to loot
/declare LootList[6] string outer
/varset LootList[1] "Fine Steel Short"
/varset LootList[2] "Fine Steel Long"
/varset LootList[3] "Fine Steel Rapier"
/varset LootList[4] "Fine Steel Scimitar"
/varset LootList[5] "silk"
/varset LootList[6] "venom"