Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x, y = term.getCursorPos()
- local function bkg()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- end
- local function openperipheral()
- term.setCursorPos(9, 4)
- write("1)Terminal glass")
- end
- local function turnoff()
- term.setBackgroundColor(colors.lightGray)
- write("||")
- term.setBackgroundColor(colors.blue)
- write(" ")
- bkg()
- end
- local function turnon()
- term.setBackgroundColor(colors.blue)
- write(" ")
- term.setBackgroundColor(colors.lightGray)
- write("||")
- bkg()
- end
- local function clrscr()
- term.setBackgroundColor(colors.white)
- term.clear()
- end
- local function firststart()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- print(" Configuration X")
- end
- clrscr()
- firststart()
- bkg()
- openperipheral()
- term.setCursorPos(29, 4)
- if fs.exists("openperipheral.conf") then
- term.setCursorPos(29, 4)
- turnon()
- else
- term.setCursorPos(29, 4)
- turnoff()
- end
- term.setCursorPos(3, 18)
- write("change:")
- asdf = read()
- if asdf == "1" then
- term.clear()
- term.setCursorPos(2, 3)
- write("Do you have OpenPeripheral mod?")
- print("Y/n?")
- term.setCursorPos(2, 5)
- write(">")
- asdf = read()
- if (asdf == "") or (asdf == "Y") or (asdf == "y") then
- print("okay, where is terminal glasses detector?")
- print("top/bottom/left/right/back?")
- write(">")
- asdf = read()
- if (asdf == "top") or (asdf == "bottom") or (asdf == "left") or (asdf == "right") or (asdf == "back") then
- openperipheral = fs.open("openperipheral.conf", "w")
- openperipheral.writeLine(asdf)
- openperipheral.close()
- os.reboot()
- else
- write("error: too many arguments")
- end
- end
- elseif asdf == "2" then
- print("This is bad argument")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement