[Request] Plugin to automatically create a channel, then change the description.

dimanche 8 novembre 2015

Is there any plugin to create a channel, then change the description right after it's made? (Like, you make a temporary channel (With no description), then it moves you into it, then it changes the description)

I don't want to make a channel with a description already on it.

The script I found so far is:

Code:

local parentChannelPath = {"User Channels", ""}

local channelName = "CHANNELNAMEHERE"

local channelPath = {"User Channels", channelName, ""}

local password = "PASSWORDHERE"

-- used internal, don't set
local channelID = 0

require("ts3init")

local description = "DESCRIPTIONHERE"


local function onConnectStatusChangeEvent(serverConnectionHandlerID, status, errorNumber)

        if status ~= ts3defs.ConnectStatus.STATUS_CONNECTION_ESTABLISHED then

                return
        end

       
local clientID, error = ts3.getClientID(serverConnectionHandlerID)

        if error ~= ts3errors.ERROR_ok then

                print("Failed to get ClientID: " .. error)

                return
        end

       
local channelID, error = ts3.getChannelIDFromChannelNames(
                serverConnectionHandlerID, channelPath)

        if error ~= ts3errors.ERROR_ok then

                print("Error getting ChannelID: "  .. error)

                return
        end

        if channelID ~= 0 then

                ts3.requestClientMove(
                        serverConnectionHandlerID,
                        clientID,
                        channelID,
                        password)
                return

        end

       
local parentChannelID, error = ts3.getChannelIDFromChannelNames(
                serverConnectionHandlerID, parentChannelPath)

        if error ~= ts3errors.ERROR_ok then

                print("Error getting parent ChannelID: "  .. error)

                return
        end


        ts3.setChannelVariableAsString(                serverConnectionHandlerID, 0,                ts3defs.ChannelProperties.CHANNEL_NAME,
                channelName)

        ts3.setChannelVariableAsString(
                serverConnectionHandlerID, 0,
                ts3defs.ChannelProperties.CHANNEL_PASSWORD,
                password)



        ts3.setChannelVariableAsString(
                serverConnectionHandlerID, 0,
                ts3defs.ChannelProperties.CHANNEL_DESCRIPTION,
                description)       
local error = ts3.flushChannelCreation(
                serverConnectionHandlerID,
                parentChannelID)

        if error ~= ts3errors.ERROR_ok then

                print("Error creating channel: "  .. error)

                return
        end
end

local registeredEvents = {
        onConnectStatusChangeEvent = onConnectStatusChangeEvent
}

-- Register your callback functions with a unique module name.
ts3RegisterModule("AutoCreate", registeredEvents)

It makes the channel with a description and password already on it.

I can pay via BTC if someone could create a plugin for me that does this.
[Request] Plugin to automatically create a channel, then change the description.

0 commentaires:

Enregistrer un commentaire