1. Post #1
    -HP-'s Avatar
    April 2009
    56 Posts
    What is wrong with this code?

    Code:
        local h_a, h_b, h_c = debug.gethook()
        debug.sethook()
        local write = glon.encode(variable)
        debug.sethook(h_a, h_b, h_c)
        file.Write("file.txt", write)
    It gives this error:

    :74: bad argument #1 to 'sethook' (function expected, got string)

  2. Post #2
    Gold Member
    Skyhawk's Avatar
    July 2008
    1,545 Posts
    What in the name of Garry are you trying to do?

  3. Post #3
    Gold Member
    Skapocalypse's Avatar
    November 2008
    769 Posts
    how exactly is encoding glon giving an infinite loop? O.o

  4. Post #4
    Respected User
    JSharpe's Avatar
    January 2008
    891 Posts
    Notes section of GLON

    Have you tried it without the debugset/get ?

  5. Post #5
    -HP-'s Avatar
    April 2009
    56 Posts
    Notes section of GLON

    Have you tried it without the debugset/get ?
    Yes, that's what I had from the beginning. After a while the variable (which is a large table) became too big, and it popped out an infinite loop error. That's why I added the debug things I found on the wiki, and now it gives me the said error.

  6. Post #6
    Ask Xyxen about L-Leaf.
    mcd1992's Avatar
    March 2008
    424 Posts
    -HP- If your table keeps getting bigger and bigger then you might be adding duplicate values into your table, what is the code that is adding to the table

  7. Post #7
    -HP-'s Avatar
    April 2009
    56 Posts
    -HP- If your table keeps getting bigger and bigger then you might be adding duplicate values into your table, what is the code that is adding to the table
    That's not the problem, the point is that it is a large table, and it gives infinite loop error when GLON'd.

  8. Post #8
    Gold Member
    Nevec's Avatar
    June 2008
    1,094 Posts
    -HP- If your table keeps getting bigger and bigger then you might be adding duplicate values into your table, what is the code that is adding to the table
    Content doesn't matter at all.

    Garry should lower the infinite loop security a bit.

  9. Post #9
    Taught by John Lua
    MakeR's Avatar
    May 2007
    2,914 Posts
    I have been getting the same error while trying to prevent infinite loop errors also, but only recently.

  10. Post #10
    -HP-'s Avatar
    April 2009
    56 Posts
    I have been getting the same error while trying to prevent infinite loop errors also, but only recently.
    Maybe Garry broke something?

    Anyone else having this problem?

    Is there any other way to avoid the infinite loop error, or should I just split up the array and save it to different text files, and merge it again when it is loaded?
    No, wait, that would also give infinite loop error, since I'll have to use a loop to load the txt files :(

  11. Post #11
    -HP-'s Avatar
    April 2009
    56 Posts
    Maybe Garry broke something?

    Anyone else having this problem?

    Is there any other way to avoid the infinite loop error, or should I just split up the array and save it to different text files, and merge it again when it is loaded?
    No, wait, that would also give infinite loop error, since I'll have to use a loop to load the txt files :(
    *bump*

  12. Post #12
    -HP-'s Avatar
    April 2009
    56 Posts
    Another bump, I need a solution for this. Will the table keyvalue functions work, or do they too give infinite loop errors if the table is too big? I'm talking a very large table here.

  13. Post #13
    Gold Member
    Skyhawk's Avatar
    July 2008
    1,545 Posts
    Mind telling us why the table is so large in the first place? Perhaps there is a more effective way of doing it?

  14. Post #14
    -HP-'s Avatar
    April 2009
    56 Posts
    The table is so large because it stores data for a chatbot, and I don't think there is a much more efficient way of doing it.

  15. Post #15
    Gold Member
    Gbps's Avatar
    December 2008
    3,645 Posts
    util.TableToKeyValues should not have problems with inf. loop protection, try using that. It does the same thing that glon does except it only has the ability to only store text and numbers, which should be the only things you are using.

  16. Post #16
    -HP-'s Avatar
    April 2009
    56 Posts
    util.TableToKeyValues should not have problems with inf. loop protection, try using that. It does the same thing that glon does except it only has the ability to only store text and numbers, which should be the only things you are using.
    Thank you, I will use that then. I am only using text and numbers, so that is perfect.