• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

Macro request from admitted non coder (1 Viewer)

blackdragondd

New member
Joined
Jul 4, 2006
RedCents
Is there a macro that will do loot similar to the forage aa macro?
what i mean is, loot and keep certain items u can setup/choose, delete the rest no drop or not?

Thanks
 
im not wanting a afk mac, i want a triggerable mac...i do alot of farming. wana be able to setup a list...when i loot mob, hit button that says mac name and it loots whats listed as keep, destroys the rest...i farm in places where mobs drop lota stuff...3 and 4 items at a time
 
I've been using this one forever for normal auto-looting; not my code. Hunter is fine for focused mindless mayhem, but this one is pretty general.

One note: Items sometimes get skipped over during the looting process. They're still on the corpse, just right-click and re-loot. The timing loop could/should probably be adjusted, but I live with it as is.

If this macro is active when you open a vendor, you get a 10 second countdown before it starts running through your packs and selling everything marked for sell. Be sure to get gear you carry around marked as KEEP or you may have an unwelcome surprise.

A companion loot.ini is created in your macro folder if it doesn't already exist.

Loot.mac
Rich (BB code):
||||||||||||||||||||||||||||||||||||||||||||||||||  ||||||||||||||||||||||||||||| 
| 
| Author: anon_coward 
| 
| Initial release: 10/14/04 
| 
||||||||||||||||||||||||||||||||||||||||||||||||||  ||||||||||||||||||||||||||||| 
| 
| Description: 
| This macro helps with looting and selling.  There are 2 main parts, looting 
| and selling.  The looting code is run once you open a corpse.  Once you click 
| the corpse open it automatically empties the corpse and adds the items to the 
| INI file.  Then later when you open a merchant, it will automatically sell 
| items that are in the INI file. 
| 
| Each item has an entry in the INI file with one of 4 numbers which mean: 
| KEEP, DESTROY, LEAVE, or SELL.  Items with the KEEP setting are automatically 
| looted, and skipped during the selling part.  The DESTROY setting picks the 
| item up off the corpse and it is immediately destroyed.  Use with CAUTION. 
| This is great for LDON collect missions.  Setting an item to LEAVE means the 
| next time it won't pick it up so it stays on the corpse.  And finally SELL is 
| the magic setting to have it both autolooted and autosold. 
| 
| There is a special check for ${Me.Name} when looting so if you open your own 
| corpse, the INI is ignored and every item should just be looted.  WARNING: 
| MAKE SURE YOU ALREADY GOT YOUR REZ. 
| 
| Finally, you can turn it on and off by using '/echo SET PAUSED' to toggle. 
| The same command pauses and resumes the macro. 
| 
||||||||||||||||||||||||||||||||||||||||||||||||||  ||||||||||||||||||||||||||||| 
| 
| Here are the command it expects: 
| Print settings about an item or your inventory with: 
| ... /echo SHOW LOOT   - display current setting for the item on cursor 
| ... /echo SHOW SELL   - list all inventory items marked to sell 
| 
| With an item on the cursor, you change settings with 
| ... /echo SET KEEP    - just loot this item into inventory 
| ... /echo SET DESTROY - take off the corpse and /destroy it 
| ... /echo SET LEAVE   - just leave it on the corpse 
| ... /echo SET SELL    - put it in inventory and autosell at the next vendor 
| 
| And finally, to turn it on and off 
| ... /echo SET PAUSED  - toggle it on/off with the same command 
| 
||||||||||||||||||||||||||||||||||||||||||||||||||  ||||||||||||||||||||||||||||| 

#Event Print "[MQ2] PRINT #1#" 
#Event Print "[MQ2] SHOW #1#" 
#Event Set   "[MQ2] SET #1#" 
#Event Help  "[MQ2] HELP #1#" 
#Event Help  "[MQ2] HELP"
#Event Buffme "[MQ2] BUFFME" 
#Event Bandaide "[MQ2] BANDAIDE" 
#Event Follow "[MQ2] FOLLOW"
#Event Castspell "[MQ2] Castspell #1#"
#EVent movetoloc "[MQ2] MOVETOLOC #1# #2#"
#Event movetospawn "[MQ2] MOVETOSPAWN #1#"
#Event MouseShow "[MQ2] MouseShow" 

#include SpellCast.inc 
#include Move.inc

Sub Main 
  /declare zonename string outer

    /echo Loot helper started 
    /call Init 

    :MainLoop 
    /delay 0 
    /doevents 
    /if (${PAUSED}) /goto :MainLoop 
    /if (${Merchant.Open})        /call SellLoot 
    /if (${Window[LootWnd].Open}) /call LootCorpse 
    /goto :MainLoop 

/endmacro 

