• GLON, infinite loops and debug.SetHook
    15 replies, posted
  • 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)[/code] It gives this error: :74: bad argument #1 to 'sethook' (function expected, got string)
  • Avatar of JSharpe
  • [url=http://wiki.garrysmod.com/?title=Glon#Notes]Notes section of GLON[/url] Have you tried it without the debugset/get ?
  • [QUOTE=JSharpe;16488389][url=http://wiki.garrysmod.com/?title=Glon#Notes]Notes section of GLON[/url] Have you tried it without the debugset/get ?[/QUOTE] 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.
  • Avatar of mcd1992
  • -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
  • [QUOTE=mcd1992;16496367]-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[/QUOTE] That's not the problem, the point is that it is a large table, and it gives infinite loop error when GLON'd.
  • Avatar of Nev
  • [QUOTE=mcd1992;16496367]-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[/QUOTE] Content doesn't matter at all. Garry should lower the infinite loop security a bit.
  • Avatar of MakeR
  • I have been getting the same error while trying to prevent infinite loop errors also, but only recently.
  • [QUOTE=MakeR;16496436]I have been getting the same error while trying to prevent infinite loop errors also, but only recently.[/QUOTE] 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 :(
  • [QUOTE=-HP-;16496491]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 :([/QUOTE] *bump*
  • 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 [i]very[/i] large table here.
  • Avatar of Skyhawk
  • Mind telling us why the table is so large in the first place? Perhaps there is a more effective way of doing it?
  • 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.
  • Avatar of Gbps
  • 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.
  • [QUOTE=Gbps;16652092]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.[/QUOTE] Thank you, I will use that then. I am only using text and numbers, so that is perfect.