Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local l
- local b
- local r
- local lt = "TEMP: "
- local bt = "WASTE: "
- local rt = "FUEL: "
- local isOK = true
- local mon = peripheral.find("monitor")
- mon.clear()
- local function IsOK(rsStr)
- if rsStr < 15 then
- return true
- else
- return false
- end
- end
- local function TextColor(isOK)
- if isOK then
- return 8192
- else
- return 16384
- end
- end
- local function StatusText(isOK)
- if isOK then
- return "OK"
- else
- return "ERROR"
- end
- end
- local function SetText(x,y,isOk,t,s)
- mon.setCursorPos(x,y)
- mon.setTextColor(1)
- mon.write(t)
- mon.setTextColor(TextColor(isOK))
- mon.write(StatusText(isOK))
- end
- while true do
- os.pullEvent("redstone")
- l = rs.getAnalogInput("left")
- b = rs.getAnalogInput("back")
- r = rs.getAnalogInput("right")
- isOK = IsOK(l)
- SetText(1,1,isOK,lt,l)
- isOK = IsOK(b)
- SetText(1,2,isOK,lt,b)
- isOK = IsOK(r)
- SetText(1,3,isOK,lt,r)
- end
Advertisement
Add Comment
Please, Sign In to add comment