View unanswered posts | View active topics It is currently Sun Dec 17, 2017 6:00 am



Reply to topic  [ 1 post ] 
 SMS Control Plugin 
Author Message
Junior Member

Joined: Wed Jul 10, 2013 1:37 am
Posts: 3
Medals: 5
RadioBot Owner (1) Longevity (4)
Post 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


Wed Sep 30, 2015 12:32 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.