PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: servaks on 20 October, 2003, 20:01:12

Title: 3 x kick = ban
Post by: servaks on 20 October, 2003, 20:01:12
someone got this script ?
if you got, plz post it here...   ;)

/shipis
Title:
Post by: Alexei on 20 October, 2003, 20:04:52
Hmm... i dont... but i think its in MM script... ;)
Try there...
Title:
Post by: servaks on 20 October, 2003, 20:06:03
In where ?

/shipis
Title:
Post by: pHaTTy on 20 October, 2003, 20:09:13
hmm 1 sec i write...................................ok


--Quick 3kick ban by Phatty

conquered={}

function DataArrival(user,data)
if (strfind(data, "$Kick")) then
s,e, Name = strfind(data,"$Kick+%s+(%S+)|")
nick = GetItemByName(Name)
if conquered[nick]==nil then conquered[nick]=1
return 1
elseif conquered[nick]==1 then conquered[nick]=2
return 1
elseif conquered[nick]==2 then conquered[nick]=3
return 1
elseif conqeured[nick]==3 then conquered[nick]=nil
nick:Ban()
end
end
end


there you go l8rr,,

-phatty
Title:
Post by: servaks on 20 October, 2003, 20:31:36
did you tested this script...
looks like its not working...
when im kicking it shows i have been kicked, but dont kick...

/shipis
Title:
Post by: pHaTTy on 20 October, 2003, 20:39:13
hmmm


--Quick 3kick ban by Phatty

conquered={}

function DataArrival(user,data)
if (strfind(data, "$Kick")) then
s,e, Name = strfind(data,"$Kick+%s+(%S+)|")
nick = GetItemByName(Name)
if conquered[nick]==nil then conquered[nick]=1
return 0
elseif conquered[nick]==1 then conquered[nick]=2
return 0
elseif conquered[nick]==2 then conquered[nick]=3
return 0
elseif conqeured[nick]==3 then conquered[nick]=nil
nick:Ban()
end
end
end


-phatty
Title:
Post by: servaks on 20 October, 2003, 20:44:39
Not banning after 3 kicks...


/shipis
Title:
Post by: pHaTTy on 20 October, 2003, 20:48:32
it kicks 3 times then 4 kick is a ban
Title:
Post by: servaks on 20 October, 2003, 20:52:52
Nop, not working for me...

5x kick, no BAN

/shipis
Title:
Post by: pHaTTy on 20 October, 2003, 20:57:36
brrrrrrrr


--Quick 3kick ban by Phatty

conquered={}

function DataArrival(user,data)
if (strfind(data, "$Kick")) then
s,e, Name = strfind(data,"$Kick+%s+(%S+)|")
nick = GetItemByName(Name)
if conquered[nick]==nil then conquered[nick]=1
return 0
elseif conquered[nick]==1 then conquered[nick]=2
return 0
elseif conquered[nick]==2 then conquered[nick]=3
return 0
elseif conqeured[nick]==3 then conquered[nick]=nil
nick:Ban()
return 1
end
end
end

Title:
Post by: Alexei on 20 October, 2003, 21:40:33
Not sure if the last code will work... hmm... but who knows... its phatty that wrote the boty :S ... then it will work... i hope
Title:
Post by: pHaTTy on 20 October, 2003, 22:01:29
ehehehe thx :o)
Title:
Post by: klownietklowniet on 20 October, 2003, 22:22:34
I would suggest maybe:

strsub(data, 1, 5) == "$Kick"

and about the kicks... are you using any other command? Like !kick or something, because only right click kicks are caught by this script...
Title:
Post by: servaks on 20 October, 2003, 22:31:40
Nop, not working...
Maby test it...
And when it works post the script...

/shipis
Title:
Post by: pHaTTy on 20 October, 2003, 22:32:50
yep btw no scripted kicks will work
Title:
Post by: Alexei on 20 October, 2003, 22:40:50
Hmm... well lets see...
If u use if data == "$Kick" or cmd == "!kick"
just use both variants in a script...
Im not saying that the things i wrote above will work...but try...

