Found an error in octavo 1.0.2
 

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

Found an error in octavo 1.0.2

Started by Syphrone-NL, 10 August, 2006, 11:22:29

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Syphrone-NL

Found this error:
[12:14] Syntax .\Rincewind's Octavo/Functions.lua:559: bad argument #1 to 'pairs' (table expected, got nil)


its this line:
for name, t in pairs(message) do


of this peace:
----------------------------------------------------------------------------
-- Function Email Save Message
----------------------------------------------------------------------------
function EmailSaveMessage()

	local function parse(tbl)
		local str, tab ="", string.rep( "\t", 9)
		local function fquot(s) return string.format( "%q", s) end
		local function ncode( s ) if (s ~= "") and (string.sub(s,1,3) ~= "-n#") then local t = {}; for i = 1, string.len(s) do t[i] = string.byte(string.sub(s,i,i)); end; return "-n#"..table.concat(t, "#"); end; return s; end
		for a, t in pairs(tbl) do
			str = str.."\t\t{ ["..fquot("read").."] = "..t.read..", ["..fquot("who").."] = "..fquot(ncode(t.who))..", ["..fquot("when").."] = "..fquot(t.when)..",\n\t\t["..fquot("message").."] = "..fquot(ncode(t.message)).." },\n"
		end
		return str
	end
	local f = io.open ( "Rincewind's "..Product.."/Data/offline.dat", "w+" )
	local s = "message = {"
	for name, t in pairs(message) do
		s = s.."\n\t["..string.format( "%q", string.gsub( name, "\"", "\"")).."] = {\n"..parse(t).."\t},"
	end;
	f:write(s.."\n}")
	f:close()
end



And again an error:
[12:24] Syntax .\Rincewind's Octavo/WelcomeInfoFunction.lua:177: bad argument #1 to 'pairs' (table expected, got nil)


its this line:
for i, User in pairs(table) do


of this peace:
--// Profile Counter 
function ProfileCounter(profile) 
	local table, count = GetUsersByProfile(profile), 0 
	for i, User in pairs(table) do 
		if GetItemByName(User) then 
			count = count + 1 
		end 
	end 
	return count 
end
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

Rincewind

I've seen similar errors when developing. They tend to be indicative of other problems which once resolved sorts these errors too. Did you get any other errors?

Also what was happening in the hub when the errors were reported?

Syphrone-NL

Cant see any other errors because i get the error of welcome info everytime and want to see welcome info. Maybe something to do with lua 5.1??
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

Rincewind

I run Lua 5.1

You haven't added a new profile have you?

Syphrone-NL

no i didnt added a new profile only changed a little bit in the welcome info