Sub Init 

    /if (!${Defined[PAUSED]}) /declare PAUSED bool outer FALSE 

    |A few constants for handling loot 
    /if (!${Defined[LOOT_KEEP]})     /declare LOOT_KEEP     int    outer 1 
    /if (!${Defined[LOOT_DESTROY]})  /declare LOOT_DESTROY  int    outer 2 
    /if (!${Defined[LOOT_LEAVE]})    /declare LOOT_LEAVE    int    outer 3 
    /if (!${Defined[LOOT_SELL]})     /declare LOOT_SELL     int    outer 4 

    |A table for mapping numbers to strings for printing 
    /if (!${Defined[LOOT_SETTINGS]}) /declare LOOT_SETTINGS[4] string outer 
    /varset LOOT_SETTINGS[${LOOT_KEEP}]    KEEP 
    /varset LOOT_SETTINGS[${LOOT_DESTROY}] DESTROY 
    /varset LOOT_SETTINGS[${LOOT_LEAVE}]   LEAVE 
    /varset LOOT_SETTINGS[${LOOT_SELL}]    SELL 

    |Default values for specific types of loot 
    /if (!${Defined[LOOT_DEFAULT]})  /declare LOOT_DEFAULT  int    outer ${LOOT_SELL} 
    /if (!${Defined[LOOT_NO_DROP]})  /declare LOOT_NO_DROP  int    outer ${LOOT_LEAVE} 

    /echo Droppable loot defaults to .. ${LOOT_SETTINGS[${LOOT_DEFAULT}]} 
    /echo No Drop loot defaults to .... ${LOOT_SETTINGS[${LOOT_NO_DROP}]} 

/return 

Sub LootCorpse 

    /delay 1s 
    /declare total int local ${Corpse.Items} 

    /if (!${total}) /goto :DoneLooting 

    /declare WATCHDOG     timer local 
    /declare not_found    int   local -1 
    /declare item_setting int   local 
    /declare slot         int   local 
    /for slot 1 to ${total} 

        /varset WATCHDOG 5s 
        :ClearCursor 
        /delay 0 
        /doevents 
        /if (!${WATCHDOG}) { 
            /echo Item stuck on the cursor. Abort! 
            /goto :DoneLooting 
        } 
        /if (${Cursor.ID}) { 
            /autoinventory 
            /delay 5 
            /goto :ClearCursor 
        } 

        /varset item_setting ${Ini[Loot.ini,Loot,${Corpse.Item[${slot}].Name},${not_found}]} 

        | If the item isn't in the .ini file then add it. 
        /if (${item_setting}==${not_found}) { 
            /varset item_setting ${LOOT_DEFAULT} 
            /if (${Corpse.Item[${slot}].NoDrop}) { 
                /varset item_setting ${LOOT_NO_DROP} 
            } 

            /echo Adding to INI "${Corpse.Item[${slot}].Name}" (${LOOT_SETTINGS[${item_setting}]}) 
            /ini Loot.ini Loot "${Corpse.Item[${slot}].Name}" ${item_setting} 
        } 

        /if (${item_setting}==${LOOT_DESTROY} && !${Corpse.Name.Find[${Me}]}) { 
            /echo -- You destroyed a <<${Corpse.Item[${slot}].Name}>>.-- (${LOOT_SETTINGS[${item_setting}]}) 
            /itemnotify loot${slot} leftmouseup 
            /delay 5 
            /if (${Window[ConfirmationDialogBox].Open}) { 
                /notify ConfirmationDialogBox Yes_Button leftmouseup 
                /delay 5 
            } 
            /if (${Cursor.ID}) { 
                /destroy 
                /delay 5 
            } else { 
                /echo Uh oh, DESTROY item didn't show up on Cursor 
            } 

        } else /if (${item_setting}==${LOOT_KEEP} || ${item_setting}==${LOOT_SELL} || ${Corpse.Name.Find[${Me}]}) { 
            /echo -- You have looted a <<${Corpse.Item[${slot}]}>>.-- (${LOOT_SETTINGS[${item_setting}]}) 
            /itemnotify loot${slot} rightmouseup 
            /delay 5 
            /if (${Window[ConfirmationDialogBox].Open}) { 
                /notify ConfirmationDialogBox Yes_Button leftmouseup 
                /delay 5 
            } 

        } else /if (${item_setting}==${LOOT_LEAVE}) { 
            /echo -- You left a <<${Corpse.Item[${slot}]}>>.-- (${LOOT_SETTINGS[${item_setting}]}) 

        } else { 
            /echo Umm, something is wrong in the loot code 
            /echo I don't know what to do with ${Corpse.Item[${slot}]} 
            /echo I guess I'll just leave it there >< 
        } 
    /next slot 

    :DoneLooting
    /delay 1s
    /notify LootWnd DoneButton leftmouseup 
    /delay 5 

/return 

