SMS Control Plugin
Posted: Wed Sep 30, 2015 12:32 am
I have created a Lua plugin for RadioBot that allows specific users (bound by phone number) control by simply texting the bot. I originally wrote this for ktekradio (I am the lead engineer there), but I've decided to post it here to share and get feedback.
This requires the SMS and Lua plugins to be enabled and set up correctly. Drop the lua file in your RadioBot/lua_scripts and reboot RadioBot.
https://dl.dropboxusercontent.com/u/437 ... mmands.lua
This requires the SMS and Lua plugins to be enabled and set up correctly. Drop the lua file in your RadioBot/lua_scripts and reboot RadioBot.
https://dl.dropboxusercontent.com/u/437 ... mmands.lua
Code: Select all
function np_sms(hostmask, phone, uflags, message)
SendSMS(phone, ProcText("%dj is currently playing %song", 500))
return 0;
end
function skip_sms(hostmask, phone, uflags, message)
if (phone == "xxxxxxxxx") then
SendPM(0, GetDefaultNick(0), "!autodj-next")
SendSMS(phone, "Skipping current track...")
elseif (phone == "xxxxxxxxxx") then
SendPM(0, GetDefaultNick(0), "!autodj-next")
SendSMS(phone, "Skipping current track...")
else
SendSMS(phone, "you are not authorized to use that command!")
end
return 0
end
function kick_dj(hostmask, phone, uflags, message)
if (phone == "xxxxxxxxxx") then
SendPM(0, GetDefaultNick(0), "!ss kicksrc")
SendSMS(phone, "DJ was kicked")
elseif (phone == "xxxxxxxxxx") then
SendPM(0, GetDefaultNick(0), "!ss kicksrc")
SendSMS(phone, "DJ was kicked")
else
SendSMS(phone, "You are not authorized to use that command!")
end
return 0
end
function init()
bind_event("on_sms", "np_sms", "!np")
bind_event("on_sms", "skip_sms", "!skip")
bind_event("on_sms", "kick_dj", "!kick")
return 1;
end