Advertisement
Guest User

Untitled

a guest
May 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. Ok i'm not familiar with LUA myself, so dont take this as a masterpiece
  2.  
  3. download the attachment, extract it to
  4. TS3Folder/plugins/lua_plugin
  5. so you have
  6. TS3Folder/plugins/lua_plugin/autojoin/init.lua
  7. in the end.
  8.  
  9. you can edit the file...right at the start the "home channel" is defined, so you can edit it easily
  10.  
  11. enable the lua plugin and in the preferences of the plugin you have to enable the "autojoin" script. good luck
  12.  
  13. here the code, if someone else is interested
  14. Code:
  15.  
  16.  
  17.  
  18.  
  19. require("ts3init") -- Required for ts3RegisterModulerequire("ts3defs")
  20.  
  21.  
  22. local MODULE_NAME = "autojoin"
  23. local home_channel = "Eingangshalle"
  24.  
  25.  
  26. local function localOnTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
  27. if targetMode == ts3defs.TextMessageTargetMode.TextMessageTarget_CLIENT then
  28. clientID = ts3.getClientID(serverConnectionHandlerID)
  29. if message == ".joinme" then
  30. newChannelID = ts3.getChannelOfClient(serverConnectionHandlerID, fromID)
  31. ts3.requestClientMove(serverConnectionHandlerID, clientID, newChannelID, "")
  32. elseif message == ".home" then
  33. channelList, err = ts3.getChannelList(serverConnectionHandlerID)
  34. for i, channelID in ipairs(channelList) do
  35. if home_channel == ts3.getChannelVariableAsString(serverConnectionHandlerID, channelID, ts3defs.ChannelProperties.CHANNEL_NAME) then
  36. homeChannelID = channelID
  37. break
  38. end
  39. end
  40. ts3.requestClientMove(serverConnectionHandlerID, clientID, homeChannelID, "")
  41. end
  42. end
  43. return 0
  44. end
  45.  
  46.  
  47. -- Define which callbacks you want to receive in your module. Callbacks not mentioned
  48. -- here will not be called. To avoid function name collisions, your callbacks should
  49. -- be put into an own package.
  50. local registeredEvents = {
  51. onTextMessageEvent = localOnTextMessageEvent
  52. }
  53.  
  54.  
  55. -- Register your callback functions with a unique module name.
  56. ts3RegisterModule(MODULE_NAME, registeredEvents)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement