PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Alexinno on 07 September, 2006, 08:31:31

Title: Time ban in kick
Post by: Alexinno on 07 September, 2006, 08:31:31
Hello ppl!
Is there any way to include time ban in kick reason ?
for example
<x> is kicking Y because: ..... ban_2w
and that user get baned for 2 weeks ,something like verli does
i think it would be a very usefull :)
Title: Re: Time ban in kick
Post by: Thor on 07 September, 2006, 10:12:52
Check here: http://forum.ptokax.org/index.php?topic=6345.0
It was requested in the hungarian LUA forum a long time ago, so i did that script.
But i never understand why operators don't use the help :P
!timeban <nick/hr:mn/reason>         - Timeban user with a reason
To do one more raw command...
Title: Re: Time ban in kick
Post by: Alexinno on 07 September, 2006, 19:17:41
because the inbuild kick is quicker than other kick/ban command :P
Thank you fot this script, it's really nice
Title: Re: Time ban in kick
Post by: Alexinno on 07 September, 2006, 19:46:44
yeah well it's not working with client inbuild kick
if i replace this
string.find(data,"%b<>%s!kick%s(%S+)%s*(.*)%s*_ban_%s*(%d+)%s*(%S+)")
with
string.find(data,"%b<>%s$kick%s(%S+)%s*(.*)%s*_ban_%s*(%d+)%s*(%S+)")

will work ?
Title: Re: Time ban in kick
Post by: Thor on 07 September, 2006, 19:56:10
You are welcome, but if you do an usercommand, there is also fast (to inbuild !tempban command):
Type: Chat Context: User menu Command: !tempban %[nick] %[line:Time and reason]
And you write into Time and reason: 10m You has been kicked for 10m
But, if with script is better to you, use it :) The laziest men are the programmers as we know, but it seems hubowners also ;D
Quote from: Alexinno on 07 September, 2006, 19:46:44
yeah well it's not working with client inbuild kick
if i replace this
string.find(data,"%b<>%s!kick%s(%S+)%s*(.*)%s*_ban_%s*(%d+)%s*(%S+)")
with
string.find(data,"%b<>%s$kick%s(%S+)%s*(.*)%s*_ban_%s*(%d+)%s*(%S+)")

will work ?
No, it won't work, you shold use then an another function called KickArrival :)
Title: Re: Time ban in kick
Post by: Alexinno on 07 September, 2006, 20:13:23
like this ?

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

sBot = frmHub:GetHubBotName()

function KickArrival(user,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.."")
....
Title: Re: Time ban in kick
Post by: Alexinno on 08 September, 2006, 10:34:43
Mutor thx for the reply .. but i'm not a scripter and i really don't understand how should i do it :(
or is there any way to do this time ban in $Kick reason :|