Removing unpack() cap

] lua_run_cl filex.Append( “HelixScripts/tables/_R.txt”, unpack( _R ) )
:1: too many results to unpack

FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

No really… Is it possible to remove this annoying protection?

[editline]05:53AM[/editline]

Well… I tryed this: lua_run_cl filex.Append( “HelixScripts/tables/_R.txt”, util.TableToKeyValues( _R ) )
It crashed my Garry’s Mod with the error: Lua Error Dump
Looks like i’ll never see the true secrets that lie in the _R metatable.

PrintTable(_R)

[editline]07:41AM[/editline]

Obviously, you won’t be able to save the contents to a file using that.

[editline]07:52AM[/editline]

Also, you can only unpack sequential tables.

Copy - Paste :dance:

[editline]08:45AM[/editline]

Or you could probably write a PrintTable function that would write to a file.

Or you could just copypasta the PrintTable function out of utils.lua and edit it a bit to save to a file.

Ah that’s where it’s hidden! Thanks, I was looking for it.

You think I didn’t know PrintTable…? Sigh… I’ll find a way to save it.

Untested but probably works :
[lua]local OutputString = “”

function WriteTable(t,filename)
ReadTable(t)
file.Write(“tables/”…filename…".txt", OutputString)
OutputString = “”
end

local function AddToOutput(str)
OutputString = OutputString + str
end

local function ReadTable( t, indent, done )

done = done or {}
indent = indent or 0

for key, value in pairs (t) do

	AddToOutput( string.rep ("	", indent) )

	if type (value) == "table" and not done [value] then

      		done [value] = true
      		AddToOutput(tostring (key) .. ":" .. "

");
ReadTable (value, indent + 2, done)

    	else

      		AddToOutput(tostring (key) .. "	=	")
      		AddToOutput(tostring(value) .. "

")

    	end

end

end[/lua]

This is a modified PrintTable
http://luabin.foszor.com/code/lua/includes/util.lua#30

wow… Ungrateful.

That was quite a big hint, yrah.