Time Ban Conversion
 

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

Time Ban Conversion

Started by Yahoo, 27 November, 2007, 13:26:04

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yahoo

sumbody please convert this script for lua5.1

--Kick as in Verli: !kick user reason _ban_ time unit
--Hungarista 2oo6
--1.00 version

sBot = frmHub:GetHubBotName()

function ChatArrival(curUser,data)
data = string.sub(data,1,string.len(data)-1)
	if curUser.bOperator then
		if string.find(data,"%b<>%s!kick") then
		local s,e,nick,reason,stime,sdate = string.find(data,"%b<>%s!kick%s(%S+)%s*(.*)%s*_ban_%s*(%d+)%s*(%S+)")
		user = GetItemByName(nick)
		if user == nil then curUser:SendData(sBot,"No user on hub "..nick.."") return 1 end
		if stime == nil and sdate  == nil then
		user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_5m")
		user:TimeBan(5)
		curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
		"and he is being Banned For: 5mins 0sec")
		end
			if sdate == "s" then
			user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_"..stime..""..sdate.."")
			user:Disconnect()
			curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
			"and he is being Banned For: 0mins "..stime.."sec")
			elseif sdate == "m" then
			user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_"..stime..""..sdate.."")
			curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
			"and he is being Banned For: 0hours "..stime.."min") 
			user:TimeBan(stime)
			elseif sdate == "h" then
			user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_"..stime..""..sdate.."")
			curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
			"and he is being Banned For: 0days "..stime.."hour") 
			user:TimeBan(stime*60)
			elseif sdate == "d" then
			user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_"..stime..""..sdate.."")
			curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
			"and he is being Banned For: "..stime.."day")
			user:TimeBan(stime*60*24)
			elseif sdate == "w" then
			user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_"..stime..""..sdate.."")
			curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
			"and he is being Banned For: "..stime.."week") 
			user:TimeBan(stime*60*24*7)
			elseif sdate == "M" then
			user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_"..stime..""..sdate.."")
			curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
			"and he is being Banned For: "..stime.."Month")
			user:TimeBan(stime*60*24*7*4)
			elseif sdate == "y" then
			user:SendPM(sBot,"<"..curUser.sName.."> You are being kicked because: "..reason.."_ban_"..stime..""..sdate.."")
			curUser:SendData(sBot,"Kicked user "..user.sName.." IP: "..user.sIP.." .. ;)\r\n"..
			"and he is being Banned For: "..stime.."year")
			user:TimeBan(stime*60*24*7*4*12)
			else curUser:SendData(sBot,"No parameter "..sdate..". Avaible parameters are:\r\n"..
			"s - secundum\r\n"..
			"m - minute\r\n"..
			"h - hour\r\n"..
			"d - day\r\n"..
			"w - week\r\n"..
			"M - month\r\n"..
			"y - year\r\n")
			end
		return 1
		end
	else curUser:SendData(sBot,"You are not allowed to use this command!")
	return 1
	end
end



and also tell me the command to use this script


thanks in advance
"BoRN FIGhTEr"

Yahoo

#1
ty mutor
the script is working fine but when a user is ban it does not show reason to ban user it shows only
Sorry you have temp ban with remaining time: 23 hours 59 min 36 sec
IP: 172.16.7.150
Nick: test
it will be better if the user is showed ban with reason

i will like to have sum small changes if possible
1) offline users must also be able to ban
2) command to unban a ban user
3) Right click Command


The following request is specially for mutor
if a user is banned by using this script cant the name of the banned user be shown automatically in sticky message on message board with reason and time of tht ban for eg
User test banned for chat flooding for 24 hours
       (nick)      +          (reason)     +    (time)

Thanks in advace
"BoRN FIGhTEr"

SMF spam blocked by CleanTalk