-- Stop Hub Script [NEW API] [Strict] by speedX (04/01/08)
tSettings = {
-- Bot Name
sBot = SetMan.GetString(21),
-- Hub Name
sHubName = SetMan.GetString(0),
-- Rightclick: Enable = true, Disable = false
sRC = true,
-- Commands
sStopHub = "stophub",
-- Closing Message
sMsg = "Hub Closing",
-- 1 = Allow ; 0 = Don't Allow
Levels = {
[-1] = 0, -- Unregistered User
[0] = 1, -- Master
[1] = 0, -- Operator
[2] = 0, -- Vip
[3] = 0, -- Registered User
}
}
function OnStartup()
Core.RegBot(tSettings.sBot,"","",true)
end
ChatArrival = function(User,Data)
if tSettings.Levels[User.iProfile] == 1 then
local _,_,cmd = string.find(Data, "%b<>%s%p([^|]*)")
if cmd and (cmd == tSettings.sStopHub) then
Core.SendPmToAll(tSettings.sBot,tSettings.sMsg)
Core.Shutdown()
return true
end
else
Core.SendToNick(User.sNick,"<"..tSettings.sBot.."> You are not allowed to use this command.")
return true
end
end
UserConnected = function(User)
if tSettings.Levels[User.iProfile] == 1 then
if tSettings.sRC then
Core.SendToNick(User.sNick,"$UserCommand 1 3 "..tSettings.sHubName.."\\Stop Hub$<%[mynick]> !stophub|")
end
end
end
OpConnected = UserConnected
RegConnected = UserConnected