Temporar ban countdown
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Temporar ban countdown

Started by Janhouse, 25 April, 2004, 21:28:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Janhouse

I have seen this script on robocop.
If jou are  temporarily banned script shows how long you will be banned.
Like this:
 You are temporarily banned for 6 minutes!

 You are temporarily banned for 5 minutes!
etc.
Can somebody give me that script?

nErBoS

Hi,

That was a time ban, it means that the user was been banned from x time when he tries to recoonect the hub sends how many time as left for his ban.

Where is the Timeban...

--Removed from Brain-Master

Bot = "Time-Ban"

function Main()
	frmHub:RegBot(Bot)
end

function DataArrival(user, data)
	if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
		data=strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data,"%b<>%s+(%S+)")
		if (cmd=="!timeban") then
			TimeBan(user,data)
			return 1
		end
	end
end 

function TimeBan(user,data)
	if (user.bOperator) then
		local sec = 1000
		local min = sec*60
		local h = min*60
		local day = h*24
		local week = day*7
		local month = day*30
		local year = day*365
		local _,_,usr,number,timeformat,reason = strfind( data, "%b<>%s+%S+%s+(%S+)%s+(%d+)(%S+)%s+(.+)" )
		if (usr ~= nil and reason ~= "")  then
			if (GetItemByName(usr) ~= nil) then
				local tobebanned = GetItemByName(usr)
				if timeformat == "hours" or timeformat == "hour" or timeformat == "h" then
					tobebanned:SendPM(Bot, "You have been banned for "..number.." hours because: "..reason) 
					SendToAll(Bot, user.sName.." has banned "..tobebanned.sName.." because: "..reason)
					tobebanned:TimeBan( (tonumber(number)*h)/min )
				elseif timeformat == "days" or timeformat == "day" or timeformat == "d" then
					tobebanned:SendPM(Bot, "You have been banned for "..number.." days because: "..reason) 
					SendToAll(Bot, user.sName.." has banned "..tobebanned.sName.." because: "..reason)
					tobebanned:TimeBan( (tonumber(number)*day)/min )
				elseif timeformat == "weeks" or timeformat == "week" or timeformat == "w" then
					tobebanned:SendPM(Bot, "You have been banned for "..number.." weeks because: "..reason) 
					SendToAll(Bot, user.sName.." has banned "..tobebanned.sName.." because: "..reason)
					tobebanned:TimeBan( (tonumber(number)*week)/min )
				elseif timeformat == "months" or timeformat == "month" or timeformat == "m" then
					tobebanned:SendPM(Bot, "You have been banned for "..number.." months because: "..reason) 
					SendToAll(Bot, user.sName.." has banned "..tobebanned.sName.." because: "..reason)
					tobebanned:TimeBan( (tonumber(number)*month)/min )
				elseif timeformat == "years" or timeformat == "year" or timeformat == "y" then
					tobebanned:SendPM(Bot, "You have been banned for "..number.." years because: "..reason) 
					SendToAll(Bot, user.sName.." has banned "..tobebanned.sName.." because: "..reason)
					tobebanned:TimeBan( (tonumber(number)*year)/min )
				else
					user:SendPM(Bot, "The Format you have choose is wrong. For eg: 10h means 10 Hours of ban.")
				end
			else
				user:SendPM(Bot, "The user "..usr.." isn't online")
			end
		else
			user:SendPM(Bot, "Syntax Error, !timeban  

Best regards, nErBoS
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk