My Suggestions - Printable Version

+- PROShine (
+-- Forum: PROShine (
+--- Forum: Ideas and suggestions (
+--- Thread: My Suggestions (/thread-2673.html)

My Suggestions - Icesythe7 - 2017-09-23

I would like to suggest that on proshine start that if the folders "scripts" and "libs" does not exist that they be created this way it is easier for users to know where things go all libraries in libs and scripts in scripts as such lua require should point to the libs folder in the applications directory, also I would suggest the following api be added so that devs can auto update their scripts for users downloadFile(path, url) and getWebResult(url) as well as scriptPath() which would return the path of the script that called it and fileName() would return the name of the file that calls it, and libPath() which returns the library folder obv, this way users only have to install scripts 1 time. An example of how an auto update would work...

local version = "0.03"
local AUTOUPDATE = true
local UPDATE_HOST = ""
local UPDATE_PATH = "/Icesythe7/GOS/master/BallBitch.lua".."?rand="..math.random(1,10000)

function onStart()
  if AUTOUPDATE then
      local ServerData = GetWebResult(UPDATE_HOST,"/Icesythe7/GOS/master/BallBitch.version")
        if ServerData then
          ServerVersion = type(tonumber(ServerData)) == "number" and tonumber(ServerData) or nil
          if ServerVersion then
                if tonumber(version) < ServerVersion then
                  log("New version available "..ServerVersion)
                  log("Updating, please don't restart the script!")
                  DelayAction(function() DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () log("Successfully updated. ("..version.." => "..ServerVersion.."), please restart the script.") end) end, 2)
                  log("You have got the latest version ("..ServerVersion..")")
          log("Error downloading version info")

a wait(seconds) function would be cool as well if it doesn't already exist xd

RE: My Suggestions - Tisor - 2017-09-25

Nice suggestion