function getAvailableVersion(updateURL)
for i = 1, 3 do
response = http.get(updateURL)
if response then
data = response.readAll()
if currentVersion ~= data then
print "Update Available, Downloading!"
if not fs.exists("/systemFiles/Install/updater") then
print "Installer Missing!"
downloadFiles("https://raw.github.com/hbomb79/securitySystemPro/master/updater", "/systemFiles/Install/updater")
end
print ("Latest Version: "..data)
print ("Running Version: "..currentVersion)
print "Running Updater!"
if fs.exists"/systemFiles/Install/updater" then
shell.run "/systemFiles/Install/updater"
else
error "The Updater Is Missing! This Should Have Been Downloaded At Install, Reboot To Try Again, Or Report!"
end
else
print "You Are Running The Latest Version"
error "Running Latest Version"
return true
end
else
error ("The URL: "..updateURL.." Does Not Seem To Exist [404]")
end
end
error ("[208] An error occurred whilst received a response from: "..updateURL)
end
getAvailableVersion("https://raw.githubusercontent.com/hbomb79/securitySystemPro/master/version")
even tho they both equal two it continues, the lines of code that print new and current both say two and yet it still says theres an update, where as if i go and change the line that says:
data = response.readAll()
to:
data = 2
Then it works fine!
Can someone tell me what im doing wrong?