How about a bot that kicks a user for repeating what they say 3 times.
after they repeat 2 times they get a warning in main chat or in pm, wherever they are repeating themselves.
blah
blah
if you repeat yourself 1 more time I will have to kick you.
blah
bot is kicking Blah because they flooded the chat
User Blah was kicked. IP: xx.xx.xx.xx
I remember someone did something like this b4.. lets see if someone posts it for us :)
QuoteOriginally posted by lazyj189
How about a bot that kicks a user for repeating what they say 3 times.
after they repeat 2 times they get a warning in main chat or in pm, wherever they are repeating themselves.
blah
blah
if you repeat yourself 1 more time I will have to kick you.
blah
bot is kicking Blah because they flooded the chat
User Blah was kicked. IP: xx.xx.xx.xx
so if user "testuser" says something 3x you want 2 kick user "blah". lol
naaaaaa i get the idea.
bit busy @ the moment so hope some1 else has it or can make it.
shouldn't be 2 hard 2 make.
plop
ya I know it "shouldn't" be too hard to make, so we'll see.
max = 3
table = {}
warnmsg = "dont flood"
kickmsg = "flooding"
function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
local s, e, str = strfind(data, "^%b<> (.*)|$")
return check(user, str)
end
end
function check(user, str)
local tmp, ret = table[user.sName] or {}
if tmp[1] ~= str then
tmp = { str, 1 }
else
tmp[2] = tmp[2] + 1
if tmp[2] == max - 1 then
user:SendData("Hub-Security", warnmsg)
elseif tmp[2] == max then
user:Kick(kickmsg)
tmp, ret = nil, 1
end
end table[user.sName] = tmp
return ret
end
Thx tezlo .. the man :p Would it work with IceCube IV ?
but the kick all. Ops too :(
Here try this little update:
max = 3
table = {}
warnmsg = "dont flood"
kickmsg = "flooding"
function DataArrival(user, data)
if strsub(data, 1, 1) == "<" and not user.bOperator then
local s, e, str = strfind(data, "^%b<> (.*)|$")
return check(user, str)
end
end
function check(user, str)
local tmp, ret = table[user.sName] or {}
if tmp[1] ~= str then
tmp = { str, 1 }
else
tmp[2] = tmp[2] + 1
if tmp[2] == max - 1 then
user:SendData("Hub-Security", warnmsg)
elseif tmp[2] == max then
user:Kick(kickmsg)
tmp, ret = nil, 1
end
end table[user.sName] = tmp
return ret
end
Great piece Tezlo...
And it Works just tested...
Could you make it even if messages come like this:
hey
hey hey hey hey ( But Here it is sended 4 times...)
hey
------------------------
kicked normally x3
Hope you get my point...
Everybody have new good year...
BIG thx NightLitch :D