diff --git a/update.lua b/update.lua index de542df..4781e79 100644 --- a/update.lua +++ b/update.lua @@ -1,4 +1,5 @@ -local CONFIG_URL = "https://raw.githubusercontent.com/Neoblacks/scriptLua/main/script.lua" + +local CONFIG_URL = "https://git.devconcept.pro/Neoblacks/scriptLua/raw/branch/main/update.lua" local function downloadFile(url, dest) local response = http.get(url) @@ -14,12 +15,15 @@ end -- Demander à l'utilisateur la destination du fichier print("Entrez le chemin de destination du fichier (ex: script.lua):") -local destination = io.read() - +local fileToUpdate = io.read() -- Lire l'entrée de l'utilisateur +-- Si l'utilisateur tape un espace dans le nom le remplacer par underscore +fileToUpdate = fileToUpdate:gsub(" ", "_") -- Vérifier que l'utilisateur a bien entré quelque chose -if destination and destination ~= "" then - downloadFile(CONFIG_URL, destination) + +local DOWNLOAD_URL = "https://git.devconcept.pro/Neoblacks/scriptLua/raw/branch/main/" + fileToUpdate +if fileToUpdate and fileToUpdate ~= "" then + downloadFile(DOWNLOAD_URL, fileToUpdate) else - print("Aucune destination spécifiée, utilisation du nom par défaut: script.lua") - downloadFile(CONFIG_URL, "script.lua") + print("Aucune destination spécifiée, utilisation du nom par défaut: script.lua") + downloadFile(CONFIG_URL, "script.lua") end