English table.uneval icon

8 comments
28.08.13 09:45:41 am
like 6 like it!
2 kb, 73 Downloads
MikuAuahDark
User
Offline Off
table.uneval function by user MikuAuahDark

∗ 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
Code:
1
2
3
f=io.open("pl_"..usgn..".txt","w")
f:write(table.uneval(PLAYERS[id]))
f:close()

> Load data
Code:
1
2
3
f=io.open("pl_"..usgn..".txt","r")
PLAYERS[id]=loadstring("return "..f:read("*a"))()
f:close()

> Error example
Code:
1
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 user 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
> > FIXED infinite-table loop
> > CHANGED function,thread,file variable type now outputs string: variable="Variable_type: Hexadecimal"
> V1.0
> > ADDED initial release
edited 5×, last 15.05.14 02:30:05 pm
ok This file has been reviewed and approved by Seekay (04.12.15 01:09:14 pm)

Comments

8 comments
Goto Page
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in
13.05.14 08:12:59 pm
like I like it!
Up
Ashley
BANNED
Offline Off
@user DarkNeko: , @user MikuAuahDark: made it , for some nice scripts , and Miku are making the good scripts that we need all the time , this is a table - loop script

about the file , nice work
11.05.14 04:33:05 pm
like I like it!
Up
DarkNeko
User
Offline Off
@user H-X: yes i now because i use that for scripting
(don't ask my script because i never upload script)
@user MikuAuahDark: /rian_idih before upload you must change the .txt file to .lua with format factory or anything is that change and can you teach me for scripting with bahasa(because my all script is simple)

and for all : this file is use for what ??
11.05.14 01:16:44 pm
Up
H-X
User
Offline Off
@user DarkNeko: Wow, you can guess what he used to make the script.

@file: nice work.

P.S: your description makes me dizzy.
11.05.14 10:07:35 am
like I like it!
Up
DarkNeko
User
Offline Off
@user EngiN33R: because his make lua script with notpad
30.08.13 10:02:18 am
like I like it!
Up
Jarates
User
Offline Off
Good job! I agree with engy he is genius!
30.08.13 09:46:33 am
like I like it!
Up
EngiN33R
Moderator
Offline Off
Nice job, but why do you always save your scripts as txt files?
29.08.13 07:20:26 pm
like I like it!
Up
omg
User
Offline Off
no way -w- does this do what i think it does? :3
28.08.13 09:48:34 am
like I like it!
Up
Deathliger
User
Offline Off
useful lua, also the lua was saved as .txt eks?
edited 1×, last 19.04.17 02:11:44 pm
To the start Previous 1 Next To the start