MaxLimiter conversion
 

News:

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

MaxLimiter conversion

Started by -SkA-, 11 February, 2008, 13:41:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

-SkA-

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

Semjon

It is a little diffrent, but you can use another script (UpLimit 1.0 L5.1). :) Tell thanks Mutor.  ;)

SMF spam blocked by CleanTalk