Solved downloading github raw files to folder

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
You mean it won't allow you to save the file in a subfolder?

I think i see what you mean. What about this:
code_language.skript:
Set {_filename} to "Archer-1.schematic"
download file from "https://github.com/Efnilite/TowerDefence/raw/master/%{_filename}%" to file "server/folder/%{_filename}%"
 
  • Like
Reactions: Efnilite
You mean it won't allow you to save the file in a subfolder?

I think i see what you mean. What about this:
code_language.skript:
Set {_filename} to "Archer-1.schematic"
download file from "https://github.com/Efnilite/TowerDefence/raw/master/%{_filename}%" to file "server/folder/%{_filename}%"
holy shit you're an absolute genius
 
holy shit you're an absolute genius
Not quite but i'm glad i could help you

Here's a way you can automatically grab the filename:
code_language.skript:
command /test:
    trigger:
        set {_link} to "https://github.com/Efnilite/TowerDefence/raw/master/Archer-1.schematic"
        set {_link::*} to {_link} split at "/"
        set {_filename} to size of {_link::*}
        set {_filename} to {_link::%{_filename}%}
        send "%{_filename}%"

This code could be a lot shorter but it won't let me go there without errors. But it works, try any link!

/edit:
SkUtilities has expression for this im stupid :emoji_grinning:
Try this:
code_language.skript:
command /test:
    trigger:
        set {_link} to "https://github.com/Efnilite/TowerDefence/raw/master/Archer-1.schematic"
        send "%name of file {_link}%.%extension of file {_link}%"
 
Last edited:
Status
Not open for further replies.