Files

> > CS2D > Lua Scripts > table.uneval
Files overviewCS2D overviewLua Scripts overview

English table.uneval >

8 comments2 kb, 467 Downloads

old table.uneval

MikuAuahDark
User Off Offline

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
1
2
3
f=io.open("pl_"..usgn..".txt","w")
f:write(table.uneval(PLAYERS[id]))
f:close()
> Load data
1
2
3
f=io.open("pl_"..usgn..".txt","r")
PLAYERS[id]=loadstring("return "..f:read("*a"))()
f:close()
> Error example
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
Approved by Seekay

Download Download

2 kb, 467 Downloads

Comments

8 comments
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

Ashley
BANNED Off Offline

@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
I like it!

old

DarkNeko
User Off Offline

@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 ??
I like it!

old

H-X
User Off Offline

@user DarkNeko: Wow, you can guess what he used to make the script.

@file: nice work.

P.S: your description makes me dizzy.

old

DarkNeko
User Off Offline

@user EngiN33R: because his make lua script with notpad
I like it!

old

Jarates
User Off Offline

Good job! I agree with engy he is genius!
I like it!

old

EngiN33R
Moderator Off Offline

Nice job, but why do you always save your scripts as txt files?
I like it!

old

omg
User Off Offline

no way -w- does this do what i think it does? :3
I like it!

old

Deathliger
User Off Offline

useful lua, also the lua was saved as .txt eks?
I like it!
edited 1×, last 19.04.17 02:11:44 pm
To the start Previous 1 Next To the start