This first one will take a string input and will loot the entire corpse and search for that item. I used this while camping for the shrink wand in the deep. This subroutine has been tweaked and played with over and over again for reliable looting in real EQ circumstances(a mob aggroing you while looting, it fucking up and you never standing up, and possibly dying from that, etc).
This subroutine will target the nearest corpse. Then if it the corpse less than 120feet away it will move to it reliably and loot it. IF its more than 120 it will return(so you don't run off all crazy and die). Also if an item is worth 5pp or more, or has a tribute value of 500 or more it will keep it. If you don't finish looting the corpse within 7seconds of the subroutine being called you will stand up just in case you are stuck. In my main programs I call the subroutine twice in a row. I've found while camping for things somethign would aggro and my macro wouldn't finish looting the corpse. Just call it twice in a row and you should be fine, but like anything try it out first to see if you need to change any of the code. You can call another routine to camp you out after you find what you want or whatever. Add the /call function where you see: |/call FindWand, left over from when I found my wand:
/call LootMob "Wand of"
/call LootMob "Wand of"
8.10.2004 - I realized I had posted my includes verbatim. I use /mqgoto instead of the regular /goto. I changed it should work fine now
Code: Select all
sub LootMob(Loot)
| Note: the number 4.3 in the /varset MoveDelay was empirically
| set for IRS5 ( Speed = 150 )
/declare MoveDelay int local
/declare LootSlot int local 1
/keypress ESC
/keypress ESC
/keypress ESC
/keypress ESC
/timed 150 /stand
/timed 155 /notify LootWnd DoneButton leftmouseup
:Top
/target npc corpse
/delay 2
/if (${Target.Distance}<15) {
/face fast
} else /if (${Target.Distance}>=15 && ${Target.Distance}<120) {
/face fast
/keypress forward hold
/varset MoveDelay ${Math.Calc[(${Target.Distance})/4.3]}
/keypress forward hold
/delay ${MoveDelay}
/keypress forward
/goto :Top
} else {
/echo Corpse is too far away
/keypress ESC
/return
}
/echo Looking for "${Loot}"
:LootWnd
/loot
/if (!${Window[LootWnd].Open}) /goto :LootWnd
:lootloop
/if (${Me.State.Equal["STAND"]}) /goto :doneloot
/if (${Corpse.Items}==0) {
/goto :doneloot
}
/if (${LootSlot}>=32) /goto :doneloot
:Loot
/itemnotify Loot${LootSlot} leftmouseup
/delay 1s
/if (${Window[ConfirmationDialogBox].Open}) {
/notify ConfirmationDialogBox Yes_Button leftmouseup
/delay 1s
}
/if (${String[${Cursor.Name}].Find[${Loot}]}) {
/echo YOU WIN: ${Cursor.Name}
/autoinv
/delay 2
|/call FindWand
} else {
/if (${Cursor.Value}>5000 || ${Cursor.Tribute}>500) {
/echo ${Cursor.Name} is worth more than 5pp or tribute is greater than 500
/autoinv
/delay 5
} else {
/echo Destroying ${Cursor}
/destroy
/delay 5
}
}
/varcalc LootSlot ${LootSlot}+1
/goto :lootloop
:doneloot
/notify LootWnd DoneButton leftmouseup
/varset LootSlot 0
/returnCode: Select all
sub Lootnpc
| Note: the number 4.3 in the /varset MoveDelay was empirically
| set for IRS5 ( Speed = 150 )
/declare MoveDelay int local
/declare LootSlot int local 1
/keypress ESC
/keypress ESC
/keypress ESC
/keypress ESC
/timed 70 /stand
/timed 75 /notify LootWnd DoneButton leftmouseup
:Top
/target corpse
/delay 2
/if (${Target.Distance}<15) {
/face fast
} else /if (${Target.Distance}>=15 && ${Target.Distance}<120) {
/face fast
/keypress forward hold
/varset MoveDelay ${Math.Calc[(${Target.Distance})/4.3]}
/keypress forward hold
/delay ${MoveDelay}
/keypress forward
/goto :Top
} else {
/echo Corpse is too far away
/keypress ESC
/return
}
:LootWnd
/loot
/delay 1
/if (!${Window[LootWnd].Open}) /goto :LootWnd
:lootloop
/if (${Me.State.Equal["STAND"]}) /goto :doneloot
/if (${Corpse.Items}==0) {
/goto :doneloot
}
/if (${LootSlot}>=32) /goto :doneloot
:Loot
/itemnotify Loot${LootSlot} leftmouseup
/delay 1s
/if (${Window[ConfirmationDialogBox].Open}) {
/notify ConfirmationDialogBox Yes_Button leftmouseup
/delay 1s
}
/autoinventory
/delay 2
/varcalc LootSlot ${LootSlot}+1
/goto :lootloop
:doneloot
/notify LootWnd DoneButton leftmouseup
/varset LootSlot 0




