SHOW:
|
|
- or go back to the newest paste.
| 1 | local direction = ">" | |
| 2 | - | mon = peripheral.wrap("top")
|
| 2 | + | |
| 3 | - | term.redirect(mon) |
| 3 | + | |
| 4 | - | mon.setTextScale(1) |
| 4 | + | term.clear() |
| 5 | term.setCursorPos(1,1) | |
| 6 | end | |
| 7 | ||
| 8 | - | term.clear() |
| 8 | + | |
| 9 | - | term.setCursorPos(1,1) |
| 9 | + | |
| 10 | end | |
| 11 | ||
| 12 | function redraw() | |
| 13 | clear() | |
| 14 | write("\n+---+---+---+---+ +-Info-+\n")
| |
| 15 | write("| | |Dir." ..direction.. " |\n")
| |
| 16 | write("| | | |\n")
| |
| 17 | write("| | +-Info-+\n")
| |
| 18 | write("| |\n")
| |
| 19 | write("+---+---+---+---+\n")
| |
| 20 | write("| < | v | ^ | > |\n")
| |
| 21 | write("+---+---+---+---+\n")
| |
| 22 | if direction == ">" then | |
| 23 | term.setCursorPos(15, 9) | |
| 24 | elseif direction == "<" then | |
| 25 | term.setCursorPos(3, 9) | |
| 26 | elseif direction == "v" then | |
| 27 | - | term.setCursorPos(13, 7) |
| 27 | + | term.setCursorPos(7, 9) |
| 28 | elseif direction == "^" then | |
| 29 | - | term.setCursorPos(3, 7) |
| 29 | + | term.setCursorPos(11, 9) |
| 30 | end | |
| 31 | - | term.setCursorPos(7, 7) |
| 31 | + | |
| 32 | write("^")
| |
| 33 | - | term.setCursorPos(9, 7) |
| 33 | + | |
| 34 | ||
| 35 | while true do | |
| 36 | redraw() | |
| 37 | if rs.getInput("right") == true then
| |
| 38 | clear() | |
| 39 | change(">")
| |
| 40 | redraw() | |
| 41 | elseif rs.getInput("left") == true then
| |
| 42 | clear() | |
| 43 | change("<")
| |
| 44 | redraw() | |
| 45 | elseif rs.getInput("back") == true then
| |
| 46 | clear() | |
| 47 | change("v")
| |
| 48 | redraw() | |
| 49 | elseif rs.getInput("bottom") == true then
| |
| 50 | clear() | |
| 51 | change("^")
| |
| 52 | redraw() | |
| 53 | end | |
| 54 | ||
| 55 | redraw() | |
| 56 | sleep(0) | |
| 57 | redraw() | |
| 58 | - | term.restore() |
| 58 | + | end |