Author Topic: MaxLimiter conversion  (Read 3115 times)

0 Members and 1 Guest are viewing this topic.

Offline -SkA-

  • Double Ace
  • *
  • Posts: 133
  • Karma: +24/-2
MaxLimiter conversion
« on: 11 February, 2008, 13:41:27 »
Hi all,

this is one of the last script wich I need the conversion before upgrade my PX to new API  ::)

Quote
--[[
   Max uploadlimit check for profiles
   * Stripped From Horus script *
   by C��o�y�� (04/12/07)
   Cleanup by amenay (saw it on the PXA Hub Codeboard and couldn't resist)
]]--

settings = {
   botname = SetMan.GetString( 21 ) or "Bot-Name",
   limiter = {   -- profile number,max limit (0=off)
      [-1] = 20,  -- if user has limit value 40 he gets redirected,if 51 he can login
   },
   redirect = SetMan.GetString( 6 ) or "anyhub.somedns.net";
}

MyINFOArrival = function( user, data )
   if settings.limiter[ user.iProfile ] then
      local sAmount = limitercheck( user )
      if sAmount then
         local sMsg = "Connection limited too much (Found: "..sAmount.." kb/s Limit: "..settings.limiter[user.iProfile].." kb/s)";
         Core.Redirect( user, settings.redirect, sMsg )
         BanMan.TempBanIP( user.sIP, 5, sMsg , settings.botname, false )
      end
   end
end

limitercheck = function( user )
   local amount = Core.GetUserValue( user, 22 ) or Core.GetUserValue( user, 4 ):match( ("^%d+"), 13 );
   amount = tonumber( amount )
   if amount and amount < settings.limiter[ user.iProfile ] and not amount == 0 then
      return amount;
   end
end

It's already been converted by amenay but it doesn't works....

Thanks in advance  ;D
???:::??x??em?-N????:::??? ?wN??

BrianzaLand Blog" style="border:0

PtokaX forum

MaxLimiter conversion
« on: 11 February, 2008, 13:41:27 »

Offline Semjon

  • Junior Member
  • **
  • Posts: 11
  • Karma: +4/-0
Re: MaxLimiter conversion
« Reply #1 on: 15 February, 2008, 20:51:38 »
It is a little diffrent, but you can use another script (UpLimit 1.0 L5.1). :) Tell thanks Mutor.  ;)

PtokaX forum

Re: MaxLimiter conversion
« Reply #1 on: 15 February, 2008, 20:51:38 »