Dateien

> > CS2D > Lua Scripts > table.uneval
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch table.uneval >

8 Kommentare2 kb, 429 Downloads

alt 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
5× editiert, zuletzt 15.05.14 14:30:05
Zugelassen von Seekay

Download Download

2 kb, 429 Downloads

Kommentare

8 Kommentare
Zum Anfang Vorherige 1 Nächste Zum Anfang

Logge dich ein!

Du musst dich einloggen, um selber Kommentare verfassen zu können!Einloggen

alt

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
Ich mag es!

alt

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 ??
Ich mag es!

alt

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.

alt

DarkNeko
User Off Offline

@user EngiN33R: because his make lua script with notpad
Ich mag es!

alt

Jarates
User Off Offline

Good job! I agree with engy he is genius!
Ich mag es!

alt

EngiN33R
Moderator Off Offline

Nice job, but why do you always save your scripts as txt files?
Ich mag es!

alt

omg
User Off Offline

no way -w- does this do what i think it does? :3
Ich mag es!

alt

Deathliger
User Off Offline

useful lua, also the lua was saved as .txt eks?
Ich mag es!
1× editiert, zuletzt 19.04.17 14:11:44
Zum Anfang Vorherige 1 Nächste Zum Anfang