Housekeeping macro

Tribunalite

I ask a lot of questions!
Joined
Apr 23, 2006
Messages
286
Reaction score
4
Points
18
Location
USA
I've gathered a lot of junk I didn't mean to loot. Is there a code snippet I could use that would go through my bags (or bank) and destroy items off an .ini?
 
I think this will do what you want. But this is untested so I've set it up so that it will not actually destroy anything until you change the /declare doDestroy bool local FALSE to TRUE. But it will echo a message saying what it's going to destroy, that way you can make sure it works before letting it actually destroy anything =P

I set it to use an INI named destroy.ini in the format:
[Destroy]
Item Name=TRUE
Another Item Name=TRUE

If the item is not found in the INI, or the INI setting for the item is not set to TRUE then it should not destroy the item.

This could be done better, but just something I whipped up really quick hehe.

Code:
Sub main
	/declare pLoop int local 0
	/declare bLoop int local 0
	/declare destItem int local 0
	/declare doDestroy bool local FALSE
	
	
	/for pLoop 1 to 10
		/if (${Me.Inventory[pack${pLoop}].Container}) {
			/for bLoop 1 to ${Me.Inventory[pack${pLoop}].Container}
				/if (${Me.Inventory[pack${pLoop}].Item[${bLoop}].Name.NotEqual[NULL]} && ${Ini[destroy.ini,Destroy,"${Me.Inventory[pack${pLoop}].Item[${bLoop}].Name}",FALSE].Equal[TRUE]}) {
					/echo Will destroy ${Me.Inventory[pack${pLoop}].Item[${bLoop}].Name} in pack ${pLoop} slot ${bLoop}
					/if (${doDestroy}) {
						/varset destItem ${Me.Inventory[pack${pLoop}].Item[${bLoop}].ID}
						/itemnotify ${Me.Inventory[pack${pLoop}].Item[${bLoop}].InvSlot} leftmouseup
						/delay 5s ${Cursor.ID}==${destItem}
						/if (${Cursor.ID} && ${Cusor.ID}==${destItem}) {
							/destroy
						} else {
							/autoinventory
						}
						/delay 5s !${Cursor.ID}
					}
				}				
			/next bLoop
		} else {
			/if (${Me.Inventory[pack${pLoop}].Name.NotEqual[NULL]} && ${Ini[destroy.ini,Destroy,"${Me.Inventory[pack${pLoop}].Name}",FALSE].Equal[TRUE]}) {
				/echo Will destroy ${Me.Inventory[pack${pLoop}].Name} in primary inventory slot ${pLoop}
				/if (${doDestroy}) {
					/varset destItem ${Me.Inventory[pack${pLoop}].ID}
					/itemnotify ${Me.Inventory[pack${pLoop}].InvSlot} leftmouseup
					/delay 5s ${Cursor.ID}==${destItem}
					/if (${Cursor.ID} && ${Cusor.ID}==${destItem}) {
						/destroy
					} else {
						/autoinventory
					}				
					/delay 5s !${Cursor.ID}	
				}
			}
		}
	/next pLoop
/return

EDIT:
Added a little extra checking to make sure the item you are trying to destroy is actually the item on the cursor, and if not auto inventories the item.
 
Last edited: