Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #countcru.cmd
- # .countcru
- # count the total items in a crucible
- #
- # written by Hanryu
- # Please report any bugs to Hanryu#0052 (Discord) or [email protected]
- # This script may be reused in whole or in part as long as credit is given
- # This script is designed to use Oulander, http://outlanderapp.com
- #
- #2020-07-19
- # taken from makeingot.cmd and now standalone
- #2020-12-10
- # added nugget counting
- # 2024-08-13
- # ingot vol counting material echo
- # 2024-09-06
- # fix ingot vol counting with multiple types
- # 2024-09-12
- # count nugs and ingots of same type together
- # turned into a full refactor
- #debug 5
- #### LOAD VARIABLES ####
- var CrucibleCount 0
- var matList
- var c 0
- #### Convert digit to text number ###
- var CONVERT.numbers |first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh
- #### LOAD ACTIONS ####
- action math CrucibleCount add $1 when "^.* - (\d+)"
- action if contains("%$1", "%") then var $1 0;var matList $1|%matList;eval $1 (20 * $2) + %$1 when "^.+enormous (\w+) .+ - (\d+)"
- action if contains("%$1", "%") then var $1 0;var matList $1|%matList;eval $1 (10 * $2) + %$1 when "^.+massive (\w+) .+ - (\d+)"
- action if contains("%$1", "%") then var $1 0;var matList $1|%matList;eval $1 (5 * $2) + %$1 when "^.+huge (\w+) .+ - (\d+)"
- action if contains("%$1", "%") then var $1 0;var matList $1|%matList;eval $1 (4 * $2) + %$1 when "^.+large (\w+) .+ - (\d+)"
- action if contains("%$1", "%") then var $1 0;var matList $1|%matList;eval $1 (3 * $2) + %$1 when "^.+medium (\w+) .+ - (\d+)"
- action if contains("%$1", "%") then var $1 0;var matList $1|%matList;eval $1 (2 * $2) + %$1 when "^.+small (\w+) .+ - (\d+)"
- action if contains("%$1", "%") then var $1 0;var matList $1|%matList;eval $1 (1 * $2) + %$1 when "^.+tiny (\w+) .+ - (\d+)"
- action math c add 1;var ingotMat%c $2|$1;var matList $1|%matList when "an? (.+?) ingot - (\d+)"
- action eval $2 $1 + %$2 when "About (\d+) volumes? of material make up the (\w+) ingot\.$"
- top:
- put count crucible
- put Encumbrance
- waitfor Encumbrance
- put #echo >talk #996633 Items in crucible = %CrucibleCount
- ingotLoop:
- math c subtract 1
- if (%c < 0) then goto echoLoop
- var duplicateIngotCount %ingotMat%c[0]
- duplicateLoop:
- var numeral %CONVERT.numbers[%duplicateIngotCount]
- put count %numeral %ingotMat%c[1] ingot in crucible
- waitforre ^About
- math duplicateIngotCount subtract 1
- if (%duplicateIngotCount < 1) then goto ingotLoop
- else goto duplicateLoop
- echoLoop:
- eval c countsplit("%matList", "|")
- if (%c <= 1) then goto done
- put #echo >talk #ffff00 %matList[0] volumes: %%matList[0]
- #removes duplicates
- eval matList replacere("%matList", "\b%matList[0]s?\b\|?", "")
- goto echoLoop
- done:
- # eval matList replacere("%matList", "\|?%matList[%c]\|?", "")
- put #parse ** COUNTCRU DONE **
- exit
Advertisement
Add Comment
Please, Sign In to add comment