SHOW:
|
|
- or go back to the newest paste.
| 1 | rednet.close("back")
| |
| 2 | sleep(.5) | |
| 3 | rednet.open("back")
| |
| 4 | ||
| 5 | m = peripheral.wrap("top")
| |
| 6 | ||
| 7 | drillid = 15 | |
| 8 | energyid = 17 | |
| 9 | reaktorid = 18 | |
| 10 | fireworkid = 19 | |
| 11 | armataid = 21 | |
| 12 | turbineid = 34 | |
| 13 | ||
| 14 | local function sluchaj(x,y) | |
| 15 | rednet.send(x,y) | |
| 16 | id,msg = rednet.receive() | |
| 17 | return msg | |
| 18 | end | |
| 19 | ||
| 20 | while true do | |
| 21 | drill = sluchaj(drillid,"drill") | |
| 22 | energy = sluchaj(energyid,"energy") | |
| 23 | reaktor = sluchaj(reaktorid,"reaktor") | |
| 24 | reaktorp = sluchaj(reaktorid,"reaktorp") | |
| 25 | reaktore = sluchaj(turbineid,"reaktore") | |
| 26 | reaktore = math.floor(reaktore/100)/10 | |
| 27 | reaktort = sluchaj(reaktorid,"reaktort") | |
| 28 | armata = sluchaj(armataid,"armata") | |
| 29 | ||
| 30 | if energy >= 0 and energy <= 33 then energycolor = colors.red | |
| 31 | elseif energy > 33 and energy <= 66 then energycolor = colors.orange | |
| 32 | elseif energy > 66 and energy < 99 then energycolor = colors.green | |
| 33 | elseif energy >= 99 then energycolor = colors.green energy = 100 end | |
| 34 | ||
| 35 | if drill == "on" then drillcolor = colors.green | |
| 36 | else drillcolor = colors.red end | |
| 37 | ||
| 38 | if reaktor == "on" then reaktorcolor = colors.green | |
| 39 | else reaktorcolor = colors.red end | |
| 40 | ||
| 41 | if armata == "on" then armatacolor = colors.green | |
| 42 | - | term.clear() |
| 42 | + | |
| 43 | - | term.setCursorPos(1,1) |
| 43 | + | |
| 44 | - | print("Panel Sterowania")
|
| 44 | + | m.clear() |
| 45 | - | term.setCursorPos(19,1) |
| 45 | + | m.setCursorPos(1,1) |
| 46 | - | print(textutils.formatTime(os.time(),false)) |
| 46 | + | m.write("Panel Sterowania")
|
| 47 | - | term.setBackgroundColor(energycolor) |
| 47 | + | m.setCursorPos(19,1) |
| 48 | - | term.setCursorPos(8,3) |
| 48 | + | m.write(textutils.formatTime(os.time(),false)) |
| 49 | - | print("Energia: ")
|
| 49 | + | m.setBackgroundColor(energycolor) |
| 50 | - | term.setCursorPos(17,3) |
| 50 | + | m.setCursorPos(8,3) |
| 51 | - | print(energy.."%") |
| 51 | + | m.write("Energia: ")
|
| 52 | m.setCursorPos(17,3) | |
| 53 | - | paintutils.drawFilledBox(2,5,10,7,drillcolor) -- x2,9 y4,6 |
| 53 | + | m.write(energy.."%") |
| 54 | ||
| 55 | - | paintutils.drawFilledBox(2,9,10,11,colors.cyan) |
| 55 | + | m.setCursorPos(4,6) |
| 56 | - | paintutils.drawFilledBox(2,13,10,15,colors.lime) |
| 56 | + | m.setBackgroundColor(drillcolor) |
| 57 | - | paintutils.drawFilledBox(14,7,25,13,reaktorcolor) |
| 57 | + | m.write("DRILL")
|
| 58 | - | paintutils.drawFilledBox(14,15,25,17,armatacolor) |
| 58 | + | m.setCursorPos(16,8) |
| 59 | - | paintutils.drawFilledBox(2,17,12,17,colors.gray) |
| 59 | + | m.setBackgroundColor(reaktorcolor) |
| 60 | - | paintutils.drawFilledBox(12,5,12,17,colors.gray) |
| 60 | + | m.write("Reaktor")
|
| 61 | - | paintutils.drawFilledBox(2,19,25,19,colors.green) |
| 61 | + | m.setCursorPos(15,10) |
| 62 | - | term.setCursorPos(14,5) |
| 62 | + | m.write("Fuel: "..reaktorp.."%")
|
| 63 | - | term.setBackgroundColor(colors.cyan) |
| 63 | + | m.setCursorPos(15,11) |
| 64 | - | print(" Odswiez ")
|
| 64 | + | m.write("RF/t: "..reaktore.."K")
|
| 65 | - | term.setCursorPos(4,6) |
| 65 | + | m.setCursorPos(15,12) |
| 66 | - | term.setBackgroundColor(drillcolor) |
| 66 | + | m.write("Temp: "..reaktort.."C")
|
| 67 | - | print("DRILL")
|
| 67 | + | |
| 68 | - | term.setCursorPos(5,10) |
| 68 | + | m.setBackgroundColor(colors.black) |
| 69 | - | term.setBackgroundColor(colors.cyan) |
| 69 | + | m.setCursorPos(2,17) |
| 70 | - | print("[-]")
|
| 70 | + | sleep(1) |
| 71 | - | term.setCursorPos(5,14) |
| 71 | + |