Descrption
Just like the name(uneval). it's inversion of loadstring but this function only apply to tables.
This lua is useful when you want save player data.
Features
Multi-dimensional Array support
Tabulated output
How to Install
Just put table_uneval.txt at desired folder(sys/lua). EDIT server.lua to dofile the lua
Reserved Global Variables
none, as the function is created inside table table(the table.insert location)
Information
Hooks: 0
Size: 567 bytes(*_desc.txt is 1159)
Functions
table.uneval(t(table)[,tabulation(number)])
Desc: this function return a string that represents the table
Parameters:
t - the table that want to uneval
tabulation - the tabulation level(can be ignored)
Returns: string that represent the table(string)
Limitations
another type of variable(file,function,thread) is represented as "<variable_type>: <Hexadecimal_Address>"
Notes
1. Actually i don't want to upload it at file archive as it's very small script
2. Bugs? Suggestion? on comments
Example
Save data
1
2
3
2
3
f=io.open("pl_"..usgn..".txt","w") f:write(table.uneval(PLAYERS[id])) f:close()
1
2
3
2
3
f=io.open("pl_"..usgn..".txt","r") PLAYERS[id]=loadstring("return "..f:read("*a"))() f:close()
1
2
2
s=table.uneval(_G) -- LUA ERROR: infinite-loop detected -- Reason: _G global variable also have _G key and value same as _G(_G._G==_G)
Rules
You can use it for your server
You can edit it
You can upload at another website, say MikuAuahDark made it
You can't say this is yours
You can't upload on another website without put me on credits
Version History
V1.1
infinite-table loop
function,thread,file variable type now outputs string: variable="Variable_type: Hexadecimal"
V1.0
initial release
edited 5×, last 15.05.14 02:30:05 pm
Approved by Seekay
Download
2 kb, 463 Downloads