--[[
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
Very usefull script :) Thank you.
collectgarbage("collect")
Why is this needed in this script?
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
good job Ceno :)