PS...dont forget to define the user there...lol
1 dude wrote a script that kicks SOME OTHER DUDE!
NOT the 1 you wanna kick :S
Title:
Post by: klownietklowniet on 20 October, 2003, 23:04:22
I think the regex is buggy in your version: Try this one:

s,e,Name = strfind(data,"%S+%s(.+)")

because:

s,e, Name = strfind(data,"$Kick+%s+(%S+)|")

there is a + after $Kick that shouldn't be there I think
Title:
Post by: pHaTTy on 21 October, 2003, 02:11:27
Hmmm well works fine for me, anyways, was just a quick written one :o)
Title:
Post by: servaks on 21 October, 2003, 08:35:22
Maby you can post working script here?

/shipis
Title: Thios one works
Post by: Snoris on 22 October, 2003, 16:12:54
botname = "Ban-Guy"
maxKicks = 3
usrKicks = { }

ignoreKicks = nil
silentKicks = nil
silentKickPMs = nil

function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
local s, e, who, why = strfind(data, "^%b<> %S+ is kicking (%S+) because: (.*)|$")
if s and silentKicks then return 1 end
elseif strsub(data, 1, 3) == "$To" then
local s, e, who, why = strfind(data, "^%$To: (%S+) From: %S+ %$%b<> You are being kicked because: (.*)|$")
if s and silentKickPMs then return 1 end
elseif strsub(data, 1, 5) == "$Kick" then
local s, e, who = strfind(data, "^%$Kick (%S+)|$")
if s then
local tmp = GetItemByName(who)
usrKicks[who] = usrKicks[who] or 0
usrKicks[who] = usrKicks[who] + 1
if tmp and usrKicks[who] >= maxKicks then
SendToAll(botname, "User "..who.." has been auotobanned cus he dosen?t follow the rules")
tmp:SendData("*** Ur Banned Becouse U Didn?t Follow The Rules...Have A Nice Day.")
tmp:NickBan() -- tmp:Ban()
end if ignoreKicks then return 1 end
end
end
end -- tezlo

This one works...I?m using it =p
 :]
Title:
Post by: servaks on 22 October, 2003, 16:16:22
Thnx...


/shipis
Title: Ip ban aswell??
Post by: [G-T-E]Gate? on 18 November, 2003, 10:18:18
Great Script If I may say.
Works like a charm- But it omnly does a NickBan, Any chance on a Total ban including IP aswell ??
Looking forward to it.
Thanks
Title:
Post by: Snoris on 18 November, 2003, 10:37:36
botname = "Ban-Guy"
maxKicks = 3
usrKicks = { }

ignoreKicks = nil
silentKicks = nil
silentKickPMs = nil

function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
local s, e, who, why = strfind(data, "^%b<> %S+ is kicking (%S+) because: (.*)|$")
if s and silentKicks then return 1 end
elseif strsub(data, 1, 3) == "$To" then
local s, e, who, why = strfind(data, "^%$To: (%S+) From: %S+ %$%b<> You are being kicked because: (.*)|$")
if s and silentKickPMs then return 1 end
elseif strsub(data, 1, 5) == "$Kick" then
local s, e, who = strfind(data, "^%$Kick (%S+)|$")
if s then
local tmp = GetItemByName(who)
usrKicks[who] = usrKicks[who] or 0
usrKicks[who] = usrKicks[who] + 1
if tmp and usrKicks[who] >= maxKicks then
SendToAll(botname, "User "..who.." has been auotobanned cus he dosen?t follow the rules")
tmp:SendData("*** Ur Banned Becouse U Didn?t Follow The Rules...Have A Nice Day.")
tmp:NickBan() -- tmp:Ban()
end if ignoreKicks then return 1 end
end
end
end -- tezlo

Just replace the tmp:nickban() with the tmp:ban()
Or just write tmp:banip()

=))

Enjoy it
Title:
Post by: [G-T-E]Gate? on 18 November, 2003, 10:48:18
Enjoy it ,,, MMmmm  Its taken one more brick off my shoulder,
Thanks loads , Great work .... :]