Advertisement
LukyKrob

Luky Instal

Jun 25th, 2022
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(17,6)
  3. print("LukyOS - Instalace")
  4. sleep(0.8)
  5.  
  6. -- Kontrola barevnosti PC
  7. if not term.isColor() then
  8.     term.setCursorPos(10,8)
  9.     print("LukyOS vyzaduje Advanced Computer.")
  10.     term.setCursorPos(13,9)
  11.     print("Toto neni Advanced Computer.")
  12.     sleep(4)
  13.     shell.run("clear")
  14.     return
  15. end
  16.  
  17. function get(code,fileName)
  18.     local response = http.get("https://pastebin.com/raw/"..textutils.urlEncode(code))
  19.     if response then
  20.         local responseText = response.readAll()
  21.         response.close()
  22.         newFile = fs.open(fileName,"w")
  23.         newFile.write(responseText)
  24.         newFile.close()
  25.     end
  26. end
  27.  
  28. term.clear()
  29. term.setCursorPos(11,8)
  30. print("Stahovani instalacniho souboru.")
  31. get("5U4uqkj6","API")
  32. get("W07fj9Lx","instal.lua")
  33. if fs.exists("API") then
  34.     if fs.exists("instal.lua") then
  35.         term.setCursorPos(14,9)
  36.         print("Spoustim instalacni soubor")
  37.         fs.delete(shell.getRunningProgram())
  38.         sleep(1)
  39.         shell.run("instal.lua")
  40.     else
  41.         term.setCursorPos(13,9)
  42.         print("Instalacni soubor nenalezen!")
  43.         sleep(1)
  44.     end
  45. else
  46.     term.setCursorPos(13,9)
  47.     print("    API data nenalezeny!    ")
  48.     sleep(1)
  49. end
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement