Skip to content
Outlands Hub

Razor script

Count Items by ID

by alistormccoy · 68 lines
Download

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…

Organizing
Count Items by ID.razor
1# This is an automated backup - check out https://outlands.uorazorscripts.com/script/2521b1ab-27c1-4882-8ed1-f3e812374b30 for latest2# Automation by Jaseowns3## Script: Count Items by ID4## Created by: alistormccoy#05#############################################6 7// Count Items by ID8// This script will count items with the same graphic/ID within a9// container  such as treasure maps, skill scrolls, aspect items,10// etc. and print out the quantity of each uniquely named item.11// It can be somewhat slow with a large amount of items, but it12// certainly beats manually counting! You can retrieve the list13// in plain text from your journal log file. ctrl+f 'AliCount'14 15// set item ID here, type ">info" ingame16@setvar! 'itemID' 882617 18// set Full Count to 0 if you just want the grand total19@setvar! 'Full Count' 120 21// No edit below22overhead 'Target Container'23@setvar! 'container'24 25removelist 'items'26createlist 'items'27 28removelist 'types'29createlist 'types'30 31@clearignore32if findtypelist 'items' 'itemID' 'container'33    sysmsg 'AliCount'34    if 'Full Count' = 135        overhead 'Thinking...'36        foreach 'item' in 'items'37            getlabel 'item' 'desc'38            if inlist 'types' 'desc'39            else40                pushlist 'types' 'desc'41            endif42        endfor43        sysmsg 'Counter Started'44        foreach 'type' in 'types'45            foreach 'item' in 'items'46                getlabel 'item' 'desc'47                if 'type' in 'desc'48                else49                    @ignore 'item'50                endif51            endfor52            if counttype 'itemID' 'container' as 'amount'53                sysmsg '{{type}}: {{amount}}'54            else55                sysmsg '{{type}}: 0'56            endif57            @clearignore58        endfor59    endif60    if counttype 'itemID' 'container' as 'amount'61        sysmsg 'Grand Total: {{amount}}'62    else63        sysmsg 'Grand Total: 0'64    endif65else66    overhead 'No items found matching that itemID'67endif68@clearignore