PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: Cêñoßy†ê on 12 April, 2007, 15:17:36

Title: Max upload limit by C??o?y?
Post by: Cêñoßy†ê on 12 April, 2007, 15:17:36
Code (lua) Select

--[[
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
Title: Re: Max upload limit by C??o?y?
Post by: -SkA- on 04 May, 2007, 09:51:02
Very usefull script  :) Thank you.
Title: Re: Max upload limit by C??o?y?
Post by: TTB on 04 May, 2007, 13:14:20
collectgarbage("collect")
Why is this needed in this script?
Title: Re: Max upload limit by C??o?y?
Post by: CrazyGuy on 04 May, 2007, 22:44:39
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
Title: Max upload limit by C??o?y?
Post by: Stormbringer on 05 May, 2007, 01:16:34
good job Ceno :)