B1uscr34m

JoinSpam

Feb 15th, 2015
316
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require("ts3init")
  2. require("ts3defs")
  3. require("ts3events")
  4. local myMSG = "FÜGE HIER DEINE NACHRICHT EIN!"
  5. troll_mode = false
  6. troll_mode2 = false
  7. function troll(serverConnectionHandlerID)
  8.     if troll_mode == true then
  9.         troll_mode = false
  10.         ts3.printMessageToCurrentTab("Troll mode set to \"FALSE\"")
  11.     else
  12.         troll_mode = true
  13.         ts3.printMessageToCurrentTab("Troll mode set to \"TRUE\"")
  14.     end
  15. end
  16. function troll2(serverConnectionHandlerID)
  17.     if troll_mode2 == true then
  18.         troll_mode2 = false
  19.         ts3.printMessageToCurrentTab("Troll mode 2 set to \"FALSE\"")
  20.     else
  21.         troll_mode2 = true
  22.         ts3.printMessageToCurrentTab("Troll mode 2 set to \"TRUE\"")
  23.     end
  24. end
  25. function randomNick(serverConnectionHandlerID)
  26.     local nameArray = { 'TeamspeakUser', 'TeamSpeakUser', 'Android', 'Android_Client', 'IPhone', 'IPhone_Client' }
  27.     local RANDNAME = ( nameArray[ math.random( #nameArray ) ] )
  28.     local newNick = RANDNAME .. math.random(1,99)
  29.     ts3.printMessageToCurrentTab("Renaming self to "..newNick..".")
  30.     ts3.setClientSelfVariableAsString(serverConnectionHandlerID, ts3defs.ClientProperties.CLIENT_NICKNAME, newNick)
  31.     local error = ts3.flushClientSelfUpdates(serverConnectionHandlerID)
  32.     if error ~= ts3errors.ERROR_ok then
  33.         ts3.printMessageToCurrentTab("Error renaming to "..newnick..", ErrorID: "  .. error)
  34.         return
  35.     end
  36. end
  37. function onNewChannelCreatedEvent(serverConnectionHandlerID, channelID, channelParentID, invokerID, invokerName, invokerUniqueIdentifier)
  38.     if troll_mode == true then
  39.         local channelPassworded = ts3.getChannelVariableAsInt(serverConnectionHandlerID, channelID, ts3defs.ChannelProperties.CHANNEL_FLAG_PASSWORD)
  40.         if channelPassworded == 0 then
  41.             local clientID = ts3.getClientID(serverConnectionHandlerID)
  42.             ts3.requestClientMove(serverConnectionHandlerID, clientID, channelID, myMSG)
  43.             ts3.requestSendChannelTextMsg(serverConnectionHandlerID, myMSG, channelID)
  44.             randomNick(serverConnectionHandlerID)
  45.         end
  46.     end
  47. end
  48. function onClientMoveEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moveMessage)
  49.     if troll_mode2 == true then
  50.         local clientIDown = ts3.getClientID(serverConnectionHandlerID)
  51.         if clientID == clientIDown then
  52.             ts3.requestSendChannelTextMsg(serverConnectionHandlerID, myMSG, channelID)
  53.             randomNick(serverConnectionHandlerID)
  54.         end
  55.     end
  56. end
  57. local registeredEvents = {
  58.     onNewChannelCreatedEvent = onNewChannelCreatedEvent,
  59.     onClientMoveEvent = onClientMoveEvent
  60. }
  61.  
  62. ts3RegisterModule(joinplusspam, registeredEvents)
RAW Paste Data