Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ok i'm not familiar with LUA myself, so dont take this as a masterpiece
- download the attachment, extract it to
- TS3Folder/plugins/lua_plugin
- so you have
- TS3Folder/plugins/lua_plugin/autojoin/init.lua
- in the end.
- you can edit the file...right at the start the "home channel" is defined, so you can edit it easily
- enable the lua plugin and in the preferences of the plugin you have to enable the "autojoin" script. good luck
- here the code, if someone else is interested
- Code:
- require("ts3init") -- Required for ts3RegisterModulerequire("ts3defs")
- local MODULE_NAME = "autojoin"
- local home_channel = "Eingangshalle"
- local function localOnTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
- if targetMode == ts3defs.TextMessageTargetMode.TextMessageTarget_CLIENT then
- clientID = ts3.getClientID(serverConnectionHandlerID)
- if message == ".joinme" then
- newChannelID = ts3.getChannelOfClient(serverConnectionHandlerID, fromID)
- ts3.requestClientMove(serverConnectionHandlerID, clientID, newChannelID, "")
- elseif message == ".home" then
- channelList, err = ts3.getChannelList(serverConnectionHandlerID)
- for i, channelID in ipairs(channelList) do
- if home_channel == ts3.getChannelVariableAsString(serverConnectionHandlerID, channelID, ts3defs.ChannelProperties.CHANNEL_NAME) then
- homeChannelID = channelID
- break
- end
- end
- ts3.requestClientMove(serverConnectionHandlerID, clientID, homeChannelID, "")
- end
- end
- return 0
- end
- -- Define which callbacks you want to receive in your module. Callbacks not mentioned
- -- here will not be called. To avoid function name collisions, your callbacks should
- -- be put into an own package.
- local registeredEvents = {
- onTextMessageEvent = localOnTextMessageEvent
- }
- -- Register your callback functions with a unique module name.
- ts3RegisterModule(MODULE_NAME, registeredEvents)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement