Stop Hub Script
 

Stop Hub Script

Started by speedX, 03 January, 2008, 17:40:08

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

speedX

-- 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&#124;")
	 end
	end
end
OpConnected = UserConnected
RegConnected = UserConnected
Thanking You,

speedX

SMF spam blocked by CleanTalk