Hi all
I always get the following error
Quote[23:29] Syntax ...:\PTOKAX TESTHUB\PTOKAX 0.3.5.2g1\scripts\LV_3.1.lua:514: attempt to index local 'hFile' (a nil value)
[23:29] Syntax ...:\PTOKAX TESTHUB\PTOKAX 0.3.5.2g1\scripts\LV_3.1.lua:514: attempt to index local 'hFile' (a nil value)
[23:29] Fatal error in script LV_3.1.lua ! Script stopped!
[23:29] Syntax ...:\PTOKAX TESTHUB\PTOKAX 0.3.5.2g1\scripts\LV_3.1.lua:514: attempt to index local 'hFile' (a nil value)
[23:29] Syntax ...:\PTOKAX TESTHUB\PTOKAX 0.3.5.2g1\scripts\LV_3.1.lua:514: attempt to index local 'hFile' (a nil value)
and the line 514 is the following:
QuotehFile:write(sTab..sTableName.." = {\n")
Here is the whole involved paragraphe:
QuoteSerialize = function(tTable,sTableName,hFile,sTab)
sTab = sTab or ""
hFile:write(sTab..sTableName.." = {\n")
for key,value in pairs(tTable) do
if (type(value) ~= "function") then
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key)
if(type(value) == "table") then
Serialize(value,sKey,hFile,sTab.."\t")
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value)
hFile:write(sTab.."\t"..sKey.." = "..sValue)
end
hFile:write(",\n")
end
end
hFile:write(sTab.."}")
end
Thanks in advance for your assistance.
KR
baba.runner
Serelize look good.
But it most likely error some where else, what did you do when you got this error?
I was doing nothing special. Just looking at the script why I got this error.
That's all
I checked all my logs and I found nothing special.
Perhaps the analyse of what this serialize is doing and when does it do it, will help. But therefor you have to know the script very well :D
Now I wish stack traceback worked...
Quote from: baba.runner on 21 March, 2007, 23:18:35
Perhaps the analyse of what this serialize is doing and when does it do it, will help. But therefor you have to know the script very well :D
Serialize saves tabels to file, so to find this error, we would need to check every line that calls the function SaveToFile...
Hmm.. leviathan as first script on ptokax ?
No. I have Leviathan in 4th place, as I use an seperate AFK script, and ASCII script and a seperate Slot script. And I have to put them befor Levi, as otherwhise they do not work correctly.
and this way levi wont work correctly ;)
Yes, I remarked. But please tell me why and perhaps I can resolve it.
BTW: In regard to the slotbot do you want me to make a new thread or shall I write it in this thread?