!Flood - Page 2
 

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

!Flood

Started by DarkElf, 29 October, 2003, 04:20:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Herodes

try to change this ...
end

			return 1;
		else
			[b]print(sdata)[/b]
		end
	end
end
to this ...
end

			return 1;
		else
			[b]--print(sdata)[/b]
		end
	end
end
and lets see if that solves it ..

imby

hmm nope, uncomenting that out didn't help. again, after leaving it for a night, it has rocketed

plop

give this 1 a try.
-- original made by Skrollster and RabidWombat
-- added notidication in mainchat by plop, corrected by yepyepyep4711 ;op

Bot = "Flood,1,2,5"
tUsers = {}

function Main()
	frmHub:RegBot(Bot)
end

function NewUserConnected(curUser)
	tUsers[curUser.sName] = 1
end

function OpConnected(curUser)
	tUsers[curUser.sName] = 1
end

function UserDisconnected(curUser)
	tUsers[curUser.sName] = nil
end

function OpDiconnected(curUser)
	tUsers[curUser.sName] = nil
end

function Clear()
	collectgarbage()
	flush()
end

function DataArrival(user,sdata)
	if(tUsers[user.sName] == nil) then
		tUsers[user.sName] = 1
	end
	if strsub(sdata,1,1) == "<" and user.bOperator then
		local _,_, command, args = strfind(sdata,"%b<>%s+(%S+)%s*([^%|]*)%|$")

		if command == "!flood" then
			local _,_, client,times,message = strfind(args,"^(%S+)%s+(%d+)%s+(.*)$")
			local sUser = nil

			if client and GetItemByName(client) then
				local sUser = nil
				for sUser,value in tUsers do
					for i = 1, tonumber(times), 1 do
						SendPmToNick(client,sUser,message)
					end
				end
				SendToAll(Bot, client.." has been flooded because: ".. message.."|")
				Clear()
			else
				user:SendData(Bot,"The Command is !flood   .")
			end

			return 1
		end
	end
end

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 <----<<

imby

thanks, but again, leaving it on over night gives the same results. you can see it's noticable effects when you just leave it in for a few hours.

plop

next try.
-- original made by Skrollster and RabidWombat
-- added notidication in mainchat by plop, corrected by yepyepyep4711 ;op
-- some potential fixes by plop

Bot = "Flood,1,2,5"
tUsers = {}

function Main()
	frmHub:RegBot(Bot)
end

function NewUserConnected(curUser)
	tUsers[curUser.sName] = 1
end

function OpConnected(curUser)
	tUsers[curUser.sName] = 1
end

function UserDisconnected(curUser)
	tUsers[curUser.sName] = nil
end

function OpDisconnected(curUser)
	tUsers[curUser.sName] = nil
end

function Clear()
	collectgarbage()
	flush()
end

function DataArrival(user,sdata)
	if(tUsers[user.sName] == nil) then
		tUsers[user.sName] = 1
	end
	if strsub(sdata,1,1) == "<" and user.bOperator then
		local _,_, command, args = strfind(sdata,"%b<>%s+(%S+)%s*([^%|]*)%|$")

		if command == "!flood" then
			local _,_, client,times,message = strfind(args,"^(%S+)%s+(%d+)%s+(.*)$")

			if client and GetItemByName(client) then
				for sUser,value in tUsers do
					for i = 1, tonumber(times), 1 do
						if GetItemByName(client) then
						      SendPmToNick(client,sUser,message)
						else
							times = i
							break
						end
					end
				end
				SendToAll(Bot, client.." has been flooded "..times.."x because: ".. message.."|")
				Clear()
			else
				user:SendData(Bot,"The Command is !flood   .")
			end

			return 1
		end
	end
end
also found a s missing in OpDisconnected.

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 <----<<

imby

hmm, this one is already taking 3 times as much as deflood. starts low and keeps rising. maybe it's not fixable?

plop

QuoteOriginally posted by imby
hmm, this one is already taking 3 times as much as deflood. starts low and keeps rising. maybe it's not fixable?
i have some more idea's but 1st i would like 2 know more precise how much mem it uses.

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 <----<<

imby

Screenshots:


'Screenshot' shows how long i've left it running also:

http://www.picturetrail.com/screenshot200

seems a little excessive for an idle stand alone script right? This normally wouldn't be a problem, but i usually leave the hub without a reboot for atleast a week. don't want it to rise too drammatically.


'Screenshot2' is Straight after a 'Restart scripts'.



I'm willing to test out any new additions you make, i just don't want to bother you.

I'l keep these pics up for a few days, cheers.

imby

hmm, still rising:


SMF spam blocked by CleanTalk