Soandso2
Well-known member
- Joined
- Mar 13, 2023
- RedCents
- 937¢
I thought I understood events, but apparently I do not. What am I missing?
Upon the first drop I looted, the function updateLoot starts spamming and never stops.
This is the Lua in full (used as a required script in my main Lua script)
[CODE lang="Lua" title="loot.Lua"]local loot = {}
local function lootlist()
print("\awLooted items")
for key,value in pairs(loot) do
print("\ayNumber of \ag"..key.."\ay = "..value)
end
end
local function updateLoot(line,item)
print(line)
if loot[item] == nil then
loot[item] = 1
else
loot[item] = loot[item]+1
end
end
mq.bind('/ll', lootlist)
mq.event("Update","--You have looted #1# from #*#",updateLoot)[/CODE]
Upon the first drop I looted, the function updateLoot starts spamming and never stops.
This is the Lua in full (used as a required script in my main Lua script)
[CODE lang="Lua" title="loot.Lua"]local loot = {}
local function lootlist()
print("\awLooted items")
for key,value in pairs(loot) do
print("\ayNumber of \ag"..key.."\ay = "..value)
end
end
local function updateLoot(line,item)
print(line)
if loot[item] == nil then
loot[item] = 1
else
loot[item] = loot[item]+1
end
end
mq.bind('/ll', lootlist)
mq.event("Update","--You have looted #1# from #*#",updateLoot)[/CODE]

