-
-
Save Codeloper/6717da23132e8a4dbf60 to your computer and use it in GitHub Desktop.
Rennschnitzel Support Notifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watchedChannels = { | |
[19] = true, -- Citybuild - Support [1] | |
[20] = true, -- Citybuild - Support [2] | |
[15278] = true, -- Survival Games - Support [1] | |
[22519] = true, -- Survival Games - Support [2] | |
[22631] = true -- Teamspeak - Support | |
} | |
watchedGroups = { | |
[14] = true, -- Gast | |
[25] = true, -- Member | |
[40] = true, -- Elite | |
[41] = true, -- S-Elite | |
[42] = true, -- Champ | |
[43] = true, -- Champ≫ | |
[44] = true, -- YouTuber | |
[45] = true, -- Legend | |
} | |
waveFile = "plugins/lua_plugin/supportnotifier/sounds/sound.wav" | |
timeStampFormat = "%H:%M:%S" | |
supportnotifier_config = { | |
watchedChannels = watchedChannels, | |
watchedGroups = watchedGroups, | |
waveFile = waveFile, | |
timeStampFormat = timeStampFormat | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("supportnotifier/functions") | |
function onClientMoveEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moveMessage) | |
if(supportnotifier.checkForNotify(serverConnectionHandlerID, newChannelID, clientID, visibility)) then | |
supportnotifier.notify(serverConnectionHandlerID, clientID, newChannelID) | |
end | |
end | |
function onClientMoveMovedEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moverID, moverName, moverUniqueIdentifier, moveMessage) | |
if(supportnotifier.checkForNotify(serverConnectionHandlerID, newChannelID, clientID, visibility)) then | |
supportnotifier.notify(serverConnectionHandlerID, clientID, newChannelID) | |
end | |
end | |
supportnotifier_events = { | |
onClientMoveEvent = onClientMoveEvent, | |
onClientMoveMovedEvent = onClientMoveMovedEvent | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("ts3defs") | |
require("ts3errors") | |
require("supportnotifier/config") | |
local function playWave(serverConnectionHandlerID) | |
local error = ts3.playWaveFile(serverConnectionHandlerID, supportnotifier_config.waveFile) | |
if error ~= ts3errors.ERROR_ok then | |
print("Error playing wave file: " .. error) | |
end | |
end | |
function checkForNotify(serverConnectionHandlerID, channelID, clientID, visibility) | |
if(visibility == ts3defs.Visibility.LEAVE_VISIBILITY) then | |
return false | |
end | |
if(clientID == ts3.getClientID(serverConnectionHandlerID)) then | |
return false | |
end | |
if(channelID == ts3.getChannelOfClient(serverConnectionHandlerID, ts3.getClientID(serverConnectionHandlerID))) then | |
return false | |
end | |
local firstGroup = tonumber(string.sub(ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_SERVERGROUPS), 1, 2)) | |
if(supportnotifier_config.watchedGroups[firstGroup] and supportnotifier_config.watchedChannels[channelID]) then | |
return true | |
end | |
return false | |
end | |
function notify(serverConnectionHandlerID, clientID, channelID) | |
playWave(serverConnectionHandlerID) | |
ts3.printMessageToCurrentTab("[i]<" .. os.date(supportnotifier_config.timeStampFormat) .. ">[/i] [url=client://" .. clientID .. "/" .. ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_UNIQUE_IDENTIFIER) .. ']"' .. ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_NICKNAME) .. '"[/url] ist in [url=channelid://' .. channelID .. "]" .. ts3.getChannelVariableAsString(serverConnectionHandlerID, channelID, ts3defs.ChannelProperties.CHANNEL_NAME) .. "[/url] gejoint!") | |
end | |
function soundDir() | |
ts3.printMessageToCurrentTab(tostring(ts3.getPluginPath()) .. "lua_plugin/supportnotifier/sounds") | |
end | |
supportnotifier = { | |
checkForNotify = checkForNotify, | |
notify = notify, | |
soundDir = soundDir | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Rennschnitzel teamspeak support notifier by Codeloper | |
require("ts3init") | |
require("supportnotifier/events") | |
local MODULE_NAME = "supportnotifier" | |
local registeredEvents = { | |
onClientMoveEvent = supportnotifier_events.onClientMoveEvent, | |
onClientMoveMovedEvent = supportnotifier_events.onClientMoveMovedEvent | |
} | |
ts3RegisterModule(MODULE_NAME, registeredEvents) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment