• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Problem - I thought I understood events

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]
 
cause you are printing line, so the event picks that up as your match, and then it runs again.
 
Problem - I thought I understood events

Users who are viewing this thread

Back
Top
Cart