Max upload limit by C??o?y?
 

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

Max upload limit by C??o?y?

Started by Cêñoßy†ê, 12 April, 2007, 15:17:36

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cêñoßy†ê

Code: lua
--[[
	Max uploadlimit check for profiles
	* Stripped From Horus script *
	by C??o?y?? (04/12/07)
]]--

settings = {
	botname = frmHub:GetHubBotName(),
	limiter = {	-- profile number,max limit (0=off)
		[-1] = 50,  -- if user has limit value 40 he gets redirected,if 51 he can login
		[0] = 50,
		[1] = 50,
		[2] = 50,
		[3] = 50,
		[4] = 50,
		[5] = 50,
		[6] = 50,
	},
}

MyINFOArrival = function(user,data)
	if user.bHasTag then
		if limitercheck(user) == nil then
			return 0
		else
			doaction(user,limitercheck(user),frmHub:GetRedirectAddress())
		end
	else
		doaction(user,"No Tag found",frmHub:GetRedirectAddress())
	end
	collectgarbage("collect")
end

limitercheck = function(user)
	local max = tonumber(settings.limiter[user.iProfile])
	if string.find(user.sConnection,"NetLimiter%s+%[%d+%s+kB%/s%]") then
		local amount = string.find(user.sConnection,"NetLimiter%s%[(%d+)%skB%/s%]")
		if tonumber(amount) < max then
			return "Connection limited too much (Found: "..amount.." kb/s Limit: "..max.." kb/s)"
		end
	end
	if user.iBlimit > 0 and user.iBlimit < max then
		return "Connection limited too much (Found: "..user.iBlimit.." kb/s Limit: "..max.." kb/s)"
	end
	if user.iLlimit > 0 and user.iLlimit < max then
		return "Connection limited too much (Found: "..user.iLlimit.." kb/s Limit: "..max.." kb/s)"
	end
end

doaction = function(user,msg,where)
	user:Redirect(where,msg)
	TempBan(user.sIP,5,msg,settings.botname,1)
end
Powered By Leviathan™ 2nd Generation v. 1.9

-SkA-

Very usefull script  :) Thank you.
???:::??x??em?-N????:::??? ?wN??

BrianzaLand Blog" style="border:0

TTB

collectgarbage("collect")

Why is this needed in this script?
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

CrazyGuy

Quote from: TTB on 04 May, 2007, 13:14:20
collectgarbage("collect")

Why is this needed in this script?

Quote* Stripped From Horus script *
;D

Stormbringer


SMF spam blocked by CleanTalk