Sub SellLoot(bool JUST_PRINT) 

    /if (!${Defined[JUST_PRINT]}) /declare JUST_PRINT bool local FALSE 
    /if (${Merchant.Open} && !${JUST_PRINT}) { 
        /declare i int local 
        /for i 10 downto 1 
            /popup AUTO SELLING in ${i} sec 
            /delay 1s 
            /if (!${Merchant.Open}) /return 
        /next i 
    } 

    /declare plat   int local ${Me.Platinum} 
    /declare gold   int local ${Me.Gold} 
    /declare silver int local ${Me.Silver} 
    /declare copper int local ${Me.Copper} 

    /declare not_found    int local -1 
    /declare item_setting int local 
    /declare slot         int local 
    /declare spot         int local 
    /for slot 1 to 8 
        /if (${InvSlot[pack${slot}].Item.Container}) { 
            /for spot 1 to ${InvSlot[pack${slot}].Item.Container} 
                /if (!${InvSlot[pack${slot}].Item.Item[${spot}].ID}) /goto :NextSpot 
                /varset item_setting ${Ini[loot.ini,Loot,${InvSlot[pack${slot}].Item.Item[${spot}]},${not_found}]} 

                /if (${item_setting}==${not_found}) { 
                    /echo Dunno what to do with ${InvSlot[pack${slot}].Item.Item[${spot}]} pack${slot} slot${spot} 

                } else /if (${item_setting}==${LOOT_KEEP}) { 
                    /goto :NextSpot 

                } else /if (${item_setting}==${LOOT_DESTROY}) { 
                    /echo Should have DESTROYED ${InvSlot[pack${slot}].Item.Item[${spot}]} pack${slot} slot${spot} 

                } else /if (${item_setting}==${LOOT_LEAVE}) { 
                    /echo Should have LEFT ${InvSlot[pack${slot}].Item.Item[${spot}]} pack${slot} slot${spot} 

                } else /if (${item_setting}==${LOOT_SELL}) { 
                    /echo Selling ${InvSlot[pack${slot}].Item.Item[${spot}]} 
                    /if (${JUST_PRINT}) /goto :NextSpot 

                    /if (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
                    /delay 5 
                    /if (!${Window[pack${slot}].Open}) /nomodkey /itemnotify pack${slot} rightmouseup 
                    /delay 5 
                    /nomodkey /itemnotify ${InvSlot[pack${slot}].Item.Item[${spot}].InvSlot} leftmouseup 
                    /delay 5 
                    /nomodkey /shift /notify MerchantWnd MW_Sell_Button leftmouseup 
                    /delay 5 

                } else { 
                    /echo Bogus item setting: ${InvSlot[pack${slot}].Item.Item[${spot}]} => ${item_setting} 
                } 
            :NextSpot 
            /next spot 

            /if (${Window[pack${slot}].Open}) /nomodkey /itemnotify pack${slot} rightmouseup 
            /delay 1s 

        } else { 
            /if (!${InvSlot[pack${slot}].Item.ID}) /goto :NextSlot 
            /varset item_setting ${Ini[wizard.ini,Loot,${InvSlot[pack${slot}].Item},${not_found}]} slot${slot} 

            /if (${item_setting}==${not_found}) { 
                /echo Dunno what to do with ${InvSlot[pack${slot}].Item} slot${slot} 

            } else /if (${item_setting}==${LOOT_KEEP}) { 
                /goto :NextSlot 

            } else /if (${item_setting}==${LOOT_DESTROY}) { 
                /echo Should have DESTROYED ${InvSlot[pack${slot}].Item} slot${slot} 

            } else /if (${item_setting}==${LOOT_LEAVE}) { 
                /echo Should have LEFT ${InvSlot[pack${slot}].Item} slot${slot} 

            } else /if (${item_setting}==${LOOT_SELL}) { 
                /echo Selling ${InvSlot[pack${slot}].Item} 
                /if (${JUST_PRINT}) /goto :NextSlot 

                /if (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
                /delay 5 
                /nomodkey /itemnotify pack${slot} leftmouseup 
                /delay 5 
                /nomodkey /shift /notify MerchantWnd MW_Sell_Button leftmouseup 
                /delay 5 

             } else { 
                /echo Bogus item setting: ${InvSlot[pack${slot}].Item} => ${item_setting} 
             } 
        } 
    :NextSlot 
    /next slot 

    /varcalc plat   ${Me.Platinum}-${plat} 
    /varcalc gold   ${Me.Gold}-${gold} 
    /varcalc silver ${Me.Silver}-${silver} 
    /varcalc copper ${Me.Copper}-${copper} 

    /if (${plat} || ${gold} || ${silver} || ${copper}) { 
        /echo Made ${plat}pp ${gold}gp ${silver}sp ${copper}cp 
    } 

|   /if (${Merchant.Open}) /cleanup
    /nomodkey /notify MerchantWnd MW_Done_Button leftmouseup 
    /delay 5 
    /if (${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
    /delay 5 

/return 

Sub SetLootPreference(int pref) 

    /if (!${Cursor.ID}) { 
        /echo Pick up something on your cursor before typing this command 
        /return 
    } 

    /if (!${Defined[pref]}) { 
        /declare not_found    int local -1 
        /declare item_setting int local ${Ini[Loot.ini,Loot,"${Cursor}",${not_found}]} 
        /if (${item_setting}==${not_found}) { 
            /echo No entry for ${Cursor} 
        } else /if (${item_setting}==${LOOT_KEEP}) { 
            /echo Pick up <<${Cursor}>> 
        } else /if (${item_setting}==${LOOT_DESTROY}) { 
            /echo Pick up & DESTROY <<${Cursor}>> 
        } else /if (${item_setting}==${LOOT_LEAVE}) { 
            /echo Leave <<${Cursor}>> on corpse 
        } else /if (${item_setting}==${LOOT_SELL}) { 
            /echo Pick up <<${Cursor}>> (to sell) 
        } else { 
            /echo Unknown TYPE for Loot <<${Cursor}>> 
        } 
        /return 
    } 

    /if (${pref} < 1 || ${pref} > 4) { 
        /echo Prefence ID ${pref} out of range.  ERROR processing command 
        /return 
    } 

    /echo Setting preferenc "${Cursor.Name}" => ${LOOT_SETTINGS[${pref}]} 
    /ini Loot.ini Loot "${Cursor.Name}" ${pref} 
    /if (${pref}==${LOOT_DESTROY}) /destroy 

/return 

Sub Event_Print(string EventTxt,string CmdName) 

    /if (${CmdName.Find[LOOT]}) { 
        /call SetLootPreference 

    } else /if (${CmdName.Find[SELL]}) { 
        /call SellLoot TRUE 

    } else { 
        /echo Unknown command: ${CmdName} 
        /echo for more info type /echo HELP 
    } 

/return 

Sub Event_Set(string EventTxt,string CmdName) 

    /if (${CmdName.Find[SAVE]} || ${CmdName.Find[KEEP]}) { 
        /call SetLootPreference ${LOOT_KEEP} 

    } else /if (${CmdName.Find[DESTROY]}) { 
        /call SetLootPreference ${LOOT_DESTROY} 

    } else /if (${CmdName.Find[LEAVE]}) { 
        /call SetLootPreference ${LOOT_LEAVE} 

    } else /if (${CmdName.Find[SELL]}) { 
        /call SetLootPreference ${LOOT_SELL} 

    } else /if (${CmdName.Find[PAUSE]}) { 
        /if (${PAUSED}) { 
            /varset PAUSED FALSE 
            /echo ${Macro.Name} is active again 
        } else { 
            /varset PAUSED TRUE 
            /echo ${Macro.Name} is being paused 
            /echo type '/echo SET PAUSED' to resume 
        } 

    } else { 
        /echo Unknown command: ${CmdName} 
        /echo for more info type /echo HELP 
    } 

/return 

Sub Event_Help(string EventTxt,string CmdName) 

    /if (!${Defined[CmdName]}) { 
        /echo Help options are 
        /echo ... /echo HELP LOOT 

    } else /if (${CmdName.Find[LOOT]}) { 
        /echo Loot choices are 
        /echo ... /echo SHOW LOOT   - display current setting for the item on cursor 
        /echo ... /echo SHOW SELL   - list all inventory items marked to sell 
        /echo 
        /echo With an item on the cursor, you change settings with 
        /echo ... /echo SET KEEP    - just loot this item into inventory 
        /echo ... /echo SET DESTROY - take off the corpse and /destroy it 
        /echo ... /echo SET LEAVE   - just leave it on the corpse 
        /echo ... /echo SET SELL    - put it in inventory and autosell at the next vendor 
        /echo 
        /echo And finally, to turn it on and off 
        /echo ... /echo SET PAUSED  - toggle it on/off with the same command 
        /echo 
        /echo Droppable loot defaults to .. ${LOOT_SETTINGS[${LOOT_DEFAULT}]} 
        /echo No Drop loot defaults to .... ${LOOT_SETTINGS[${LOOT_NO_DROP}]} 

    } else { 
        /echo Sorry, no help for ${CmdName}. 
    } 

/return

Sub Event_Buffme(string EventTxt,string CmdName) 

    | notification
    /if (${Me.Sitting}) {
        /echo can't buff while seated

    } else {
       /if (!${Window[InventoryWindow].Open}) {
           /nomodkey /keypress inventory 
           /delay 2
           }
       
       | first item
       /exchange shrunken rightear
       /delay 2
       /itemnotify rightear rightmouseup
       /delay 5
       /exchange fiercely rightear
       /delay 5
   
       /if (!${Me.Combat}) {
          /target myself
          /exchange lodizal feet
          /delay 2
          /itemnotify feet rightmouseup
          /delay 120
          /exchange slaughter feet
          /delay 5

          /itemnotify face rightmouseup
          /delay 50
       }

       /if (${Window[InventoryWindow].Open}) {
          /nomodkey /keypress inventory 
          /delay 2
          }
   }
/return

Sub Event_Follow(string EventTxt,string CmdName) 
   :Loop
      /if (${Target.Distance}>15) /keypress up hold
      /if (${Target.Distance}<10) /keypress up 
      /face fast nolook
      /delay 1
   /if (${Target.ID}) /goto :Loop
/return

          :stillcasting
              /delay 5
              /if (${CastSpellWnd.Open}) /goto :stillcasting
              /delay 5

Sub Event_Castspell(string EventTxt,string CmdName)
	/call Cast "Strengthen" "gem6"
	/call Cast "Dexterous Aura" "gem6"
	/call Cast "Feet like Cat" "gem6"
|	/call Cast "Serpent Sight" "gem6"
	/call Cast "Turtle Skin" "gem6"
	/call Cast "Spirit of Bear" "gem6"
	/call Cast "Inner Fire" "gem6"
|	/call Cast "Spirit of Snake" "gem6"
|	/call Cast "Spirit Sight" "gem6"
|	/call Cast "Endure Poison" "gem6"
	/call Cast "Spirit of Wolf" "gem6"
/return

Sub Event_Bandaide
  /echo ...starting bindwound
  :bandaide
  /if (${Me.PctHPs} >= 68) /goto :donebind
  /delay 15
  /target ${Me}
  /if (${Me.AbilityReady["Bind Wound"]}) /doability "bind wound"
  /doevents
  /goto :bandaide
  :donebind
  /echo bindwound at or above max
/return

Sub Event_movetoloc(string EventTxt, string xpos, string ypos)
	/call movetoloc ${xpos} ${ypos}
/return

Sub Event_movetospawn(string EventTxt, string spawnname)
	/call movetospawnname ${spawnname} 12
/return

Sub Event_MouseShow(string EventTxt,string CmdName) 
	/echo Mouse's X Location: ${MacroQuest.MouseX} 
	/echo Mouse's Y Location: ${MacroQuest.MouseY}
	/echo My X Location: ${Me.X} 
	/echo My Y Location: ${Me.Y}
        /varset zonename ${Zone}
        /echo ${zonename}
/return
 
No need to re-invent the wheel :)

Rich (BB code):
|-NinjaLoot.inc v1.2 by Mystikule 


#Event NotYourKill       "You may not loot this Corpse at this time." 
#Event SetAutoLoot       "[MQ2] SetAutoLoot#*#" 
#Event Autolootstatus    "[MQ2] Autoloot Status#*#" 


Sub NLPresetup 

  |- Make any undefined declares 
  /if (!${Defined[LootINIFile]}) /declare NLLootINIFile string outer "loot.ini" 
  /if (!${Defined[NLVersion]}) /declare NLVersion string outer 1.2 
  /if (!${Defined[NLlootdist]}) /declare NLlootdist int outer 100 
  /if (!${Defined[NLlootmode]}) /declare NLlootmode string outer 

  |- Check version in ini and skip aliases if current 
  /if (${Ini[${NLLootINIFile},Loot,Version].Equal[${NLVersion}]}) /call LoadAliases 

  |- Declare corpseskip ID arrays 
  /declare NLCorpseskip[20,2] int outer 
  /declare NLTempCorpse[20] int outer 

  |- If empty ini build it up 
  /if (!${Ini[${NLLootINIFile},Loot,AutoLootMode].Length}) /call BuildINI 

  |- Load variables from ini 
  /if (${Ini[${NLLootINIFile},Loot,AutoLootMode].Length}) /varset NLlootmode ${Ini[${NLLootINIFile},Loot,AutoLootMode]} 
  /if (${Ini[${NLLootINIFile},Loot,AutoLootDistance].Length}) /varset NLlootdist ${Ini[${NLLootINIFile},Loot,AutoLootDistance]} 

  |- Echo NL status upon load 
  /echo Ninjaloot.inc Loaded. 
  /echo Ninjaloot Usage: 
  /echo /autoloot <all|drop|nditem|off> <radius#> 
  /echo /lootstatus <displays Autoloot status> 
  /echo Autoloot Status 
  /if (${NLlootmode.Equal[ALL]}) /docommand /lootnodrop never 
  /if (${NLlootmode.Equal[DROP]}) /docommand /lootnodrop always 
  /if (${NLlootmode.Equal[NDITEM]}) /docommand /lootnodrop always 
  /if (${NLlootmode.Equal[OFF]}) /docommand /lootnodrop always 
/return 

Sub NLAutoloot 

  /doevents SetAutoLoot 
  /doevents Autolootstatus 

  /if (${NLlootmode.Equal[OFF]}) /return 
  /if (!${Defined[lootslot]}) /declare lootslot int local 
  /if (!${Defined[loottotal]}) /declare loottotal int local -1 
  /if (!${Defined[w]}) /declare w int local 
  /if (!${Defined[e]}) /declare e int local 

  /call Updatecorpse 

  |- Check for avialable corpses to loot 
  /for e 1 to 20 
    /varset NLTempCorpse[${e}] ${NearestSpawn[${e},NPC Corpse radius ${NLlootdist}].ID} 
  /next e 
  /for e 1 to 20 
    /if (${NLTempCorpse[${e}]}<=0) { 
      /echo Autoloot:  No More Corpses Found 
      /return 
    } 
  |- Check if corpse is listed in Skip array 
    /for w 1 to 20 
      /if (${NLTempCorpse[${e}]}==${NLCorpseskip[${w},1]}) { 
        /echo Autoloot:  Skipping ${NLTempCorpse[${e}]}; Per Skip List 
        /next e 
      } 
    /next w 
  |- Test Z distance 
    /if (${Spawn[${NLTempCorpse[${e}]}].DistanceZ}>50) { 
      /call Addcorpse 
      /echo Autoloot:  Skipping ${NLTempCorpse[${e}]}; Z Plane out of limits 
      /next e 
    } 
  |- Make sure Spawnid is a corpse 
    /if (${Spawn[${NLTempCorpse[${e}]}].Type.NotEqual[Corpse]}) { 
      /echo Autoloot:  Skipping ${NLTempCorpse[${e}]}; Not a corpse! 
      /next e 
    } 
  |- Check if corpse is players corpse 
    /if (${Spawn[${NLTempCorpse[${e}]}].Deity.ID}!=0) { 
      /echo Autoloot:  Skipping ${NLTempCorpse[${e}]}; Is a PLAYERS corpse! 
      /next e 
    } 
  |-Target corpse and begin looting 
    /delay 1 
    /squelch /target id ${NLTempCorpse[${e}]} 
    /delay 1s ${Target.ID}==${NLTempCorpse[${e}]} 
    /echo Autoloot:  Looting ${Target.CleanName} 
    /delay 5s ${Target.ID}==${NLTempCorpse[${e}]} 
    /if (${Target.ID}!=${NLTempCorpse[${e}]}) /next e 
  |- Get 5 seconds (max) closer; warning, no detecting being stuck! 
    /face fast ${If[${Me.Underwater},,nolook]} 
    /if (${Me.Buff[Summon Drogmor].ID} || ${Me.Buff[Summon Horse].ID}) /dismount  
    /keypress forward hold 
    /delay 5s ${Target.Distance}<5 
    /keypress forward 
  |- Check for full inventory 
    /if (!${Me.FreeInventory}) { 
      /beep 
      /echo Autoloot:  ** INVENTORY FULL ! 
      /varset NLlootmode OFF 
      /echo Autoloot:  ** AutoLooting is now OFF! 
      /return 
    } 
    /delay 1s 
    /loot 
    /delay 1s ${Window[LootWnd].Open} 
  |- Check if unable to loot at this time 
    /doevents NotYourKill 
  |- Short pause to populate open window
    /delay 5
  |- Corpse with no items 
    /if (!${Corpse.Items}) { 
      /echo Autoloot:  NO LOOT! Cheap Bastard! 
      /notify LootWnd DoneButton leftmouseup 
      /delay 1s !${Corpse.Open} 
      /next e 
    } 
  |- Get total count of items on corpse 
    /varset loottotal ${Math.Calc[${Corpse.Items}]} 
  :autoxplootlag 
    /if (${loottotal}!=${Corpse.Items}) { 
      /varset loottotal ${Corpse.Items} 
      /goto :autoxplootlag 
    } 
  |- Check items on Corpse 
    /for lootslot 1 to ${loottotal} 
    /delay 1s ${InvSlot[loot${lootslot}].Item.ID}!=0 
  |- Check if item is LORE 
    /if (${InvSlot[loot${lootslot}].Item.Lore}) { 
      /echo Autoloot:  Lore ITEM Found 
      /if (${FindItem[${InvSlot[loot${lootslot}].Item.Name}].InvSlot}) { 
        /echo Autoloot:  Skipping; Found Loreitem in Characters Inventory 
        /if (${lootslot}>=${loottotal}) { 
          /call Itemsleft 
          /next e 
        } 
        /next lootslot 
      } 
      /if (${FindItem[${InvSlot[loot${lootslot}].Item.Name}].InvSlot.Pack}) { 
        /echo Autoloot:  Skipping; Found Loreitem in Characters Bags 
        /if (${lootslot}>=${loottotal}) { 
          /call Itemsleft 
          /next e 
        } 
        /next lootslot 
      } 
    } 
  |- Handling of NODROP items on corpse 
    /if (${InvSlot[loot${lootslot}].Item.NoDrop}) { 
      /echo Autoloot:  NO DROP ITEM Found 
      /if (!${Ini[${NLLootINIFile},"${InvSlot[loot${lootslot}].Item.Name.Left[1]}","${InvSlot[loot${lootslot}].Item.Name}"].Length}) { 
        /ini "${NLLootINIFile}" "${InvSlot[loot${lootslot}].Item.Name.Left[1]}" "${InvSlot[loot${lootslot}].Item.Name}" NDITEM 
        /echo Autoloot:  Adding ${InvSlot[loot${lootslot}].Item.Name} to ${NLLootINIFile} defaulting as NDITEM 
      } 
      /if (${NLlootmode.Equal[DROP]}) { 
        /if (${lootslot}>=${loottotal}) { 
          /call Itemsleft 
          /next e 
        } 
        /next lootslot 
      } 
      /if (${NLlootmode.Equal[NDITEM]}) { 
        /if (${Ini[${NLLootINIFile},"${InvSlot[loot${lootslot}].Item.Name.Left[1]}","${InvSlot[loot${lootslot}].Item.Name}"].Equal[NDKeep]}) { 
          /call LootItem ${lootslot} KEEP 
          /if (${lootslot}>=${loottotal}) { 
            /call Itemsleft 
            /next e 
          } 
          /next lootslot 
        } 
        /if (${Ini[${NLLootINIFile},"${InvSlot[loot${lootslot}].Item.Name.Left[1]}","${InvSlot[loot${lootslot}].Item.Name}"].Equal[NDDestroy]}) { 
          /call LootItem ${lootslot} DESTROY 
          /if (${lootslot}>=${loottotal}) { 
            /call Itemsleft 
            /next e 
          }        
          /next lootslot 
        } 
        /if (${Ini[${NLLootINIFile},"${InvSlot[loot${lootslot}].Item.Name.Left[1]}","${InvSlot[loot${lootslot}].Item.Name}"].Equal[NDITEM]}) { 
          /echo Autoloot:  Skipping ${InvSlot[loot${lootslot}].Item.Name} per NDITEM flag 
          /call AudioAlertOn nditem.wav
          /if (${lootslot}>=${loottotal}) { 
            /call Itemsleft 
            /next e 
          } 
          /next lootslot 
        } 
      } 
      /if (${NLlootmode.Equal[ALL]}) { 
        /call LootItem ${lootslot} KEEP 
        /if (${lootslot}>=${loottotal}) { 
          /call Itemsleft 
          /next e 
        } 
        /next lootslot 
      } 
    } 
  |- Loot droppable items and Keep/Destroy by ini flags 
    /if (!${Ini[${NLLootINIFile},"${InvSlot[loot${lootslot}].Item.Name.Left[1]}","${InvSlot[loot${lootslot}].Item.Name}"].Length}) { 
      /ini "${NLLootINIFile}" "${InvSlot[loot${lootslot}].Item.Name.Left[1]}" "${InvSlot[loot${lootslot}].Item.Name}" Keep 
      /echo Autoloot:  Adding ${InvSlot[loot${lootslot}].Item.Name} to ${NLLootINIFile} defaulting as Keep 
    } 
    /if (${Ini[${NLLootINIFile},"${InvSlot[loot${lootslot}].Item.Name.Left[1]}","${InvSlot[loot${lootslot}].Item.Name}"].Equal[Keep]}) { 
      /call LootItem ${lootslot} KEEP 
      /if (${lootslot}>=${loottotal}) { 
        /call Itemsleft 
        /next e 
      }                  
      /next lootslot 
    } 
    /if (${Ini[${NLLootINIFile},"${InvSlot[loot${lootslot}].Item.Name.Left[1]}","${InvSlot[loot${lootslot}].Item.Name}"].Equal[Destroy]}) { 
      /call LootItem ${lootslot} Destroy 
      /if (${lootslot}>=${loottotal}) { 
        /call Itemsleft 
        /next e 
      }          
      /next lootslot 
    } 
    /if (${lootslot}>=${loottotal}) { 
      /call Itemsleft 
      /next e 
    } 
    /next lootslot 
  /next e 
/return 

Sub Itemsleft 
  |-Link remaining items on corpse 
  /if (${Corpse.Items}) { 
    /notify LootWND LW_BroadcastButton leftmouseup 
    /keypress enter chat 
    /call Addcorpse 
  } 
  /notify LootWnd DoneButton leftmouseup 
  /delay 1s !${Corpse.Open} 
/return 

Sub Addcorpse 
  /if (!${Defined[e]}) /declare e int local 
  /for e 20 downto 2 
    /varset NLCorpseskip[${e},1] ${NLCorpseskip[${Math.Calc[${e}-1]},1]} 
    /varset NLCorpseskip[${e},2] ${NLCorpseskip[${Math.Calc[${e}-1]},2]} 
  /next e 
  /varset NLCorpseskip[1,1] ${Target.ID} 
  /varset NLCorpseskip[1,2] ${Math.Calc[${MacroQuest.Running}+1800000]} 
/return 

Sub addnotmykill 
  /if (!${Defined[e]}) /declare e int local 
  /for e 20 downto 2 
    /if (${NLCorpseskip[${e},1]}!=0) /next e 
  /varset NLCorpseskip[${e},1] ${Target.ID} 
  /varset NLCorpseskip[${e},2] ${Math.Calc[${MacroQuest.Running}+180000]} 
/return 

Sub Updatecorpse 
  /if (!${Defined[e]}) /declare e int local 
  /for e 1 to 20 
    /if (!${Spawn[${NLCorpseskip[${e},1]}].ID}) /varset NLCorpseskip[${e},1] 0 
    /if (${NLCorpseskip[${e},2]}<=${MacroQuest.Running} && ${NLCorpseskip[${e},1]}!=0) /varset NLCorpseskip[${e},1] 0 
  /next e 
/return 

Sub LootItem(int lootslot, string handling) 
  /if (${handling.Equal[KEEP]}) /echo Autoloot:  Keeping a ${InvSlot[loot${lootslot}].Item.Name}... WOOT! 
  /if (${handling.Equal[DESTROY]}) /echo Autoloot:  Destroying a ${InvSlot[loot${lootslot}].Item.Name}... Bubbye! 
  :retryloot 
  /itemnotify loot${lootslot} leftmouseup 
  /if (!${Cursor.ID} && ${NLlootmode.Equal[DROP]}) { 
    /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox No_Button leftmouseup 
    /goto :retryloot 
  } 
  /if (!${Cursor.ID} && ${NLlootmode.NotEqual[DROP]}) { 
    /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
    /goto :retryloot 
  } 
  :NLLootItem 
  /if (${handling.Equal[KEEP]}) /autoinventory 
  /if (${handling.Equal[DESTROY]}) /destroy 
  /if (${Cursor.ID}) /goto :NLLootItem 
/return 

Sub LoadAliases 
  /ini "${NLLootINIFile}" Loot Version "${NLVersion}" 
  /squelch /alias /autoloot /echo SetAutoLoot 
  /squelch /alias /lootstatus /echo Autoloot Status 
/return 

Sub BuildINI 
  |- Build a retarded ini, but it makes it alpha ordered 
  /echo Building INI file 
  /ini "${NLLootINIFile}" Loot AutoLootMode OFF 
  /ini "${NLLootINIFile}" Loot AutoLootDistance 50 
  /ini "${NLLootINIFile}" A A NULL 
  /ini "${NLLootINIFile}" B B NULL 
  /ini "${NLLootINIFile}" C C NULL 
  /ini "${NLLootINIFile}" D D NULL 
  /ini "${NLLootINIFile}" E E NULL 
  /ini "${NLLootINIFile}" F F NULL 
  /ini "${NLLootINIFile}" G G NULL 
  /ini "${NLLootINIFile}" H H NULL 
  /ini "${NLLootINIFile}" I I NULL 
  /ini "${NLLootINIFile}" J J NULL 
  /ini "${NLLootINIFile}" K K NULL 
  /ini "${NLLootINIFile}" L L NULL 
  /ini "${NLLootINIFile}" M M NULL 
  /ini "${NLLootINIFile}" N N NULL 
  /ini "${NLLootINIFile}" O O NULL 
  /ini "${NLLootINIFile}" P P NULL 
  /ini "${NLLootINIFile}" Q Q NULL 
  /ini "${NLLootINIFile}" R R NULL 
  /ini "${NLLootINIFile}" S S NULL 
  /ini "${NLLootINIFile}" T T NULL 
  /ini "${NLLootINIFile}" U U NULL 
  /ini "${NLLootINIFile}" V V NULL 
  /ini "${NLLootINIFile}" W W NULL 
  /ini "${NLLootINIFile}" X X NULL 
  /ini "${NLLootINIFile}" Y Y NULL 
  /ini "${NLLootINIFile}" Z Z NULL 
/return 

Sub Updateini 
  /ini "${NLLootINIFile}" "Loot" "AutoLootMode" "${NLlootmode}" 
  /ini "${NLLootINIFile}" "Loot" "AutoLootDistance" "${NLlootdist}" 
/return 

Sub Event_SetAutoLoot(string Line) 
  |- Set the new loot distance, if supplied 
  /if (${Line.Arg[4].Length}) /varset NLlootdist ${Line.Arg[4]} 
  |- Set the mode 
  /if (${Line.Arg[3].Equal[ALL]}) { 
    /varset NLlootmode ALL 
    /echo ** AutoLoot ON - Will loot ALL items 
    /echo ****CAUTION**** Turning off requestor for NODROP items!!!  ****CAUTION**** 
    /echo ** AutoLoot distance is ${NLlootdist} ft. 
    /docommand /lootnodrop never 
    /call Updateini 
    /return 
  } 
  /if (${Line.Arg[3].Equal[DROP]}) { 
    /varset NLlootmode DROP 
    /echo ** AutoLoot ON - Will loot only DROPABLE items 
    /echo ** AutoLoot distance is ${NLlootdist} ft. 
    /docommand /lootnodrop always 
    /call Updateini 
    /return 
  } 
  /if (${Line.Arg[3].Equal[NDITEM]}) { 
    /varset NLlootmode NDITEM 
    /echo ** AutoLoot ON - Will loot only SPECIFIED NO-DROP items 
    /echo ** AutoLoot distance is ${NLlootdist} ft. 
    /docommand /lootnodrop always 
    /call Updateini 
    /return 
  } 
  /if (${Line.Arg[3].Equal[OFF]}) { 
    /varset NLlootmode OFF 
    /echo ** AutoLoot OFF - Will NOT loot any items 
    /call Updateini 
    /return 
  } 
  /echo Syntax:  
  /echo /autoloot <all|drop|nditem|off> <radius#> 
  /echo Defaulting to OFF 
  /varset NLlootmode OFF 
  /call Updateini 
/return 

Sub Event_Autolootstatus 
  /if (${NLlootmode.Equal[ALL]}) { 
    /echo ** AutoLoot ON - Will loot ALL items 
    /echo ****CAUTION**** Turning off requestor for NODROP items!!!  ****CAUTION**** 
    /echo ** AutoLoot distance is ${NLlootdist} ft. 
  } 
  /if (${NLlootmode.Equal[DROP]}) { 
    /echo ** AutoLoot ON - Will loot only DROPABLE items 
    /echo ** AutoLoot distance is ${NLlootdist} ft. 
  } 
  /if (${NLlootmode.Equal[NDITEM]}) { 
    /echo ** AutoLoot ON - Will loot only SPECIFIED NO-DROP items 
    /echo ** AutoLoot distance is ${NLlootdist} ft. 
  } 
  /if (${NLlootmode.Equal[OFF]}) { 
    /echo ** AutoLoot OFF - Will NOT loot any items 
  } 
/return 

Sub Event_NotYourKill 
  /echo Autoloot:  Adding corpse to unable to loot list 
  /call addnotmykill 
  /target clear
/return
 
Macro request from admitted non coder

Users who are viewing this thread

Back
Top