-- OpBotv0.3.lua -- -- Updated so that data was intercepted by a bot, by Nathanos Jan-03, 2003 -- Updated OpBot.lua, modified by Nathanos Jan-02, 2003 -- Preliminary OpBot.lua, created by aMutex Dec-31, 2002 -- -- Send the following commands as a private message to OpBot: -- -- +addop Add a new operator [SuperOps] -- +adduser Add a new registered user -- +chmypasswd Change your own password -- +chred Change redirect address [SuperOps] -- +deleteuser Delete an existing operator or registered user [SuperOps] -- +ophelp Display operator help screen -- +redirectallnow Redirect all users immediately to redirect address [SuperOps] -- +sethubdesc Set the hub description -- +sethubname Set the hub name -- +setmaxusers Set the hub's maximum number of connections -- +setredirectall Set redirect all newly connecting users on or off [SuperOps] -- +setredirectfull Set redirect when max connections reached on or off [SuperOps] -- -- Note that spaces are used to differentiate between arguments. This means that if you want to -- change the hub description to "My Uber Hub", you must type "+sethubdesc My_Uber_Hub" minus quotes -- -- -- -- Super Ops have the ability to do more commands than Normal Ops -- Add your Super Ops below replacing OperatorOne and OperatorTwo etc. SuperOps = {"Nathanos", "OperatorOne", "OperatorTwo"} Bot = "OpBot" function Main() frmHub:RegBot(Bot) end function DataArrival(user, data) IsSuperOp = "FALSE" if(strsub(data, 1, 4) == "$To:") then -- remove end pipe data=strsub(data,1,strlen(data)-1) -- is this meant for our bot? s,e,whoTo = strfind(data,"$To:%s+(%S+)") if (whoTo == Bot) then s,e,whoTo,from,cmd = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)") if (user.bOperator) then if (cmd=="+ophelp") then user:SendData("") user:SendData(" Scripted operator commands:") user:SendData("") user:SendData(" +adduser - Add a new registered user") user:SendData(" +chmypasswd - Change your own password") user:SendData(" +ophelp - Display this operator help page") user:SendData(" +sethubdesc - Set the hub description") user:SendData(" +sethubname - Set the hub name") user:SendData(" +setmaxusers - Set the hub's maximum number of connections") user:SendData("") user:SendData(" Scripted super operator commands:") user:SendData("") user:SendData(" +addop - Add a new operator") user:SendData(" +chred - Change redirect address") user:SendData(" +deleteuser - Delete an existing operator or registered user") user:SendData(" +redirectallnow - Redirect all users immediately to redirect address") user:SendData(" +setredirectall - Set redirect all newly connecting users on or off") user:SendData(" +setredirectfull - Set redirect when max connections reached on or off") user:SendData("") user:SendData(" Note that spaces are used to differentiate between arguments.") user:SendData(" This means that if you want to change the hub description to: My Uber Hub") user:SendData(" then you must type: +sethubdesc My_Uber_Hub") user:SendData("") end if (cmd=="+sethubname") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") arg = gsub(arg, "(%w+)_", "%1 ") frmHub:SetHubName(arg) SendToOps("OpBot", user.sName.." changed the hub name to: "..arg) end if (cmd=="+sethubdesc") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") arg = gsub(arg, "(%w+)_", "%1 ") frmHub:SetHubDescr(arg) SendToOps("OpBot", user.sName.." changed the hub description to: "..arg) end if (cmd=="+setmaxusers") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") frmHub:SetMaxUsers(arg) SendToOps("OpBot", user.sName.." changed the maximum number of user connections to: "..arg) end if (cmd=="+adduser") then s,e,whoTo,from,cmd,arg,arg2 = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s*") frmHub:AddRegUser(arg, arg2, 0) SendToOps("OpBot", user.sName.." added new registered user: "..arg) end if (cmd=="+chmypasswd") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") frmHub:DelRegUser(arg) frmHub:AddRegUser(user.sName, arg, 1) user:SendData(" Your password has been changed to: "..arg) end -- only super operators can do the following commands (see variable SuperOps just below script description) if (IsSuperOp == "TRUE") then if (cmd=="+redirectallnow") then SendToOps("OpBot", user.sName.." is redirecting all users to: "..frmHubGetRedirectAddress()) SendToAll("RedirectBot", "Redirecting... |$ForceMove "..frmHub:GetRedirectAddress().."|") end if (cmd=="+chred") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") frmHub:SetRedirectAddress(arg) SendToOps("OpBot", user.sName.." changed the hub redirect address to: "..arg) end if (cmd=="+setredirectall") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") if (arg=="on") then frmHub:SetRedirectFull(0) frmHub:SetRedirectAll(1) SendToOps("OpBot", user.sName.." changed the redirect all new connections to: "..arg) elseif (arg=="off") then frmHub:SetRedirectAll(0) SendToOps("OpBot", user.sName.." changed the redirect all new connections to: "..arg) else user:SendData(" The value can only be: on or off. It cannot be "..arg) end end if (cmd=="+setredirectfull") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") if (arg=="on") then frmHub:SetRedirectAll(0) frmHub:SetRedirectFull(1) SendToOps("OpBot", user.sName.." changed the redirect all new connections when maximum connections reached to: "..arg) elseif (arg=="off") then frmHub:SetRedirectFull(0) SendToOps("OpBot", user.sName.." changed the redirect all new connections when maximum connections reached to: "..arg) else user:SendData(" The value can only be: on or off. It cannot be "..arg) end end if (cmd=="+addop") then s,e,whoTo,from,cmd,arg,arg2 = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s*") frmHub:AddRegUser(arg, arg2, 1) SendToOps("OpBot", user.sName.." added new operator: "..arg) end if (cmd=="+deleteuser") then s,e,whoTo,from,cmd,arg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(%S+)%s*") frmHub:DelRegUser(arg) SendToOps("OpBot", user.sName.." deleted registered user/operator: "..arg) end end end end end end