Advertisement
Guest User

Info

a guest
Jun 30th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. screen = peripheral.wrap("monitor_0")
  2. rednet.open("left")
  3.  
  4. while true do
  5.  
  6. screen.clear()
  7.  
  8. id,msg,dist = rednet.receive()
  9.  
  10. rms = "Null"
  11.  
  12. screen.setCursorPos(10,1)
  13. screen.write("Power Status")
  14.  
  15. runningms = string.sub(msg, 0, 1)
  16. print(runningms)
  17.  
  18. if runningms == "0" then
  19.   print("seton")
  20.   rms = "ON"
  21. elseif runningms == "1" then
  22.   print("setoff")
  23.   rms = "OFF"
  24. end
  25. print(rms)
  26.  
  27. rf = string.sub(msg, (string.len(msg) - 1) * -1)
  28.  
  29. screen.setCursorPos(2,3)
  30. screen.write("RF Storage: ")
  31. screen.setTextColor(colors.blue)
  32. screen.write(rf.."   ")
  33. screen.setTextColor((tonumber(rf)>(4000000*.2)) and colors.green or colors.red)
  34. screen.write("("..math.floor((rf/4000000) * 100).."%)")
  35. screen.setTextColor(colors.white)
  36. screen.setCursorPos(2,4)
  37. screen.write("Fuel Engines are ")
  38. screen.setTextColor(colors.blue)
  39. screen.write(rms)
  40. screen.setTextColor(colors.white)
  41. print(rf..tonumber(rf))
  42. if tonumber(rf) < 250000 then
  43. redstone.setOutput("top", true)
  44.  
  45. end
  46.  
  47. sleep(1)
  48. redstone.setOutput("top", false)
  49. sleep(1)
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement