Advertisement
tima_gt

tde-config

Sep 30th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. local x, y = term.getCursorPos()
  2. local function bkg()
  3. term.setBackgroundColor(colors.white)
  4. term.setTextColor(colors.black)
  5. end
  6. local function openperipheral()
  7. term.setCursorPos(9, 4)
  8. write("1)Terminal glass")
  9. end
  10. local function turnoff()
  11. term.setBackgroundColor(colors.lightGray)
  12. write("||")
  13. term.setBackgroundColor(colors.blue)
  14. write(" ")
  15. bkg()
  16. end
  17. local function turnon()
  18. term.setBackgroundColor(colors.blue)
  19. write(" ")
  20. term.setBackgroundColor(colors.lightGray)
  21. write("||")
  22. bkg()
  23. end
  24. local function clrscr()
  25. term.setBackgroundColor(colors.white)
  26. term.clear()
  27. end
  28. local function firststart()
  29. term.setCursorPos(1, 1)
  30. term.setBackgroundColor(colors.black)
  31. term.setTextColor(colors.white)
  32. print(" Configuration X")
  33. end
  34. clrscr()
  35. firststart()
  36. bkg()
  37. openperipheral()
  38. term.setCursorPos(29, 4)
  39. if fs.exists("openperipheral.conf") then
  40. term.setCursorPos(29, 4)
  41. turnon()
  42. else
  43. term.setCursorPos(29, 4)
  44. turnoff()
  45. end
  46. term.setCursorPos(3, 18)
  47. write("change:")
  48. asdf = read()
  49. if asdf == "1" then
  50. term.clear()
  51. term.setCursorPos(2, 3)
  52. write("Do you have OpenPeripheral mod?")
  53. print("Y/n?")
  54. term.setCursorPos(2, 5)
  55. write(">")
  56. asdf = read()
  57. if (asdf == "") or (asdf == "Y") or (asdf == "y") then
  58. print("okay, where is terminal glasses detector?")
  59. print("top/bottom/left/right/back?")
  60. write(">")
  61. asdf = read()
  62. if (asdf == "top") or (asdf == "bottom") or (asdf == "left") or (asdf == "right") or (asdf == "back") then
  63. openperipheral = fs.open("openperipheral.conf", "w")
  64. openperipheral.writeLine(asdf)
  65. openperipheral.close()
  66. os.reboot()
  67. else
  68. write("error: too many arguments")
  69. end
  70. end
  71. elseif asdf == "2" then
  72. print("This is bad argument")
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement