syntax error in script: Rev Blocker by jiten
 

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

syntax error in script: Rev Blocker by jiten

Started by HillyBilly, 10 August, 2005, 20:07:29

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HillyBilly

I get the next error, need some help

Syntax ...HUB\~    ~Ptokax HUB draait\scripts\NoShare.lua5.lua:75: attempt to perform arithmetic on field `iNormalHubs' (a nil value)

Its this line:          elseif (curUser.iNormalHubs + curUser.iRegHubs) > MaxHubs then

This is the script:
--$Rev Blocker by jiten

-- restriction for MinSlots, MinShare and MaxHubs
-- Blok users from download when not met mishare etc.
-- Added: Immune Table for Non-Operators

-- Changed: Normal and Reg Hub Check

-- some ideas taken from leech bot and ShaveShare v4.8 by Herodes





kb = 1024

mb = 1024 ^ 2

gb = 1024 ^ 3



MinShare = 500*mb -- in MBs

MinSlots = 1

MaxHubs = 200

tImmune = { ["[HB]HillyBilly"] = 1, ["nick2"] = 1, } -- Non-Operators Immune List (["nick"] = 1)



DoShareUnits = function(intSize) --- Thanks to kepp and NotRambitWombat

	if intSize ~= 0 then

		local tUnits = { "Bytes", "KB", "MB", "GB", "TB" }

		intSize = tonumber(intSize);

		local sUnits;

		for index = 1, table.getn(tUnits) do

			if(intSize < 1024) then sUnits = tUnits[index]; break; else intSize = intSize / 1024; end

		end

		return string.format("%0.1f %s",intSize, sUnits);

	else

		return "nothing"

	end

end



ConnectToMeArrival = function(curUser,data)

	if not curUser.bOperator then

		if not tImmune[curUser.sName] then

			if curUser.iShareSize < MinShare then

				return curUser:SendData("*** You have to share at least "..DoShareUnits(MinShare).." to be able to download.\r\n\                      How To: Type in mainchat       =======>     +share      <======     don't forget the   +   symbol"),1

			elseif curUser.iSlots < MinSlots then

				return curUser:SendData("*** You must have "..MinSlots.." open slots to be able to download."),1

			elseif (curUser.iNormalHubs + curUser.iRegHubs) > MaxHubs then

				return curUser:SendData("*** You can't be in more than "..MaxHubs.." hubs to be able to download."),1

			end

		end

	end

end 



RevConnectToMeArrival = ConnectToMeArrival

HillyBilly

Thnxs Mutor works fine now and for the explanation

Cheers HB

chettedeboeuf


SMF spam blocked by CleanTalk