Scarpet Request | /script get
SuperDragonite2172 opened this issue ยท 3 comments
The Idea
I had an idea for a way for Carpet users to quickly and easily download and install scripts to their world. An new choice for the /script
command: get
.
The Implementation
/script get
requires two arguments, a category and a name. The category refers to the folders in the Scarpet Github repository and the name is the name of the desired script. If the specified script exists, it will automatically be downloaded For example: the command /script get survival angel_block.sc
will download the angel_block
script from the Scarpet repo and put it in the scripts
folder for the current world, creating the folder if it doesn't already exist. The command would only work for scripts in the repo to limit the chances for malicious use.
The Challenges
The main sticking point with this suggestion would be the need to add some sort of web handler to access the Scarpet repo.
Additionally, I'm not sure if auto-complete would be possible without repeated queries to the repo.
Special Thanks
Special thanks to Kollum in the Scicraft Discord for helping refine the idea when explaining it to them.
good idea.
I suggest 'download' not 'get' as get is much more generic, and 'install' would not imply taking stuff from the net.
I would also suggest keeping path like access due to the fact that the repo could be branching so /script download survival/angel_block
would attempt to fetch from programs/survival/angel_block.sc
.
In terms of placement - all apps need to lay flat in the scripts folder, so that makes things little easier.
Special thanks to Kollum in the Scicraft Discord for helping refine the idea when explaining it to them.
Thanks mate, I aprpeciate it (Im Ghoulboy here, btw, the reason behind the nickname Kollum is long and complicated)
This seems like it could be useful, it reads the content of a github page as code. Idk abt the tab completion yet tho https://crunchify.com/in-java-how-to-read-github-file-contents-using-httpurlconnection-convert-stream-to-string-utility/