Kod:
 
-- Mass Control Module Source
-- Version: 1.2
-- Author: OGULCAN SAYAN
-- Website: YAKINDA
-- E-Mail: [email protected]
--
require("ts3defs")
require("ts3errors")
--
-- Call these function from the TeamSpeak 3 client console via: /lua run <function>
-- Note the serverConnectionHandlerID of the current server is always passed.
--
--
-- Run with "/lua run getMyChanID"
--
-- Show the curren channel ID that you are in
--
function getChannelID(serverConnectionHandlerID)
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    -- Get which channel we are in
    local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own channel: " .. error)
        return
    end
    ts3.printMessageToCurrentTab("Channel ID = " .. myChannelID .. "")
end
--
-- Run with "/lua run mm"
--
-- Mass Mover Script (within currently subscribed channel)
--
function mm(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Odaya Cekme Scripti Versiyon 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    -- Get which channel we are in
    local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own channel: " .. error)
        return
    end
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    local password = ""
    if type(arg[1]) ~= "nil" then
        password = arg[1]
        ts3.printMessageToCurrentTab("== Odaya Cekme Basarili :) " .. #clients - 1 .. " visible clients (Using Password: " .. password .. " ) ==")
    else
        ts3.printMessageToCurrentTab("== Odaya Cekme Basarili :) " .. #clients - 1 .. " ==")
    end
    local counter = 0
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestClientMove(serverConnectionHandlerID, clients[i], myChannelID, password)
            if error == ts3errors.ERROR_ok then
                counter = counter + 1
            else
                clientName = "Error getting client name"
            end
        end
    end
    ts3.printMessageToCurrentTab("== Odaya Cekilen Kisi " .. counter .. " / " .. #clients - 1 .. " clients. ==")
end
--
-- Run with "/lua run mp <message>"
--
-- Mass Poke Script (within currently subscribed channel)
--
function mp(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Herkesi Pokeleme Scripti Versiyon 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    -- Get which channel we are in
    local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own channel: " .. error)
        return
    end
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    -- Process Argument message
    local argMsg = ""
    for i,v in ipairs(arg) do
        argMsg = argMsg .. tostring(v) .. " "
    end
    local counter = 0
    ts3.printMessageToCurrentTab("== Pokeleme İslemi Basarili :) " .. #clients - 1 .. " visible clients ==")
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestClientPoke(serverConnectionHandlerID, clients[i], argMsg)
            if error == ts3errors.ERROR_ok then
                counter = counter + 1
            else
                print("Error poking client ID: " .. clients[i] .. "\n")
            end
        end
    end
    ts3.printMessageToCurrentTab("== Pokelenen Kişi Sayısı " .. counter .. "/" .. #clients - 1 .. " clients ==")
end
--
-- Run with "/lua run mmsg <message>"
--
-- Mass Messaging Script (within currently subscribed channel)
--
function mmsg(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Herkese Mesaj Gonderme Scripti Versiyon 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    -- Get which channel we are in
    local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own channel: " .. error)
        return
    end
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    -- Process Argument message
    local argMsg = ""
    for i,v in ipairs(arg) do
        argMsg = argMsg .. tostring(v) .. " "
    end
    local counter = 0
    ts3.printMessageToCurrentTab("== Mesaj Gonderme Basarili :) " .. #clients - 1 .. " visible clients ==")
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, argMsg, clients[i])
            if error == ts3errors.ERROR_ok then
                counter = counter + 1
            else
                print("Error messaging client ID: " .. clients[i] .. "\n")
            end
        end
    end
    ts3.printMessageToCurrentTab("== Mesaj Gonderilen Kisi " .. counter .. "/" .. #clients - 1 .. " clients ==")
end
--
-- Run with "/lua run mmp <message>"
--
-- Mass Message & Poke Script (within currently subscribed channel)
--
function mmp(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Mass Control Module Version 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    -- Get which channel we are in
    local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own channel: " .. error)
        return
    end
    ts3.printMessageToCurrentTab("Channel ID = " .. myChannelID .. ".")
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    -- Process Argument message
    local argMsg = ""
    for i,v in ipairs(arg) do
        argMsg = argMsg .. tostring(v) .. " "
    end
    local msgcounter = 0
    local pokecounter = 0
    ts3.printMessageToCurrentTab("== Mass poking & messaging " .. #clients - 1 .. " visible clients ==")
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestClientPoke(serverConnectionHandlerID, clients[i], argMsg)
            if error == ts3errors.ERROR_ok then
                pokecounter = pokecounter + 1
            else
                print("Error poking client ID: " .. clients[i] .. "\n")
            end
            local error = ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, argMsg, clients[i])
            if error == ts3errors.ERROR_ok then
                msgcounter = msgcounter + 1
            else
                print("Error messaging client ID: " .. clients[i] .. "\n")
            end
        end
    end
    ts3.printMessageToCurrentTab("== Successfully poked " .. pokecounter .. "/" .. #clients - 1 .. " clients, and messaged " .. msgcounter .. "/" .. #clients - 1 .. " clients ==")
end
--
-- Run with "/lua run gmm"
--
-- Global Mass Mover Script (subscribe all possible channels before moving)
--
function gmm(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Mass Control Module Version 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    -- Get which channel we are in
    local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own channel: " .. error)
        return
    end
    ts3.printMessageToCurrentTab("Channel ID = " .. myChannelID .. ".")
    local error = ts3.requestChannelSubscribeAll(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error subscribing channel: " .. error)
        return
    end
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    local password = ""
    if type(arg[1]) ~= "nil" then
        password = arg[1]
        ts3.printMessageToCurrentTab("== Mass moving " .. #clients - 1 .. " visible clients (Using Password: " .. password .. " ) ==")
    else
        ts3.printMessageToCurrentTab("== Mass moving " .. #clients - 1 .. " ==")
    end
    local counter = 0
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestClientMove(serverConnectionHandlerID, clients[i], myChannelID, password)
            if error == ts3errors.ERROR_ok then
                counter = counter + 1
            else
                clientName = "Error getting client name"
            end
        end
    end
    ts3.printMessageToCurrentTab("== Successfully moved " .. counter .. " / " .. #clients - 1 .. " clients. ==")
end
--
-- Run with "/lua run gmp <message>"
--
-- Global Mass Poke Script (subscribe all possible channels before moving)
--
function gmp(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Mass Control Module Version 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    local error = ts3.requestChannelSubscribeAll(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error subscribing channel: " .. error)
        return
    end
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    -- Process Argument message
    local argMsg = ""
    for i,v in ipairs(arg) do
        argMsg = argMsg .. tostring(v) .. " "
    end
    local counter = 0
    ts3.printMessageToCurrentTab("== Mass poking " .. #clients - 1 .. " visible clients ==")
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestClientPoke(serverConnectionHandlerID, clients[i], argMsg)
            if error == ts3errors.ERROR_ok then
                counter = counter + 1
            else
                print("Error poking client ID: " .. clients[i] .. "\n")
            end
        end
    end
    ts3.printMessageToCurrentTab("== Successfully poked " .. counter .. "/" .. #clients - 1 .. " clients ==")
end
--
-- Run with "/lua run gmmsg <message>"
--
-- Global Mass Message Script (subscribe all possible channels before moving)
--
function gmmsg(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Mass Control Module Version 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    local error = ts3.requestChannelSubscribeAll(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error subscribing channel: " .. error)
        return
    end
    -- Get which channel we are in
    local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own channel: " .. error)
        return
    end
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    -- Process Argument message
    local argMsg = ""
    for i,v in ipairs(arg) do
        argMsg = argMsg .. tostring(v) .. " "
    end
    local counter = 0
    ts3.printMessageToCurrentTab("== Mass messaging " .. #clients - 1 .. " visible clients ==")
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, argMsg, clients[i])
            if error == ts3errors.ERROR_ok then
                counter = counter + 1
            else
                print("Error messaging client ID: " .. clients[i] .. "\n")
            end
        end
    end
    ts3.printMessageToCurrentTab("== Successfully messaged " .. counter .. "/" .. #clients - 1 .. " clients ==")
end
--
-- Run with "/lua run gmmp <message>"
--
-- Global Mass Message & Poke Script (subscribe all possible channels before moving)
--
function gmmp(serverConnectionHandlerID, ...)
    ts3.printMessageToCurrentTab("= Mass Control Module Version 1.2 by [[email protected]]OGULCAN SAYAN =")
    -- Get Self ID
    local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
    if error ~= ts3errors.ERROR_ok then
        print("Error getting own client ID: " .. error)
        return
    end
    if myClientID == 0 then
        ts3.printMessageToCurrentTab("Not connected")
        return
    end
    local error = ts3.requestChannelSubscribeAll(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error subscribing channel: " .. error)
        return
    end
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    if error == ts3errors.ERROR_not_connected then
        ts3.printMessageToCurrentTab("Not connected")
        return
    elseif error ~= ts3errors.ERROR_ok then
        print("Error getting client list: " .. error)
        return
    end
    -- Process Argument message
    local argMsg = ""
    for i,v in ipairs(arg) do
        argMsg = argMsg .. tostring(v) .. " "
    end
    local msgcounter = 0
    local pokecounter = 0
    ts3.printMessageToCurrentTab("== Mass poking & messaging " .. #clients - 1 .. " visible clients ==")
    for i=1, #clients do
        if clients[i] ~= myClientID then
            local error = ts3.requestClientPoke(serverConnectionHandlerID, clients[i], argMsg)
            if error == ts3errors.ERROR_ok then
                pokecounter = pokecounter + 1
            else
                print("Error poking client ID: " .. clients[i] .. "\n")
            end
            local error = ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, argMsg, clients[i])
            if error == ts3errors.ERROR_ok then
                msgcounter = msgcounter + 1
            else
                print("Error messaging client ID: " .. clients[i] .. "\n")
            end
        end
    end
    ts3.printMessageToCurrentTab("== Pokeleme Basarili " .. pokecounter .. "/" .. #clients - 1 .. " clients, and messaged " .. msgcounter .. "/" .. #clients - 1 .. " clients ==")
end   Sadece Pokelem Başarılı Gerisine Bakın