Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local direction = ">"
- mon = peripheral.wrap("top")
- term.redirect(mon)
- term.setScaleSize(0.5)
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function change(param1)
- direction = param1
- end
- function redraw()
- clear()
- write("\n+---+---+---+---+ +-Info-+\n")
- write("| | |Dir." ..direction.. " |\n")
- write("| | | |\n")
- write("| | +-Info-+\n")
- write("| |\n")
- write("+---+---+---+---+\n")
- write("| < | v | ^ | > |\n")
- write("+---+---+---+---+\n")
- if direction == ">" then
- term.setCursorPos(13, 7)
- elseif direction == "<" then
- term.setCursorPos(3, 7)
- elseif direction == "v" then
- term.setCursorPos(7, 7)
- elseif direction == "^" then
- term.setCursorPos(9, 7)
- end
- write("^")
- end
- while true do
- redraw()
- if rs.getInput("right") == true then
- clear()
- change(">")
- elseif rs.getInput("left") == true then
- clear()
- change("<")
- elseif rs.getInput("back") == true then
- clear()
- change("v")
- elseif rs.getInput("bottom") == true then
- clear()
- change("^")
- end
- sleep(0)
- end
- term.restore()
Advertisement
Add Comment
Please, Sign In to add comment