- Fri May 10, 2013 6:05 pm
#721
Hello everyone,
there is a little lua script I made for teamspeak so you can use hotkeys to manage the volume of the bot (you can use them wihtout having the focus on Teamspeak).
Installation
You'll need two files for this plugin to work, the first one is init.lua
You'll have to enable the Lua Plugin in Teamspeak, to do so follow these steps :
Settings->Plugins (or CTRL+SHIFT+P) and be sure that Lua Plugin is checked, you can now close the window.
You should now be able to use the following commands on the Teamspeak chat :
To do so enter the options menu (Settings->Options or ALT+P) and find the Hotkeys sub-menu.
How it works :
Everytime you'll press a hotkey it will check if the TS3MusicBot client is on your server (you wont see it but he's here if your Music Bot is connected) and will send him the command, allowing you to manage the volume of your bot while doing something else. You won't have to use the commands or the web interface anymore!
You can customize the script as you want. For example you can add commands to run a given playlist with a simple hotkey etc.
Hope you'll enjoy the script, if you have any question you can ask me.
Hf
there is a little lua script I made for teamspeak so you can use hotkeys to manage the volume of the bot (you can use them wihtout having the focus on Teamspeak).
Installation
You'll need two files for this plugin to work, the first one is init.lua
Code: Select all
the second one is msgbot.lua
require("ts3init") -- Required for ts3RegisterModule
require("msgbot/msgbot") -- Function file
-- Register the callback function
local MODULE_NAME = "msgbot"
ts3RegisterModule(MODULE_NAME, registeredEvents)
Code: Select all
Now go to your lua plugins directory in your Teamspeak installation folder (C:\Program Files\TeamSpeak 3 Client\plugins\lua_plugin, it might change if you installed Teamspeak in a different place) and create a folder named msgbot. Now place both init.lua and msgbot.lua in the freshly created folder.require("ts3defs")
require("ts3errors")
local function sendToMusicBot(message)
local botId = NULL
local clients, error = ts3.getClientList(1)
for i=1, #clients do
local clientName, error = ts3.getClientVariableAsString(1, clients[i], ts3defs.ClientProperties.CLIENT_NICKNAME)
if clientName == "TS3MusicBot" then
botId = clients[i]
end
end
if botId ~= NULL then
ts3.requestSendPrivateTextMsg(1, message, botId)
else
ts3.printMessageToCurrentTab("Can't reach TS3MusicBot")
end
end
local function voldefault()
cmd = "!volume 5"
sendToMusicBot(cmd)
end
local function volup()
cmd = "!volume +"
sendToMusicBot(cmd)
end
local function voldown()
cmd = "!volume -"
sendToMusicBot(cmd)
end
msgbot = {
voldefault = voldefault,
volup = volup,
voldown = voldown
}
You'll have to enable the Lua Plugin in Teamspeak, to do so follow these steps :
Settings->Plugins (or CTRL+SHIFT+P) and be sure that Lua Plugin is checked, you can now close the window.
You should now be able to use the following commands on the Teamspeak chat :
Code: Select all
If you encounter errors try the following commands :
/lua run msgbot.volup
/lua run msgbot.voldown
/lua run msgbot.voldefault
Code: Select all
and
/lua load msgbot/init.lua
Code: Select all
To use the commands as hotkeys on Teamspeak./lua load msgbot/msgbot.lua
To do so enter the options menu (Settings->Options or ALT+P) and find the Hotkeys sub-menu.
- Add a new hotkey
- Assign keys
- Click on "Show Advanced Actions"
- Find "Plugins" and "Run Plugin Command"
- Enter one of the following commands :
- /lua run msgbot.volup (same command as !volume +)
- /lua run msgbot.voldown (same command as !volume -)
- /lua run msgbot.voldefault (same command as !volume 5, you can change the default value in the script)
How it works :
Everytime you'll press a hotkey it will check if the TS3MusicBot client is on your server (you wont see it but he's here if your Music Bot is connected) and will send him the command, allowing you to manage the volume of your bot while doing something else. You won't have to use the commands or the web interface anymore!
You can customize the script as you want. For example you can add commands to run a given playlist with a simple hotkey etc.
Hope you'll enjoy the script, if you have any question you can ask me.
Hf