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