PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: Thor on 07 September, 2006, 10:10:08

Title: _ban_time after kick
Post by: Thor on 07 September, 2006, 10:10:08
This script is modify the kick to timeban as verli do.
--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
Title: Re: _ban_time after kick
Post by: 6Marilyn6Manson6 on 07 September, 2006, 13:34:09
Very Nice ;)