Main Menu

Betterreq

Started by CadenCoaster, May 26, 2023, 10:24 PM

Previous topic - Next topic

CadenCoaster

This is a program that I made for the intent of making using libraries easier on big servers no I'm not sure this will actually serve it purpose but I had fun making it and I hope someone will find use of it just to clarify you can edit and re-upload this program and any others related to this project as long as you credit me somewhere as-well as a link to this post.
Anyways let me get to the installation process:
all you need to run to install the client script which will have the require function is:
pastebin get KDgMVq8H /startup/betterreq.lua
you need it in startup you cannot require it like a normal api because it modifies _G to allow you to use it even if you haven't run require("betterreq").
How you use the program is by using brequire(<module>,?<is url>)
For the server you will need to download a diffrent program:
pastebin get jCKpD32u betterreq_server.lua
I also made a utility program to make adding new libraries easier:
pastebin get 5TScGxQR newlib.lua


So let me give a quick rundown on the server end. All you need to do is run the server everything else is handled by the server but you need to run the server before you use newlib because the server will generate that data file for the libraries that your server will host.
I recommend using bg or fg to create a new window and in one run the server and in the other use newlib because I set up the server in a way that you don't need to restart the server every time you add a new library.


There are 3 different ways to send a library:
1. pastebin: you will give a pastebin id for use
2. web: you will give a url for use
3. file: you will give the path to a file for use

Now how to use newlib:
the command line syntax goes:
newlib <name> <method> <contents>
the name is want you want other people to require
the method is one of the ones mentioned above
the contents is stuff like pastebin id url or file path

*sorry if my formatting was a mess*