READ THE RULES
0 Members and 1 Guest are viewing this topic.
--[[ Kick Guest 1.0 LUA 5.1x [Strict][API 2] By Mutor 09/09/10 Requested by kammikaze Kicks unregistered users by operator command. - Provides context menu command - Option for custom reason per kick]]-- "Botname" ["" = Default Hub Bot]Bot = ""-- Context Menu Title ["" = Hub Name]Menu = ""--Context Submenu Title ["" = Script Name]SubMenu = ""-- Kick CommandCmd = "KickUr"-- Reason for KickReason = "Guests must leave the hub at this time"OnStartup = function() Scp,Pfxs,Pfx = "Kick Guest 1.0","","" Set=function(a,v,h) if a == "" then if h then return SetMan.GetString(v) else return v end else return a end end Bot = Set(Bot,Core.GetHubSecAlias(),false) if Bot ~= SetMan.GetString(21) then Core.RegBot(Bot,"Hub Security","",true) end Menu = Set(Menu,0,true) SubMenu = Set(SubMenu,Scp,false) Pfxs = Set(Pfxs,29,true) Pfx = Set(Pfx,Pfxs:sub(1,1),false)endOpConnected = function(user,data) Core.SendToUser(user,"$UserCommand 1 3 "..Menu.."\\"..SubMenu.. "\\Kick Unregistered ".. "Users$<%[mynick]> "..Pfx..Cmd.." %[line:Reason For Kick (Optional)]|")endChatArrival = function(user,data) if user.iProfile~= -1 and ProfMan.GetProfile(user.iProfile).tProfilePermissions.bIsOP then local _,_,pfx,cmd = data:lower():find("%b<> (["..SetMan.GetString(29).."])("..Cmd:lower()..")") if pfx and cmd then local _,_,rsn = data:find("^%b<> %p%a+ ([^|]+)|$") if not rsn then rsn = Reason end for _,usr in ipairs(Core.GetOnlineUsers(-1)) do Core.Kick(usr,Bot,Reason) end return true end endend