Loot Logger
Description
Saves all your loot messages to a file on your WindBot/files folder.
Configuration
Edit the hideEmpty variable to tell the script whether empty loot messages should not be logged. Also, optionally, change the filename variable to choose the name of the file the log will be saved on.
Code
init start
-- local SCRIPT_VERSION = '1.1.0'
local filename = 'Loot - ' .. $name .. '.txt'
local hideEmpty = false
-- DO NOT EDIT BELOW THIS LINE --
init end
auto(1000)
local handler = nil
foreach newmessage m do
if m.type == MSG_INFO then
local _, loot = m.content:match(REGEX_LOOT)
if loot and (not hideEmpty or loot ~= 'nothing') then
if handler == nil then
handler = io.open(filename, 'a+')
end
handler:write(os.date('%H:%M') .. ' ' .. m.content .. '\n')
end
end
end
if handler ~= nil then
handler:close()
end
Git
Example
Code:10:15 Loot of a ghoul: a ghoul snack, 5 gold coins, a pile of grave earth 10:15 Loot of a crypt shambler: 21 gold coins 10:15 Loot of a crypt shambler: 24 gold coins 10:16 Loot of a crypt shambler: nothing 10:16 Loot of a ghoul: nothing 10:16 Loot of a ghoul: 4 gold coins 10:17 Loot of a crypt shambler: 8 gold coins, 7 worms 10:17 Loot of a ghoul: 24 gold coins 10:17 Loot of a ghoul: nothing 10:17 Loot of a ghoul: 16 gold coins, a life ring 10:18 Loot of a ghoul: 8 gold coins, a worm 10:18 Loot of a crypt shambler: nothing 10:18 Loot of a crypt shambler: nothing 10:18 Loot of a ghoul: 13 gold coins 10:19 Loot of a ghoul: 2 worms 10:19 Loot of a ghoul: a ghoul snack, 10 gold coins 10:19 Loot of a ghoul: 29 gold coins 10:19 Loot of a ghoul: 7 gold coins 10:20 Loot of a crypt shambler: a bone 10:20 Loot of a ghoul: nothing 10:20 Loot of a ghoul: 27 gold coins 10:20 Loot of a ghoul: 7 gold coins 10:20 Loot of a crypt shambler: 2 gold coins 10:21 Loot of a ghoul: nothing 10:21 Loot of a crypt shambler: nothing 10:21 Loot of a ghoul: 27 gold coins 10:22 Loot of a ghoul: 8 gold coins, a torch 10:22 Loot of a ghoul: a gold coin, a pile of grave earth 10:22 Loot of a crypt shambler: nothing 10:22 Loot of a ghoul: 27 gold coins 10:22 Loot of a ghoul: 8 gold coins, a rotten piece of cloth 10:23 Loot of a crypt shambler: nothing 10:23 Loot of a crypt shambler: 27 gold coins 10:23 Loot of a ghoul: nothing 10:24 Loot of a ghoul: 23 gold coins, 2 worms 10:24 Loot of a ghoul: nothing 10:24 Loot of a crypt shambler: nothing 10:24 Loot of a crypt shambler: 19 gold coins, a half-digested piece of meat 10:25 Loot of a ghoul: 18 gold coins, a rotten piece of cloth 10:25 Loot of a ghoul: nothing 10:25 Loot of a crypt shambler: 32 gold coins 10:25 Loot of a crypt shambler: nothing 10:25 Loot of a ghoul: 10 gold coins 10:26 Loot of a ghoul: 28 gold coins 10:32 Loot of a ghoul: 24 gold coins, a torch 10:32 Loot of a ghoul: nothing 10:32 Loot of a crypt shambler: nothing 10:33 Loot of a crypt shambler: 20 gold coins 10:33 Loot of a crypt shambler: nothing 10:33 Loot of a crypt shambler: 14 gold coins 10:33 Loot of a crypt shambler: a bone sword 10:34 Loot of a ghoul: nothing 10:34 Loot of a ghoul: 4 gold coins, a skull 10:34 Loot of a ghoul: nothing 10:34 Loot of a ghoul: nothing 10:35 Loot of a crypt shambler: 12 gold coins, rotten meat