Hunter loot help

Bengan

New member
Joined
Jun 9, 2006
Messages
24
Reaction score
0
Points
1
Hello. I found a mac for afk farming on a emu server.
It works great except that it sometimes gets stuck at the looting part.
The first thing is that some corpses gets unreachable "corpse too far away" and keeps trying untill i restart the mac.
The other thing is that it gets stuck in the lootwindow without looting anything and i have to help it loot the item and then it continues.
Could anyone help me add something like "if the corpse is unreachable more then 5tries it hidecorpses and /return" and for the 2nd problem i dont know. Maybe add a timer that restarts mac if its stuck in the lootwindow for more then 20s? :)
Thankful for any kind of help.

|#event Backstab "You backstab #1# for #2# points of damage."

sub main
/declare longKill timer
/declare lootTimeOut timer
/declare curZone string
/declare notValid string
| /declare named string
/declare altCurrency string
/declare lootItems string
/declare lootName string
/declare lootCount int
/declare minLootValue int
/declare npcID int
/declare i int
/declare ii int

/declare noloot int

/varset minLootValue 200000

/varset altCurrency /Ebon Crystal/McKenzie's Special Brew/Silver Token/Gold Token/Bayle's Mark/Brellium Token/Dream Mote/

/varset lootItems /Dragon Brood Crypt Key/Lost Dungeon Key/Grand Drake Mane/Grand Puma Paw/Grand Kirin Mane/Grand Sentinel Essence/Jaques' Silk Garment/Orchillium Shard/Terror Infused/Great Ape's Nape Drape/Abstruse Dreamhunter Breastplate/Abstruse Dreamhunter Bracer/Abstruse Dreamhunter Boots/Abstruse Dreamhunter Gauntlets/Abstruse Dreamhunter Greaves/Abstruse Dreamhunter Helm/Abstruse Dreamhunter Vambraces/Abstruse Forcestruck Boots/

/varset notValid /Norrath`s Keepers Guard/Tatsujiro the Serene/Caridwi/Furious Sentry/The Butler/Velden Dragonbane/Vkjen Thunderslayer/King Tormax/The Avatar of War/a cursed pirate/a sea turtle/Jaques the Infected/a tortured sailor/Smoot/Gordish Frozenheart/Kessdona the Enlightened/Rikkukin the Defender/Gesh`kru/Dennen Marol/Skuk/Alisia Sandweaver/a sand vortex/A festering ooze/a petrified colossal tree/a hollow tree/a chanting tree spirit/Cazic Thule/

| /varset named /The Grand Drake/The Grand Kirin/The Grand Sentinel/The Grand Puma/

/varset curZone ${Zone}

/call doHideCorpses

:WaitForRespawns

/if (${SpawnCount[npc]}>0) {
:NextSpawn

/if (!${String[${Zone}].Equal[${curZone}]}) /return

/for i 1 to ${SpawnCount}
/vardata npcID NearestSpawn[${i}].ID

/if ((${npcID}!=${Me.ID}) && (${Spawn[${npcID}].Type.Equal[NPC]})) {
/if ((${notValid.Find[/${Spawn[${npcID}].CleanName}/]}==NULL) && (${Spawn[${npcID}].CleanName.Length}>0)) {
/target id ${npcID}

/if (!${longKill}) {
/call warpTarget 0
} else {
/call warpTarget 1
}

:Retarget

/target clear
/delay 5
/target id ${npcID}
/delay 1s ${Target.Distance}<10
/stick 7 moveback
/attack on

/varset longKill 8s

:WaitForDead

/face fast nolook

/doevents

/if (${String[${Me.Class}].Equal[Rogue]}) {
/if (${Me.AbilityReady[Backstab]}) /doability Backstab
/if (${String[${Me.Song[Thief's Eyes]}].Equal[NULL]}) /doability "Thief's Eyes"
}

/if (${String[${Me.Class}].Equal[Druid]}) {
/casting "Galatine"
/delay 4
}

/if (${String[${Me.Class}].Equal[Warrior]}) {
/if (${Window[CombatAbilityWnd].Open}) {
/if (${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[No Effect]}) /casting "Blade of Hatred"
}
}

| /if ((${Target.Type.Equal[CORPSE]}) || (!${longKill})) /target clear
/if (!${longKill}) /goto :Retarget
/if (${Target.Distance}>50) /call warpTarget 0

| /if (${Target.ID}==${npcID}) /goto :WaitForDead

:NearbyCorpseFound

/if (!${noloot}) {
/if (${Spawn[${npcID}].Type.Equal[CORPSE]}) {
/if (!${Me.FreeInventory}) {
/beep
} else {
/target id ${npcID}
/call warpTarget 0
/delay 2s ${Target.Distance}<10

/if (${Target.Distance}<10) {
/varset lootTimeOut 5s

/delay 2
/loot

:WaitForLootWndOpen
/delay 5
/if ((!${NearestSpawn[corpse].LineOfSight}) || (!${lootTimeOut})) :NextSpawn
/delay 1s ${Window[LootWnd].Open}
/loot
/if (!${Window[LootWnd].Open}) /goto :WaitForLootWndOpen

/vardata lootCount Corpse.Items

/if (${lootCount}) {
/for ii 1 to ${lootCount}
/if (!${Me.FreeInventory}) /goto :DoneLooting

/if (${Corpse.Item[${ii}].ID}) {
/varset lootName ${Corpse.Item[${ii}].Name}

/if (${altCurrency.Find[/${lootName}/]}) {
/call lootItem ${ii}
/call reclaimCurrency ${lootName}
} else {
/if ((${lootItems.Find[/${lootName}/]}) || (${Corpse.Item[${ii}].Value}>${Math.Calc[${minLootValue}*1000]})) {
/call lootItem ${ii}
}
}

/if (${lootName.Find[EPIC]}) {
/call lootItem ${ii}
}
}
/next ii
}

:DoneLooting

/notify LootWnd DoneButton leftmouseup

:WaitForLootWndClose
/delay 5
/if ((!${NearestSpawn[corpse].LineOfSight}) || (!${lootTimeOut})) :NextSpawn
/if (${Window[LootWnd].Open}) /goto :WaitForLootWndClose

/if (${NearestSpawn[corpse].LineOfSight}) {
/vardata npcID NearestSpawn[corpse].ID
/goto :NearbyCorpseFound
}
}
}
} else {
/if (!${String[${Spawn[${npcID}].ID}].Equal[NULL]}) /goto :WaitForDead
}
}
/if (!${String[${Spawn[${npcID}].ID}].Equal[NULL]}) /goto :WaitForDead
/goto :NextSpawn
}
}
/next i
}

/delay 5s

/goto :WaitForRespawns
/return


sub doHideCorpses
/hidec all
/hidec looted
/delay 5
/return

sub warpTarget(boolWithDistance)
/if (${boolWithDistance}) {
/warp loc ${Math.Calc[${Target.Y}-2]} ${Math.Calc[${Target.X}-2]} ${Target.Z}
} else {
/warp target
}
/return

sub reclaimCurrency(strCurrencyName)
/declare itemIndex int local
/declare itemTotal int local

/if (${Window[IW_AltCurrPage].Open}) {
/varset itemIndex ${Window[IW_AltCurrPage].Child[IW_AltCurr_PointList].List[=${strCurrencyName},2]}

/if (${itemIndex}) {
/notify IW_AltCurrPage IW_AltCurr_PointList listselect ${itemIndex}
/notify IW_AltCurrPage IW_AltCurr_ReclaimButton leftmouseup
/delay 5
}
}
/return

sub lootItem(intLootSlot)
/shift /itemnotify loot${intLootSlot} rightmouseup

:WaitLootItem
/delay 5
/if (${Corpse.Item[${intLootSlot}].ID}) /goto :WaitLootItem
/return


sub Event_Backstab(strText, strMobName, strDamage)
/declare formattedDamage string local

|/if (${Group.Members}==NULL) /return

/if (!${strDamage}==NULL) {
/if (${strDamage}>500000) {
|/popup ${strDamage}
/if (${strDamage}<1000000) {
/varset formattedDamage ${String[${strDamage}].Left[3]},${String[${strDamage}].Right[3]}
} else {
/varset formattedDamage ${String[${strDamage}].Left[4]},${String[${strDamage}].Right[3]}
/varset formattedDamage ${String[${formattedDamage}].Left[1]},${String[${formattedDamage}].Right[7]}
}
/guildsay Backstab (${strMobName}) for ${formattedDamage} points of damage.
}
}
/return
 
Hmm, I'm sure it works OK for an EMU, but that macro is a piece of garbage. There are better things that will do what you want, with little work. Just adding a call to LootMobs from ninjadvloot.inc (in the :NearbyCorpseFound loop) will do what you want.

You will have to find the ninjadvloot.inc that works with your MQ2 build, though.