Advertisement
RabaGhast

TankReciever

Sep 28th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. modem = peripheral.wrap("right")
  3. modem.open(100)
  4.  
  5. sleepTime = 10
  6. warning = 10
  7.  
  8. while true do
  9.   event, side, frequency, replyFrequency, percentfull, distance = os.pullEvent("modem_message")
  10.   print("Message is as follows: "..percentfull)
  11.   mon.clear()
  12.   mon.setCursorPos(3,3)
  13.  
  14.  if percentfull < warning then
  15.      mon.setTextColour(colours.red)
  16.   elseif percentfull > 90 then
  17.      mon.setTextColour(colours.green)
  18.   end
  19.   mon.write(percentfull.."%")
  20.   print(percentfull.."%")
  21.   sleep(sleepTime)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement