Hello There, Guest! Login Register


My Suggestions
#1
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 = "raw.githubusercontent.com"
local UPDATE_PATH = "/Icesythe7/GOS/master/BallBitch.lua".."?rand="..math.random(1,10000)
local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
local UPDATE_URL = "https://"..UPDATE_HOST..UPDATE_PATH

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)
                  return
                else
                  log("You have got the latest version ("..ServerVersion..")")
                end
          end
        else
          log("Error downloading version info")
        end
  end
end

a wait(seconds) function would be cool as well if it doesn't already exist xd
 
Reply
#2
Nice suggestion
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)