Listener doesn't work after the first message:
local function listening(channel, name, id, msg)
print(msg)
end
LLEvents:on("listen", listening)
ll.Listen(1, "", "", "")
[ typing: /1 hello]
-- > hello
[ typing: /1 hello]
( nothing )
---
Both listeners don't work after the first message to any of them
local function listening(channel, name, id, msg)
print(msg)
end
LLEvents:on("listen", listening)
ll.Listen(1, "", "", "")
ll.Listen(2, "", "", "")
[ typing: /2 hello]
-- > hello
[ typing: /1 hello]
( nothing )
---
Event handlers are in place:
local function listening(channel, name, id, msg)
print(msg)
end
local function touching(events)
for _, eventName in LLEvents:eventNames() do
for _, myHandler in LLEvents:listeners(eventName) do
print(`{eventName} : {debug.info(myHandler,"n")}`)
end
end
end
LLEvents:on("listen", listening)
LLEvents:on("touch_start", touching)
ll.Listen(1, "", "", "")
[ typing: /1 hello]
-- > hello
[ touching ]
-- > touch_start : touching
-- > listen : listening
[ typing: /1 hello]
( nothing )
---
This doesn't work, listeners are removed after calling the event handler:
local function listening(channel, name, id, msg)
print(msg)
ll.Listen(1, "", "", "")
end
LLEvents:on("listen", listening)
ll.Listen(1, "", "", "")
---
This works:
local function listening(channel, name, id, msg)
print(msg)
LLTimers:once(0.1, function()
ll.Listen(1, "", "", "")
ll.Listen(2, "", "", "")
end)
end
LLEvents:on("listen", listening)
ll.Listen(1, "", "", "")
ll.Listen(2, "", "", "")