Updated to OTCv8 3.0 rev 19

This commit is contained in:
OTCv8
2021-04-09 19:01:18 +00:00
parent a26109ce3f
commit 0298cece93
93 changed files with 13452 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
if type(storage.killedCreatures) ~= "table" then
storage.killedCreatures = {}
end
local regex = "Loot of ([a-z])* ([a-z A-Z]*):"
local regex2 = "Loot of ([a-z A-Z]*):"
onTextMessage(function(mode, text)
if not text:lower():find("loot of") then return end
local monster
if #regexMatch(text, regex) == 1 and #regexMatch(text, regex)[1] == 3 then
monster = regexMatch(text, regex)[1][3]
else
monster = regexMatch(text, regex2)[1][2]
end
if storage.killedCreatures[monster] then
storage.killedCreatures[monster] = storage.killedCreatures[monster] + 1
else
storage.killedCreatures[monster] = 1
end
end)