Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.close("back")
- sleep(.5)
- rednet.open("back")
- drillid = 15
- energyid = 17
- reaktorid = 18
- fireworkid = 19
- armataid = 21
- turbineid = 34
- local function sluchaj(x,y)
- rednet.send(x,y)
- id,msg = rednet.receive()
- return msg
- end
- while true do
- drill = sluchaj(drillid,"drill")
- energy = sluchaj(energyid,"energy")
- reaktor = sluchaj(reaktorid,"reaktor")
- reaktorp = sluchaj(reaktorid,"reaktorp")
- reaktore = sluchaj(turbineid,"reaktore")
- reaktore = math.floor(reaktore/100)/10
- reaktort = sluchaj(reaktorid,"reaktort")
- armata = sluchaj(armataid,"armata")
- if energy >= 0 and energy <= 33 then energycolor = colors.red
- elseif energy > 33 and energy <= 66 then energycolor = colors.orange
- elseif energy > 66 and energy < 99 then energycolor = colors.green
- elseif energy >= 99 then energycolor = colors.green energy = 100 end
- if drill == "on" then drillcolor = colors.green
- else drillcolor = colors.red end
- if reaktor == "on" then reaktorcolor = colors.green
- else reaktorcolor = colors.red end
- if armata == "on" then armatacolor = colors.green
- else armatacolor = colors.red end
- term.clear()
- term.setCursorPos(1,1)
- print("Panel Sterowania")
- term.setCursorPos(19,1)
- print(textutils.formatTime(os.time(),false))
- term.setBackgroundColor(energycolor)
- term.setCursorPos(8,3)
- print("Energia: ")
- term.setCursorPos(17,3)
- print(energy.."%")
- paintutils.drawFilledBox(2,5,10,7,drillcolor) -- x2,9 y4,6
- paintutils.drawFilledBox(2,9,10,11,colors.cyan)
- paintutils.drawFilledBox(2,13,10,15,colors.lime)
- paintutils.drawFilledBox(14,7,25,13,reaktorcolor)
- paintutils.drawFilledBox(14,15,25,17,armatacolor)
- paintutils.drawFilledBox(2,17,12,17,colors.gray)
- paintutils.drawFilledBox(12,5,12,17,colors.gray)
- paintutils.drawFilledBox(2,19,25,19,colors.green)
- term.setCursorPos(14,5)
- term.setBackgroundColor(colors.cyan)
- print(" Odswiez ")
- term.setCursorPos(4,6)
- term.setBackgroundColor(drillcolor)
- print("DRILL")
- term.setCursorPos(5,10)
- term.setBackgroundColor(colors.cyan)
- print("[-]")
- term.setCursorPos(5,14)
- term.setBackgroundColor(colors.lime)
- print("[-]")
- term.setCursorPos(16,8)
- term.setBackgroundColor(reaktorcolor)
- print("Reaktor")
- term.setCursorPos(15,10)
- print("Fuel: "..reaktorp.."%")
- term.setCursorPos(15,11)
- print("RF/t: "..reaktore.."K")
- term.setCursorPos(15,12)
- print("Temp: "..reaktort.."C")
- term.setBackgroundColor(armatacolor)
- term.setCursorPos(17,16)
- print("Armata")
- term.setBackgroundColor(colors.green)
- term.setCursorPos(8,19)
- print("Fajerwerki!")
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(3,17)
- print("by se7en")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(2,17)
- local evnt = { os.pullEvent("mouse_click") }
- local x = evnt[3]
- local y = evnt[4]
- if y >= 5 and y <= 7 and x >= 2 and x <= 10 then
- if drill == "on" then
- rednet.send(drillid,"drilloff")
- else
- rednet.send(drillid,"drillon")
- end
- sleep(.5)
- end
- if y >= 7 and y <= 13 and x >= 14 and x <= 25 then
- if reaktor == "on" then
- rednet.send(reaktorid,"reaktoroff")
- else
- rednet.send(reaktorid,"reaktoron")
- end
- sleep(.5)
- end
- if y >= 17 and y <= 17 and x >= 2 and x <= 12 then
- sleep(.1)
- end
- if y >= 19 and y <= 19 and x >= 1 and x <= 25 then
- rednet.send(fireworkid,"go")
- sleep(.1)
- end
- if y >= 15 and y <= 17 and x >= 14 and x <= 25 then
- if armata == "on" then
- rednet.send(armataid,"armataoff")
- else
- rednet.send(armataid,"armataon")
- end
- sleep(.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement