Loot.mac [Loots the mob you(Or ur pet) just killed]
Posted: Mon Aug 30, 2004 8:49 pm
OK, thanks to Mister Peepers I was able to fix the problem I was having with this macro(what a stupid problem it was too, Haha).
It will target the mobs corpse that you or ur pet killed(It will NOT loot corpses of mobs others have killed). It will target the nearest corpse that is within a radius of 100.
Change "/declare LootAllItems int outer 1" to 0 if you want it to read from hunterloot.ini I instead of looting all items(It will destroy any items not in the hunterloot.ini file)
Macro:
hunterloot.ini:
It will target the mobs corpse that you or ur pet killed(It will NOT loot corpses of mobs others have killed). It will target the nearest corpse that is within a radius of 100.
Change "/declare LootAllItems int outer 1" to 0 if you want it to read from hunterloot.ini I instead of looting all items(It will destroy any items not in the hunterloot.ini file)
Macro:
Code: Select all
|------------------------------------------------------------
| Name: Loot.mac
|------------------------------------------------------------
| Description: Loots mobs that you or your pet kills.
|------------------------------------------------------------
| Author: TheWarden (helped by DKAA)
|------------------------------------------------------------
| Example Uses:
| /macro loot.mac
|------------------------------------------------------------
#Event MobDied "#*# has been slain by |${Me.Pet.CleanName}|!"
#Event MobDied "#*#You have slain #*#"
Sub Main
|------------------------------------------------------------
|Should I loot all items? (1 for yes, 0 for no)
|------------------------------------------------------------
/declare LootAllItems int outer 1
|------------------------------------------------------------
|Loot Array Information.
|------------------------------------------------------------
/call ReadINI HunterLoot.ini "${Zone.Name}" Loot
/if (!${Defined[LootArray]}) {
/echo No Loot Array Created...
}
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare LootSlot int outer 0
/echo Starting Looting Macro.
/lootnodrop never
:eventloop
/doevents
/delay 5
/goto :eventloop
/return
|--------------------------------------------------------------------------------
|Event: MobDied
|--------------------------------------------------------------------------------
Sub Event_MobDied
/squelch /declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/target npc corpse radius 200
:MovementLoop
/face fast nolook
/if (${Int[${Target.Distance}]}>13) {
/keypress forward hold
}
/if (${Int[${Target.Distance}]}<13&&${Int[${Target.Distance}]}>11) {
/keypress forward
}
/if (${Int[${Target.Distance}]}<9) {
/keypress back
}
/if (${Int[${Target.Distance}]}>13) {
/goto :MovementLoop
}
/keypress forward
/keypress back
/delay 5
/loot
:NotOpen
/if (${Window[LootWnd].Open}) {
/goto :Lalala
}
/goto :NotOpen
:Lalala
/delay 5
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/notify LootWnd DoneButton leftmouseup
/delay 5
/return
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/itemnotify loot${LootSlot} leftmouseup
:LootWait
/if (!${Cursor.ID}) {
/goto :LootWait
}
/delay 5
/if (${LootAllItems}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 5
} else {
/for LootCheck 1 to ${LootArray.Size}
/if (${Cursor.Name.Find[${LootArray[${LootCheck}]}]}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 5
}
/next LootCheck
}
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}...
/destroy
/delay 5
}
/next LootSlot
/notify LootWnd DoneButton leftmouseup
/delay 5
/return
|--------------------------------------------------------------------------------
|SUB: Reading from an INI File
|--------------------------------------------------------------------------------
Sub ReadINI(FileName,SectionName,ArrayType)
/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}...
/delay 10
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 10
/return
}
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}
:CounterLoop
/if (${Ini[${FileName},${SectionName},${ArrayType}${nValues},NOTFOUND].Equal[NOTFOUND]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop
:MakeArray
/if (!${nValues}) /return
/if (${FileName.Equal["HunterMob.ini"]}&&${nValues}>0) {
/echo Declaring Mob Array...
/declare MobArray[${nValues}] string outer
/declare MobStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare LootArray[${nValues}] string outer
/declare LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["HunterMob.ini"]}) {
/varset MobArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset MobStats[${nArray}] 0
}
/if (${FileName.Equal["HunterLoot.ini"]}) {
/varset LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset LootStats[${nArray}] 0
}
/next nArray
/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
/delay 10
/returnhunterloot.ini:
Code: Select all
[Kurn's Tower]
Loot1=Bone Chips
[The Mines of Gloomingdeep]
Loot1=Bone Chips
Loot2=Gloomingdeep Silk