Originally Posted by SnowmanDK
For now I have ended up with this (a kind of a mix):
Lua Code:
-- if string.find(icon, "centipede") then --Crawlers ...
|
Just a little tip to make that part more concise with just two string matches (using a table for counts instead of individual local vars):
Lua Code:
-- at file scope
local bait_to_water = {
centipede="Foul", fish_roe="Foul",
torchbug="River", shad="River",
worms="Ocean", fish_tail="?",
guts="Lake", river_betty="Lake"
}
-- in func
local counts = {}
-- in loop
local k = icon:match("centipede|fish_roe|torchbug|shad|worms|fish_tail|guts|river_betty")
local water = bait_to_water[k]
if water == "?" then
if name:find("simple|einfacher|appāt") then --Simle Bait
water = "General"
else --Chub
water = "Ocean"
end
end
if water then
counts[water] = (counts[water] or 0) + stack
end