ShoutIRC.com
http://forums.shoutirc.com/

SMS Control Plugin
http://forums.shoutirc.com/viewtopic.php?f=2&t=718
Page 1 of 1

Author:  scooter1993 [ Wed Sep 30, 2015 12:32 am ]
Post subject:  SMS Control Plugin

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

Code:
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

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/