SHOW:
|
|
- or go back to the newest paste.
| 1 | foundMonitor = false | |
| 2 | mw, mh = 0 | |
| 3 | spawners = {}
| |
| 4 | spawners[0] = false | |
| 5 | spawners[1] = true | |
| 6 | red = 16384 | |
| 7 | green = 32 | |
| 8 | function drawBox(x,y,w,h,c) | |
| 9 | - | i, j = 0 |
| 9 | + | i = x |
| 10 | - | for i = x, w do |
| 10 | + | while i < w do |
| 11 | - | for j = y, h do |
| 11 | + | j = y |
| 12 | while j < h do | |
| 13 | paintutils.drawPixel(i,j,c) | |
| 14 | j = j+1 | |
| 15 | end | |
| 16 | i = i+1 | |
| 17 | end | |
| 18 | end | |
| 19 | function drawGUI() | |
| 20 | mon.setCursorPos(1,1) | |
| 21 | if spawners[0] == true then | |
| 22 | drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 32) | |
| 23 | else | |
| 24 | drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 2) | |
| 25 | end | |
| 26 | if spawners[1] == true then | |
| 27 | drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 32) | |
| 28 | else | |
| 29 | drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 2) | |
| 30 | end | |
| 31 | end | |
| 32 | function update() | |
| 33 | ||
| 34 | end | |
| 35 | ||
| 36 | function init() | |
| 37 | if peripheral.isPresent("bottom") then
| |
| 38 | mon = peripheral.wrap("bottom")
| |
| 39 | mw, mh = mon.getSize() | |
| 40 | mon.setBackgroundColor(1) | |
| 41 | mon.clear() | |
| 42 | term.redirect(mon) | |
| 43 | foundMonitor = true | |
| 44 | else | |
| 45 | foundMonitor = false | |
| 46 | print("Monitor not found - Aborting")
| |
| 47 | end | |
| 48 | if foundMonitor == true then | |
| 49 | --while true do | |
| 50 | update() | |
| 51 | drawGUI() | |
| 52 | sleep(1) | |
| 53 | --end | |
| 54 | term.restore() | |
| 55 | end | |
| 56 | end | |
| 57 | ||
| 58 | init() |