Categories > Coding > Lua >

[RELEASE] JSON Config Lib


New Reply

Posts: 293

Threads: 31

Joined: Feb, 2021

Reputation: 3

  • 0

Posted

Hello there.

I made this really tiny library that uses HttpService:JSONEncode() and HttpService:JSONDecode() to work.

 

This is really useful in most cases when making a script. This makes writing config files way easier than before.

 

I did nothing much other than making the lib.

 

Remember, You can only read configs that exist, So don't forget to write one before reading it lol.

 

Here is the loadstring and documentation: 

local lib = loadstring(game:HttpGet("https://pastebin.com/raw/LQXdJMKt"))()

--[[
void WriteConfig(fileName, content)
Writes a JSON config file with the given filename and content.

void ReadConfig(fileName)
Returns a table from the read config which you can use.

bool IsConfig(fileName)
Returns true if the config exists, false if not.
]]

 

Here are examples for all of the functions in the lib:

--Write Config
local lib = loadstring(game:HttpGet("https://pastebin.com/raw/LQXdJMKt"))()

local example_table = {
    money = 20,
    isbroke = true,
    msg = "This is a example script lol"
}

lib.WriteConfig("example_config", example_table)

--[[
Output: Nothing, It writes a config with the given data.
]]

 

--Read Config

local lib = loadstring(game:HttpGet("https://pastebin.com/raw/LQXdJMKt"))()

local table_uwu = lib.ReadConfig("example_config")

print("I have $"..tostring(table_uwu.money))
print("I am broke? That is "..tostring(table_uwu.isbroke))
print(table_uwu.msg)

--[[
Output:
I have $20
I am broke? That is true
This is a example script lol
]]

 

--IsConfig (Probably useless as WriteConfig has a file handler [*writefile()])

local lib = loadstring(game:HttpGet("https://pastebin.com/raw/LQXdJMKt"))()

print(lib.IsConfig("example_config"))

--[[
Output:
true
]]

Exploits I got: Insanity V2, Synapse, SW.

Discord: Ad#3175

DM if you need something, Don't hesitate to ask for help.

Posts: 558

Threads: 46

Joined: Apr, 2022

Reputation: 18

  • 1

Replied

very epik release

Posts: 293

Threads: 31

Joined: Feb, 2021

Reputation: 3

  • 0

Replied

@atari thanks dedi atawi

Exploits I got: Insanity V2, Synapse, SW.

Discord: Ad#3175

DM if you need something, Don't hesitate to ask for help.

Posts: 155

Threads: 16

Joined: Jul, 2021

Reputation: 4

  • 1

Replied

this honestly seems useless, but im sure someone out there might need this

hi how are you

Aja

Zenexya#2964

Mention

Posts: 1125

Threads: 126

Joined: Apr, 2021

Reputation: 0

  • 0

Replied

Thanks to your library I just learned knowledge about Lua tables lmao

 

Anyways, vouch, cool release

luxiferrwoo

! exprssn.sentiment#9999

Mention

Posts: 116

Threads: 25

Joined: May, 2022

Reputation: 10

  • 0

Replied

@child1010

 

this doesn't seem useless at all, this actually seems useful if you're making a script and want your users to be able to save their config fast and easy. I'm not sure if a script developer would include the library instead of just implementing it into their script but still a good addition.

13 | [c, cpp, lua, python]

! exprssn.sentiment#9999 | https://github.com/expressiongz

 

Posts: 155

Threads: 16

Joined: Jul, 2021

Reputation: 4

  • 0

Replied

@luxiferrwoo oh sorry, i meant to say it was useless to me personally.

hi how are you

Posts: 78

Threads: 15

Joined: Mar, 2022

Reputation: 0

  • 0

Replied

nice very cool

exploits i use: kiwi x

Posts: 94

Threads: 8

Joined: May, 2022

Reputation: 0

  • 0

Replied

epic epic :vouch:


New Reply

Users viewing this thread:


( Members: 0, Guests: 1, Total: 1 )