Results 1 to 11 of 11
Thread: Lua Autoload?
-
13-10-2010, 07:45 #1
-= TeamSpeak User =-
- Join Date
- Aug 2008
- Location
- Mannheim
- Posts
- 16
Lua Autoload?
Hello
my english is not very good
He is the event in the lua enable equal to start with.
I have in this folder lua_plugin a folder under lt
in the folder I have two files
lua init
events lua
lua init:
events.luaCode:require("ts3init") require("lt/events") local registeredEvents = { onTextMessageEvent = lt_events.onTextMessageEvent } ts3RegisterModule("lt", registeredEvents)
it's on but nothingCode:local function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored) ts3.printMessageToCurrentTab("test") end lt_events = { onTextMessageEvent = onTextMessageEvent }
where is the error
-
13-10-2010, 11:40 #2
-= TeamSpeak Fanatic =-
- Join Date
- Sep 2005
- Location
- Germany / Dortmund
- Posts
- 1,282
Call your init-file "init.lua" and try again.
-
13-10-2010, 11:57 #3
-= TeamSpeak User =-
- Join Date
- Aug 2008
- Location
- Mannheim
- Posts
- 16
sry typos
The file is called init.lua
-
13-10-2010, 12:31 #4
-= TeamSpeak Fanatic =-
- Join Date
- Sep 2005
- Location
- Germany / Dortmund
- Posts
- 1,282
The lua plugin currently does not support the onTextMessageEvent in modules.
You can change the function in ts3events.lua to:
Then it should work. But you will do this every time your client gets updated, because the ts3events.lua gets updated as well, as long as the developers change it.Code:function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored) debugPrint("Lua: onTextMessageEvent: " .. serverConnectionHandlerID .. " " .. targetMode .. " " .. toID .. " " .. fromID .. " " .. fromName .. " " .. fromUniqueIdentifier .. " " .. message .. " " .. ffIgnored) for script,events in pairs(ts3RegisteredModules) do if events.onTextMessageEvent ~= nil then events.onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored) end end return 0 -- Client will handle the chat as usual. Return 1 to let the client ignore the chat. end
P.S.: The return value in your function will be ignored.
-
13-10-2010, 12:39 #5
-= TeamSpeak User =-
- Join Date
- Aug 2008
- Location
- Mannheim
- Posts
- 16
yes because I had made my change but because of the updates I wanted it in a module containing
danke
-
13-10-2010, 12:42 #6
-= TeamSpeak Fanatic =-
- Join Date
- Sep 2005
- Location
- Germany / Dortmund
- Posts
- 1,282
Yes, your module will work with that change in the ts3events.lua.
Don't know, why this function is not implemented yet.
-
13-10-2010, 13:39 #7
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 205
Version of this event with using return-value ov event-handlersCode:-- TODO / FIXXED function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored) debugPrint("Lua: onTextMessageEvent: " .. serverConnectionHandlerID .. " " .. targetMode .. " " .. toID .. " " .. fromID .. " " .. fromName .. " " .. fromUniqueIdentifier .. " " .. message .. " " .. ffIgnored) local retValue = 0 local ret = 0 for script,events in pairs(ts3RegisteredModules) do if events.onTextMessageEvent ~= nil then ret = events.onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored) if retValue == 0 then retValue = ret end end end return retValue -- Client will handle the chat as usual. Return 1 to let the client ignore the chat. end
downloadable within this thread
-
18-10-2010, 19:24 #8
-= TeamSpeak User =-
- Join Date
- Oct 2010
- Location
- GER
- Posts
- 3
Any info on when this event is gonna be implemented with an official release? This functionality seems quite important to me.
-
26-10-2010, 10:01 #9
-= TeamSpeak Team =-
- Join Date
- Jun 2008
- Location
- Krün, Germany
- Posts
- 464
Seems I forgot to adjust onTextMessageEvent and onClientPokeEvent (see the "--TODO" comment...) when converting the event mechanism to the new autoload code. Otherwise I cannot really explain why this is missing.

ts3events.lua will be updated.
-
27-10-2010, 16:38 #10
-= TeamSpeak Team =-
- Join Date
- Jun 2008
- Location
- Krün, Germany
- Posts
- 464
For convinience, as the fix didn't make it into the current beta-35 client, I attached the adjusted Lua scripts here for those who are interested.
-
29-10-2010, 16:22 #11
-= TeamSpeak User =-
- Join Date
- Oct 2010
- Location
- GER
- Posts
- 3
Next release is fine, too, now that it's made sure that these won't be overwritten backwards on the next release when updated manually. Thanks a lot.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Lua Kick Script Clients with Version < last Version
By Ra7or in forum ToolsReplies: 21Last Post: 22-08-2010, 12:31 -
Plugins LUA Questions.
By Goluch in forum ToolsReplies: 1Last Post: 30-05-2010, 17:37 -
[Suggestion] Lua window (that doesnt require a console CMDLINE)
By MajorThorn in forum Suggestions and FeedbackReplies: 1Last Post: 11-02-2010, 18:14 -
Serverside LUA engine - Basic questions on the lua handling in ts3
By o21r12 in forum ToolsReplies: 3Last Post: 05-01-2010, 11:06 -
Lua Question
By Fitsch in forum ToolsReplies: 4Last Post: 20-12-2009, 19:37


Reply With Quote