A nil value but it isn't nill :S
 

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

A nil value but it isn't nill :S

Started by [NL]ZeroX, 30 April, 2004, 16:09:29

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[NL]ZeroX

i get the error msg on ptokax:

Syntax error: attempt to concat global `Super' (a nil value)
stack traceback:
   1:  function `SendOPsUsers' at line 1118 [file `ToXiC/ToXiC.lua']
   2:  function `DataArrival' at line 346 [file `ToXiC/ToXiC.lua']



the part of code where the problem in is:
(the list of Super Users, Profile 2 is empty)

function SendOPsUsers (user, data)
	local OPUsers = GetUsersByProfile(GetProfileName(3))
	local Msg = "\r\n\t--------------------------------------------------------------------------------------"
	Msg = Msg.."\r\n\t\tOperators"
	Msg = Msg.."\r\n\t--------------------------------------------------------------------------------------"
	local OPUsersTemp = {}
	for OPIDX, n3 in OPUsers do
		tinsert(OPUsersTemp, n3)
	end
	sort(OPUsersTemp)
	for i=1,getn(OPUsersTemp) do 
	local _,_,ops = strfind(OPUsersTemp[i],"(%S+)")
	Msg = Msg.."\r\n\t\t"..ops..""
		if (not Msg) then
			Operator = Msg.."\r\n\t\tNo Operators Currently"
		elseif (Msg) then
			Operator = Msg
		end
	end


	local SUUsers = GetUsersByProfile(GetProfileName(2))
	local Msg = "\r\n\t--------------------------------------------------------------------------------------"
	Msg = Msg.."\r\n\t\tSuper Users"
	Msg = Msg.."\r\n\t--------------------------------------------------------------------------------------"
	local SUUsersTemp = {}
	for SUIDX, n2 in SUUsers do
		tinsert(SUUsersTemp, n2)
	end
	sort(SUUsersTemp)
	for i=1,getn(SUUsersTemp) do 
	local _,_,sus = strfind(SUUsersTemp[i],"(%S+)")
	Msg = Msg.."\r\n\t\t"..sus..""
		if (not Msg) then
			Super = Msg.."\r\n\t\tNo Operators Currently"
		elseif (Msg) then
			Super = Msg
		end
	end


	local MAUsers = GetUsersByProfile(GetProfileName(1))
	local Msg = "\r\n\t--------------------------------------------------------------------------------------"
	Msg = Msg.."\r\n\t\tMasters"
	Msg = Msg.."\r\n\t--------------------------------------------------------------------------------------"
	local MAUsersTemp = {}
	for MAIDX, n1 in MAUsers do
		tinsert(MAUsersTemp, n1)
	end
	sort(MAUsersTemp)
	for i=1,getn(MAUsersTemp) do 
	local _,_,mas = strfind(MAUsersTemp[i],"(%S+)")
	Msg = Msg.."\r\n\t\t"..mas..""
		if (not Msg) then
			Master = Msg.."\r\n\t\tNo Masters Currently"
		elseif (Msg) then
			Master = Msg
		end
	end


	local OwnerUsers = GetUsersByProfile(GetProfileName(0))
	local Msg = "\r\n\t--------------------------------------------------------------------------------------"
	Msg = Msg.."\r\n\t\tOwners"
	Msg = Msg.."\r\n\t--------------------------------------------------------------------------------------"
	local OwnerUsersTemp = {}
	for OwnerIDX, n0 in OwnerUsers do
		tinsert(OwnerUsersTemp, n0)
	end
	sort(OwnerUsersTemp)
	for i=1,getn(OwnerUsersTemp) do 
	local _,_,owner = strfind(OwnerUsersTemp[i],"(%S+)")
	Msg = Msg.."\r\n\t\t"..owner..""
		if (not Msg) then
			Owner = Msg.."\r\n\t\tNo Owners Currently"
		elseif (Msg) then
			Owner = Msg
		end
	end

	user:SendPM(Bot, Owner.."\r\n"..Master.."\r\n"..Super.." "..Operator.."\r\n")
end

btw i edited this script:
http://board.univ-angers.fr/thread.php?threadid=802&boardid=11&sid=f7cf3184e0cdb5ca8c314334662f3c60

[NL]ZeroX

never mind, fixed already:

i added to all the profiles:
if getn(SUUsersTemp) == 0 then
		Msg = Msg.."\r\n\t\tNo SuperUSers Currently\r\n"
		Super = Msg
	else ...

SMF spam blocked by CleanTalk