Advertisement
jakejakey1208

JakeOS settings

Apr 12th, 2015
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. local function clear()
  2. term.setTextColor(colors.white)
  3. term.setBackgroundColor(colors.gray)
  4. term.clear()
  5. term.setCursorPos(1, 1)
  6. term.setBackgroundColor(colors.blue)
  7. term.clearLine()
  8. term.setCursorPos(2, 1)
  9. write("JakeOS Settings")
  10. term.setCursorPos(2, 3)
  11. term.setBackgroundColor(colors.gray)
  12. end
  13. x, y = term.getSize()
  14. loadX = x - 1
  15. loadY = y - 1
  16. while true do
  17. clear()
  18. paintutils.drawFilledBox(2, 3, loadX, loadY, colors.cyan)
  19. term.setCursorPos(3, 4)
  20. term.setBackgroundColor(colors.cyan)
  21. write("Settings:")
  22. term.setCursorPos(3, 6)
  23. write("[1] Os Version")
  24. term.setCursorPos(3, 7)
  25. write("[2] Os Name")
  26. term.setCursorPos(3, 8)
  27. write("[3] Autorun Program")
  28. term.setCursorPos(3, 9)
  29. write("[4] Continue To OS")
  30. term.setCursorPos(4, 11)
  31. write("Only Press the keys if you want to add these.")
  32. evt, key = os.pullEvent("key")
  33. if key == 2 then
  34. clear()
  35. write("Version: ")
  36. oem = read()
  37. end
  38. if key == 3 then
  39. clear()
  40. write("Name: ")
  41. name = read()
  42. end
  43. if key == 4 then
  44. clear()
  45. write("Autorun: ")
  46. autorun = read()
  47. end
  48. if key == 5 then
  49. f = fs.open("/JakeOS/sys.config","w")
  50. if oem == nil then
  51. else
  52. f.writeLine("oem = '"..oem.."'")
  53. end
  54. if autorun == nil then
  55. else
  56. f.writeLine("autorun = '"..autorun.."'")
  57. end
  58. if name == nil then
  59. else
  60. f.writeLine("name = '"..name.."'")
  61. end
  62. os.reboot()
  63. end
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement