Count Items by ID by alistormccoy
// Count Items by ID
// This script will count items with the same graphic/ID within a
// container such as treasure maps, skill scrolls, aspect items,
// etc. and print out the quantity of each uniquely named item.
// It can be somewhat slow with a large amount of items, but it
// certainly beats manually counting! You can retrieve the list
// in plain text from your journal log file. ctrl+f 'AliCount'
// set item ID here, type ">info" ingame
@setvar! 'itemID' 8826
// set Full Count to 0 if you just want the grand total
@setvar! 'Full Count' 1
// No edit below
overhead 'Target Container'
@setvar! 'container'
removelist 'items'
createlist 'items'
removelist 'types'
createlist 'types'
@clearignore
if findtypelist 'items' 'itemID' 'container'
sysmsg 'AliCount'
if 'Full Count' = 1
overhead 'Thinking...'
foreach 'item' in 'items'
getlabel 'item' 'desc'
if inlist 'types' 'desc'
else
pushlist 'types' 'desc'
endif
endfor
sysmsg 'Counter Started'
foreach 'type' in 'types'
foreach 'item' in 'items'
getlabel 'item' 'desc'
if 'type' in 'desc'
else
@ignore 'item'
endif
endfor
if counttype 'itemID' 'container' as 'amount'
sysmsg '{{type}}: {{amount}}'
else
sysmsg '{{type}}: 0'
endif
@clearignore
endfor
endif
if counttype 'itemID' 'container' as 'amount'
sysmsg 'Grand Total: {{amount}}'
else
sysmsg 'Grand Total: 0'
endif
else
overhead 'No items found matching that itemID'
endif
@clearignore