PtokaX forum

Archive => Leviathan => AllInOne Scripts => Archived 5.1 boards => Leviathan - Bugs => Topic started by: baba.runner on 21 March, 2007, 00:01:53

Title: Problem in LV_3.1.lua
Post by: baba.runner on 21 March, 2007, 00:01:53
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
Title: Re: Problem in LV_3.1.lua
Post by: Madman on 21 March, 2007, 05:56:58
Serelize look good.
But it most likely error some where else, what did you do when you got this error?
Title: Re: Problem in LV_3.1.lua
Post by: baba.runner on 21 March, 2007, 23:18:35
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
Title: Re: Problem in LV_3.1.lua
Post by: bastya_elvtars on 22 March, 2007, 00:00:50
Now I wish stack traceback worked...
Title: Re: Problem in LV_3.1.lua
Post by: Madman on 22 March, 2007, 05:56:03
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...
Title: Re: Problem in LV_3.1.lua
Post by: Cêñoßy†ê on 22 March, 2007, 09:40:25
Hmm.. leviathan as first script on ptokax ?
Title: Re: Problem in LV_3.1.lua
Post by: baba.runner on 22 March, 2007, 14:10:11
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.
Title: Re: Problem in LV_3.1.lua
Post by: Cêñoßy†ê on 22 March, 2007, 17:27:26
and this way levi wont work correctly ;)
Title: Re: Problem in LV_3.1.lua
Post by: baba.runner on 22 March, 2007, 19:23:45
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?