SHOW:
|
|
- or go back to the newest paste.
| 1 | local direction = ">" | |
| 2 | ||
| 3 | function clear() | |
| 4 | term.clear() | |
| 5 | term.setCursorPos(1,1) | |
| 6 | end | |
| 7 | ||
| 8 | function change(param1) | |
| 9 | direction = param1 | |
| 10 | end | |
| 11 | ||
| 12 | function redraw() | |
| 13 | clear() | |
| 14 | - | write("+---+---+---+---+ +-Info-+\n")
|
| 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(7, 13) | |
| 24 | elseif direction == "<" then | |
| 25 | term.setCursorPos(7, 3) | |
| 26 | elseif direction == "v" then | |
| 27 | term.setCursorPos(7, 7) | |
| 28 | elseif direction == "^" then | |
| 29 | term.setCursorPos(7, 9) | |
| 30 | end | |
| 31 | ||
| 32 | write("^")
| |
| 33 | end | |
| 34 | ||
| 35 | while true do | |
| 36 | redraw() | |
| 37 | if rs.getInput("right") == true then
| |
| 38 | clear() | |
| 39 | change(">")
| |
| 40 | elseif rs.getInput("left") == true then
| |
| 41 | clear() | |
| 42 | change("<")
| |
| 43 | elseif rs.getInput("back") == true then
| |
| 44 | clear() | |
| 45 | change("v")
| |
| 46 | elseif rs.getInput("bottom") == true then
| |
| 47 | clear() | |
| 48 | change("^")
| |
| 49 | end | |
| 50 | ||
| 51 | sleep(0) | |
| 52 | end |