SHOW:
|
|
- or go back to the newest paste.
| 1 | - | --Running Instructions |
| 1 | + | --[[ |
| 2 | - | --Start with <name>.wrapMon(side) |
| 2 | + | Function Descriptions: |
| 3 | - | --Next do <name>.print(text) |
| 3 | + | wrapMon : Wraps a monitor on the specified side |
| 4 | clear : Clears the monitor and resets the text | |
| 5 | - | --Local Variables |
| 5 | + | print : Writes the text and then goes to the next line (Bit buggy right now) |
| 6 | ]] | |
| 7 | ||
| 8 | --Local Functions | |
| 9 | local function getMonStats() | |
| 10 | monw,monh = apimon.getSize() | |
| 11 | end | |
| 12 | ||
| 13 | local function getMyStats() | |
| 14 | myx,myy = apimon.getCursorPos() | |
| 15 | end | |
| 16 | - | local function foobar() |
| 16 | + | |
| 17 | - | -- |
| 17 | + | local function inc() |
| 18 | - | end |
| 18 | + | local vx, vy = p.getCursorPos() |
| 19 | local vw, vh = p.getPageSize() | |
| 20 | - | --Testing Functions |
| 20 | + | cons = vy + 1 |
| 21 | - | function test() |
| 21 | + | ram = vh - 1 |
| 22 | if cons == ram then | |
| 23 | cons = 1 | |
| 24 | end | |
| 25 | end | |
| 26 | ||
| 27 | --Testing Functions (Remove before release) | |
| 28 | local function test() | |
| 29 | getMonStats() | |
| 30 | print(monw.." : "..monh) | |
| 31 | getMyStats() | |
| 32 | print(myx.." : "..myy) | |
| 33 | end | |
| 34 | ||
| 35 | --Public Functions | |
| 36 | function wrapMon(side) | |
| 37 | apimon = peripheral.wrap(side) | |
| 38 | getMyStats() | |
| 39 | getMonStats() | |
| 40 | end | |
| 41 | ||
| 42 | - | newh = myy + 1 |
| 42 | + | |
| 43 | - | apimon.setCursorPos(1,newh) |
| 43 | + | |
| 44 | apimon.setCursorPos(1,1) | |
| 45 | end | |
| 46 | ||
| 47 | function print(text) | |
| 48 | apimon.write(text) | |
| 49 | inc() | |
| 50 | p.setCursorPos(1,cons) | |
| 51 | end |