----------------------------------------------------------------------------
-- welcome info
----------------------------------------------------------------------------
function WelcomeInfo(user) 

	local timeanddate = os.date("%d-%m-%Y %H:%M:%S") 
	local tmp = os.clock() 
	local topic = ""
	local minshare = ""
	local weeks, days, hours, minutes, seconds = math.floor(tmp/604800), math.floor(math.mod(tmp/86400, 7)), math.floor(math.mod(tmp/3600, 24)), math.floor(math.mod(tmp/60, 60)), math.floor(math.mod(tmp/1, 60)) 
	
	if frmHub:GetHubTopic() == nil then 
		topic = "No topic set" 
	else 
		topic = frmHub:GetHubTopic() 
	end
	
	if user.sMyInfoString then 
		local disp = "" 
		doGetProfile = GetProfileName(user.iProfile) or "Unregistered (to reg yourself type "..tGeneral.sPrefix.."regme and a password of your choice in main)" 
		local hubshare = string.format("%0.3f", frmHub:GetCurrentShareAmount()/(tb)).." TB" 
		local _,_,share = string.find(user.sMyInfoString, "^%$MyINFO %$ALL [^ ]+ [^$]*%$ $[^$]+[^$]%$[^$]*%$%s*(%d+)%$" ) 
		
		if share then 
			minshare = string.format("%0.3f", tonumber(share)/gb).." GB" 
		else 
			minshare = "Corrupt" 
		end 
		
		local border1 = "??????????????????????????? Welcome To "..frmHub:GetHubName().." ???????????????????????????\r\n" 
 		local border3 = " ??????????????????????????????????????????????????????????????????????????????????????????????????????" 
		disp = "\r\n\r\n"..border1.."??\r\n" 
		disp = disp.."?? Hub Name		: "..frmHub:GetHubName().."\r\n" 
		disp = disp.."?? Hub Owner		: "..tWelcomeInfo.HubOwner.."\r\n" 
		disp = disp.."?? Hub Address		: "..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."\r\n" 
		disp = disp.."?? Hub Date & Time	: "..timeanddate.."\r\n"
		
		if tWelcomeInfo.HubListAddress ~= "" then
			disp = disp.."?? Hub List Address		: "..tWelcomeInfo.HubListAddress.."\r\n" 
		end
		
		if tWelcomeInfo.WebAddress ~= "" then
			disp = disp.."?? Web Address		: "..tWelcomeInfo.WebAddress.."\r\n" 
		end
		
		if tWelcomeInfo.HubEmail ~= "" then
			disp = disp.."?? Hub Email		: "..tWelcomeInfo.HubEmail.."\r\n" 
		end
		
		disp = disp.."??\r\n"
		
		local sMasters = ""
		if tWelcomeInfo.bShowAllOps == 1 then
			for x, user in pairs(frmHub:GetRegisteredUsers()) do
				if user.iProfile == 0 then
					sMasters = sMasters..user.sNick..", "
				end
			end
		else
			for x, user in pairs(frmHub:GetOnlineUsers(0)) do
				sMasters = sMasters..user.sName..", "
			end
		end
		sMasters = string.sub(sMasters, 1, -3)
		if sMasters ~= "" then
			disp = disp.."?? Owner en Palace Admins		: "..string.gsub(sMasters,", ","\r\n?? \t\t\t  ").."\r\n"
		end

		local sFounders = ""
		if tWelcomeInfo.bShowAllOps == 1 then
			for x, user in pairs(frmHub:GetRegisteredUsers()) do
				if user.iProfile == 4 then
					sFounders = sFounders..user.sNick..", "
				end
			end
		else
			for x, user in pairs(frmHub:GetOnlineUsers(5)) do
				sFounders = sFounders..user.sName..", "
			end
		end
		sFounders = string.sub(sFounders, 1, -3)
		if sFounders ~= "" then
			disp = disp.."?? Palace Medewerkers		: "..string.gsub(sFounders,", ","\r\n?? \t\t\t  ").."\r\n"
		end

		local sModerators = ""
		if tWelcomeInfo.bShowAllOps == 1 then
			for x, user in pairs(frmHub:GetRegisteredUsers()) do
				if user.iProfile == 4 then
					sModerators = sModerators..user.sNick..", "
				end
			end
		else
			for x, user in pairs(frmHub:GetOnlineUsers(4)) do
				sModerators = sModerators..user.sName..", "
			end
		end
		sModerators = string.sub(sModerators, 1, -3)
		if sModerators ~= "" then
			disp = disp.."?? Special Vips		: "..string.gsub(sModerators,", ","\r\n?? \t\t\t  ").."\r\n"
		end
		
		local sOperators = ""
		if tWelcomeInfo.bShowAllOps == 1 then
			for x, user in pairs(frmHub:GetRegisteredUsers()) do
				if user.iProfile == 1 then
					sOperators = sOperators..user.sNick..", "
				end
			end
		else
			for x, user in pairs(frmHub:GetOnlineUsers(1)) do
				sOperators = sOperators..user.sName..", "
			end
		end
		sOperators = string.sub(sOperators, 1, -3)
		if sOperators ~= "" then
			disp = disp.."?? Operators		: "..string.gsub(sOperators,", ","\r\n?? \t\t\t  ").."\r\n"
		end
		disp = disp.."??\r\n"

		if tWelcomeInfo.NetworkName ~= "" then
			disp = disp.."?? Network Name		: "..tWelcomeInfo.NetworkName.."\r\n" 
		end
		if tWelcomeInfo.NetworkFounded ~= "" then
			disp = disp.."?? Network Founded	: "..tWelcomeInfo.NetworkFounded.."\r\n"
		end
		if tWelcomeInfo.NetworkOwner ~= "" then
			disp = disp.."?? Network Founder	: "..tWelcomeInfo.NetworkOwner.."\r\n"
		end
		if tWelcomeInfo.NetworkHubs ~= "" then
			disp = disp.."?? Network Hubs		: "..string.gsub(tWelcomeInfo.NetworkHubs,", ","\r\n??\t\t\t  ").."\r\n" 
		end
		if tWelcomeInfo.NetworkName ~= "" or tWelcomeInfo.NetworkOwner ~= "" or tWelcomeInfo.NetworkHubs ~= "" then
			disp = disp.."??\r\n"
		end
		
		disp = disp.."?? Your IP		: "..user.sIP.."\r\n" 
		disp = disp.."?? Your share size		: "..minshare.."\r\n" 
		disp = disp.."?? Your profile		: "..doGetProfile.."\r\n" 
		if sUserDescription ~= "" then
			disp = disp.."?? Your description is	: "..sUserDescription.."\r\n"
		end
		if user.sConnection then
			disp = disp.."?? Your connection is	: "..user.sConnection.."\r\n" 
		end
		if sUserEmail then 
			disp = disp.."?? Your email is		: "..sUserEmail.."\r\n"
		end
		disp = disp.."?? Your client is		: "..user.sClient.."\r\n" 
		if user.sClientVersion ~= nil then
			disp = disp.."?? Your client version is	: "..user.sClientVersion.."\r\n" 
		end
		disp = disp.."?? Your total hubs are	: "..user.iHubs.."\r\n" 
		disp = disp.."?? Your open slots are	: "..user.iSlots.."\r\n??\r\n"
		if tWelcomeInfo.MinShare ~= "" then
			disp = disp.."?? Min Share for users	: "..tWelcomeInfo.MinShare.."\r\n" 
		end
		disp = disp.."?? Total Share in this hub	: "..hubshare.."\r\n" 
		disp = disp.. "??\r\n"
		
		disp = disp.."?? There are "..ProfileCounter("master").." Master(s),"..ProfileCounter("Operator").." Operator(s),"..ProfileCounter("founder").." Palace Medewerkers(s),"..ProfileCounter("moderator").." Special Vip(s),"..ProfileCounter("Vip").." Vip(s),"..ProfileCounter("reg")..", Registered user(s) online.\r\n??\r\n"
		disp = disp.."?? There are now: "..frmHub:GetUsersCount().." of the "..frmHub:GetMaxUsers().." users online after "..weeks.." week(s) "..days.." day(s) "..hours.." hour(s) "..minutes.." minutes and "..seconds.." seconds\r\n??\r\n" 
		
		disp = disp..border1
		
		user:SendData(tBots.tWelcome.Name, disp) 
		
		disp = nil 
	end 
end


--// Profile Counter 
function ProfileCounter(profile) 
	local table, count = GetUsersByProfile(profile), 0 
	for i, User in pairs(table) do 
		if GetItemByName(User) then 
			count = count + 1 
		end 
	end 
	return count 
end


Heres what i have
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

SMF spam blocked by CleanTalk