• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Request - Macro to Clean Bags using Loot.ini ?

Is there already an existing macro to utilize ninjadvloot.inc loot.ini to clean up existing items in bags/inventory?

For example, today EQ patched in some new ornaments of which I have tons of now.

When I noticed I added the following:

Rich (BB code):
Erollisi's Twin Hearts Head Ornament=Destroy

Now, I would like to go through bags and destroy those ornaments using the settings in loot.ini .
Everthing that is =Destroy would be destroyed rest would be kept.

The destroy part is easy, just need something to read =Destroy values from loot.ini

Rich (BB code):
	/while (${FindItem[=Rusty Axe].InvSlot}) {
	    /shift /itemnotify ${FindItem[=Rusty Axe].InvSlot} leftmouseup
	    /delay 5
	    /if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
	    /delay ${destroydelay}
	}

- - - Updated - - -

Okay, made a quick and dirty CleanBags sub from DoLootStuff sub and added to Ninjadvloot.inc

Rich (BB code):
Sub CleanBags
    /declare i int local
    /declare j int local
    /declare k int local
    /declare LootItem string
   | Top level inv has its own loop since ${FindItem[=${ItemToSell}].InvSlot} looks at top lev inv slots first in Sub SellToVendor for the item to sell.
   | Loop through top level inventory slots for sellable items
   /for k 1 to 10
        | Check if top level inv slot is not a container/bag
        /if (${InvSlot[pack${k}].Item.Container}==0) {
            | If top level inv slot is empty check for an item marked sell
            /if (${InvSlot[pack${k}].Item.ID}) {
                /varset LootItem ${InvSlot[pack${k}].Item}
				/if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Destroy]}) /call DestroyAll "${LootItem}"
            }
        }
    /next k      
    | Loop through top level inventory slots for containers
    /for i 1 to 10
        | Check if top level inv slot has a bag
        /if (${InvSlot[pack${i}].Item.Container}==0) /next i
        | Set j 1 to number of bag slots and loop through slots looking for items marked sell
        /for j 1 to ${InvSlot[pack${i}].Item.Container}
            /if (${InvSlot[pack${i}].Item.Item[${j}].ID}) {
            /varset LootItem ${InvSlot[pack${i}].Item.Item[${j}].Name}
			/if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Destroy]}) /call DestroyAll "${LootItem}"
            }
        /next j
    /next i
/return

Rich (BB code):
Sub DestroyAll(ItemName)
		/echo Destroying all ${ItemName} in inventory
		/while (${FindItem[=${ItemName}].InvSlot}) {
			/shift /itemnotify ${FindItem[=${ItemName}].InvSlot} leftmouseup
			/delay 5
			/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
			/delay 5 
		}
		/echo all ${ItemName} should be destroyed
/return

Finally code to run:
Rich (BB code):
#include Ninjadvloot.inc

Sub Main
	/call SetupAdvLootVars
	/call CleanBags
	/echo should be done 
/return

This only works for cleaning items in your inventory slots not inside bags, so what does it need to see inside bags?

EDIT2:
Solved it! Needed to open bags first.

Rich (BB code):
Sub DestroyAll(ItemName)
		/keypress OPEN_INV_BAGS
		/echo Destroying all ${ItemName} in inventory
		/while (${FindItem[=${ItemName}].InvSlot}) {
			/shift /itemnotify ${FindItem[=${ItemName}].InvSlot} leftmouseup
			/delay 5
			/if (${Cursor.ID} && ${Cursor.ID} != 13073) /destroy
			/delay 5 
		}
		/echo all ${ItemName} should be destroyed
		/keypress CLOSE_INV_BAGS
/return

Works beatifully now! All ornamentations gone. :)
 
Last edited:
Replace
Rich (BB code):
/shift /itemnotify ${FindItem[=${ItemName}].InvSlot} leftmouseup
with this
Rich (BB code):
/shift /itemnotify "${ItemName}" leftmouseup
This should grab the item if the bag is closed.
 
Request - Macro to Clean Bags using Loot.ini ?

Users who are viewing this thread

Back
Top
Cart