Rules! [Diaplay Hub rules]
 

Rules! [Diaplay Hub rules]

Started by ?StIfFLEr??, 23 June, 2009, 10:09:41

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

?StIfFLEr??

--Rules v 1.0a  [API2] By ?StIfFLEr??
--The Original Script had no credits.Thanks to whosover it concerns.
--Converted to new API with some help from  PtokaX LUA API Converter v0.9b [Since I am still learning]
--Changes From Previous version
--Added Prefix Option in user setiings
--Added Custom command option in user settings
--Reduced Script size From previous version
--Added Custom menu Option in user settings
--Profile permission added
--RC command Added as per profile permission [Thanks to mutor' RC commands]
-------------------------------------------------------------------------------------------
--Settings [Do not change if you don't know]
-------------------------------------------------------------------------------------------
-- "Botname" [Add as you wish]
bot = "[Rules]"
-- "BotDesc" [Describe]
botDesc = "I am the rule"
-- "Tag" [Version.DO NOT CHANGE]
botTag = "version.01-25/06/09"
-- "prefix" [#,! Anything you would feel convinient]
prefix = "!"
-- Command You wish to use for seeing the RULES
cmdrule = "rules"
-- Main menue [Your prefered Custom Menue Name here]
local Menue = "Rules"
-- Sub Menue [ Your prefered Sub menue.More Sub menue can me added here itself by seperating it by \\ ]
local SubMenue = "Display Hub Rules"
-- Profile permission as per new ptokax
tProfile = {
		[-1] = 1,	-- Unregistered Users
		[0] = 1,	-- Masters
		[1] = 1,	-- Operators
		[2] = 1,	-- VIP
		[3] = 1,	-- Registered
}

------------------------------------------------------------------------------------------
--OnStartup Function
------------------------------------------------------------------------------------------
OnStartup = function()
	if bot ~= SetMan.GetString(21) then
		Core.RegBot(bot,botDesc,botTag,true)
	end
end


ChatArrival = function(usr,data)
	data = string.sub(data,1,string.len(data)-1)
	local s,e,cmd = string.find(data, "%b<>%s+(%S+)")
	if cmd == ""..prefix..""..cmdrule.."" then
			local Msg,border = "\r\n",string.rep("-",15)..string.rep("=",100)..string.rep("-",15)
			Msg = Msg .. "\r\n						   "
			Msg = Msg .. "\r\n "..border..""
			Msg = Msg .. "\r\n 		  "..SetMan.GetString(0).." Rules That must be followed By all Users			 	"
			Msg = Msg .. "\r\n "..border..""
			Msg = Msg .. "\r\n "
			Msg = Msg .. "\r\n\t\t 1 . By Entering this hub you are agree to the following. If not, please exit immediately :\n"
			Msg = Msg .. "\r\n\t\t 2 . The Owner of this hub does not take any responsibility of what all stuff the users are sharing .\n"
			Msg = Msg .. "\r\n\t\t 3 . Any user found passless in this hub will be warned .\n"
			Msg = Msg .. "\r\n\t\t 4 . Advertising is allowed in this hub .\n"
			Msg = Msg .. "\r\n\t\t 5 . Any user who has registered himself in this hub has to put the registered nickname and password in favourite hub properties .\n"
			Msg = Msg .. "\r\n\t\t 6 . Do not disconnect users uploading from you.\n"
			Msg = Msg .. "\r\n\t\t 7 . Hub users should not to share incomplete download files. \n"
			Msg = Msg .. "\r\n\t\t 8 . The users should not flood in main chat or PM . \n"
			Msg = Msg .. "\r\n\t\t 9 . Repeated violations of these rules will get your IP banned .\n"
			Msg = Msg .. "\r\n\t\t 10. Users should not spam the message board or any other boards with multiple messages . \n"
			Msg = Msg .. "\r\n\t\t 11. Users should reply to PMs instantly. \n"
			Msg = Msg .. "\r\n\t\t 12. If the users are away from their pc theys should go to away mode by typing +away <message> in the main chat . \n"
			Msg = Msg .. "\r\n\t\t 13. Users should never go offline when others are uploading from them . \n"
			Msg = Msg .. "\r\n\t\t 14. Type +help for commands available for your profile. \n"
			Msg = Msg .. "\r\n\t\t 15. Your share must be minimum 5 GB to login in this hub . \n"
      			Msg = Msg .. "\r\n ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
			Msg = Msg .. "\r\n\r\n "
		Core.SendPmToUser(usr,bot,Msg)
			return true

		end Clear()
end

Clear = function() 
	collectgarbage(collect)
	io.flush()
end

---------------------------------------------------------------------------------------------
--Right Click As per Profile permissions Given Above.
---------------------------------------------------------------------------------------------
RcCmds = {
	{1,"$UserCommand 1 3 "..Menue.."\\"..SubMenue.."\\Rules$<%[mynick]> "..prefix..""..cmdrule.."&#124;|"},
}

UserConnected = function(user)
	local lvl,x = tProfile[user.iProfile],""
	if lvl then
		for i,v in ipairs(RcCmds) do if lvl >= v[1] then x = x..v[2] end end
		if #x > 0 then Core.SendToUser(user,x) end
		collectgarbage("collect")
	end
end
RegConnected,OpConnected = UserConnected,UserConnected


------------------------------------------------------
ToArrival=ChatArrival
------------------------------------------------------

[ vAiBhAv?]


Dreams

I have to thank you for this script, has been verry usefull for many info things in the hub, when i modded it a little bit :)

SMF spam blocked by CleanTalk