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:
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
- - - Updated - - -
Okay, made a quick and dirty CleanBags sub from DoLootStuff sub and added to Ninjadvloot.inc
Finally code to run:
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.
Works beatifully now! All ornamentations gone.
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:

