repeat 3x and get kicked.
 

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

repeat 3x and get kicked.

Started by lazyj189, 22 November, 2003, 17:58:56

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

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

DivX Dominion Hub Owner
3 years running
DivX Dominion Hub

BlazeXxX

I remember someone did something like this b4.. lets see if someone posts it for us :)

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

lazyj189

ya I know it "shouldn't" be too hard to make, so we'll see.
DivX Dominion Hub Owner
3 years running
DivX Dominion Hub

tezlo

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

BlazeXxX

Thx tezlo .. the man :p Would it work with IceCube IV ?

marci_n

but the kick all. Ops too :(

NightLitch

#7
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...
//NL

NightLitch

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...
//NL

marci_n

BIG thx NightLitch :D

SMF spam blocked by CleanTalk