Advertisement
Myst1ka

Email - Client

Dec 15th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 KB | None | 0 0
  1. local Root = ".Network/"
  2. local iRoot = ".Network/Info/"
  3.  
  4. function clear()
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. end
  8.  
  9. function Reset()
  10. clear()
  11. term.setTextColor(colors.red)
  12. write("E-Mail Network")
  13. term.setTextColor(colors.yellow)
  14. printTR("- Installer -")
  15. term.setTextColor(colors.white)
  16. printTM("[ Client Edition ]")
  17. w, h = term.getSize()
  18. print(string.rep("-", w)) write("\n")
  19. end
  20.  
  21. function printTR( text )
  22. w, h = term.getSize()
  23. term.setCursorPos(w - #text, 1)
  24. write(text)
  25. end
  26.  
  27. function printTM( text )
  28. local w, h = term.getSize()
  29. term.setCursorPos((w - #text) / 2, 1)
  30. write(text)
  31. end
  32.  
  33. function printC( text )
  34. local x, y = term.getSize()
  35. term.setCursorPos(( x - string.len(text)) / 2, y / 2)
  36. write( text )
  37. end
  38.  
  39.  
  40. Reset()
  41. term.setTextColor(colors.yellow)
  42. print("Setting Up Directories...")
  43. os.sleep(1)
  44. fs.makeDir(Root)
  45. fs.makeDir(iRoot)
  46. print("Getting Needed Files...")
  47. Network = http.get("http://dl.dropbox.com/u/39147094/E-Mail%20Network/Client/Network.lua")
  48. Startup = http.get("http://dl.dropbox.com/u/39147094/E-Mail%20Network/Client/Startup")
  49. f = fs.open("startup", "w")
  50. f.write(Startup.readAll())
  51. f.close()
  52. f = fs.open(Root .. "Network.lua", "w")
  53. f.write(Network.readAll())
  54. f.close()
  55. term.setTextColor(colors.lime)
  56. print("\nDone!")
  57. os.sleep(1)
  58. Reset()
  59. print("E-Mail Server Downloaded Successfully!\nEdition: Client")
  60. term.setTextColor(colors.yellow)
  61. print("\n(-)Ok")
  62. term.setTextColor(colors.white)
  63. repeat
  64. event, key = os.pullEvent("key")
  65. os.sleep(0.1)
  66. until key == 28
  67. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement