This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Monthkiller's profile picture

--Deleted--

Started by Monthkiller, 22 August 2014 - 05:21 PM
Monthkiller #1
Posted 22 August 2014 - 07:21 PM
–Deleted–
Edited on 22 August 2014 - 11:22 PM
Lyqyd #2
Posted 22 August 2014 - 07:48 PM
Moved to General. We don't do program requests in Ask a Pro.
KingofGamesYami #3
Posted 22 August 2014 - 09:00 PM

local dir = "https://raw.githubusercontent.com/Monthkiller/BinoOS/master/"
local files = {
  "startup",
  "login",
  "login~",
  "main",
  "browsers/file",
  "editors/edit",
  "editors/edit~",
  "editors/ink",
  "editors/luaide",
  "editors/select",
  "editors/select~",
  "games/select",
  "games/select~",
  "utils/shutdown/select",
}

local directories = {
  "editors",
  "browsers",
  "games",
  "utils",
  "utils/shutdown",
}
for _, v in ipairs( directories ) do
 if not fs.isDir( v ) then
  fs.makeDir( v )
 end
end

local function download( dir, url )
  local response = http.get( url )
  if response then
   local file = fs.open( dir, "w" )
   file.write( response.readAll() )
   file.close()
   return true
  end
  return false
end
print( 'Starting downloads' )
for _, v in ipairs( files ) do
  if not download( v, dir .. v ) then
   error( "error downloading file: " .. v, 0 )
  end
  print( 'Downloaded ' .. v )
end
print( 'Rebooting' )
sleep( 1 )
os.reboot()

Add more files and directories to the tables as needed.
Edited on 22 August 2014 - 07:20 PM
Monthkiller #4
Posted 23 August 2014 - 01:20 AM
Thanks :)/>
Lyqyd #5
Posted 23 August 2014 - 02:31 AM
Don't edit the entire content out of your posts.