Advertisement
ozybrum

Energy & Tank Monitor Script - Redstone Control

Jul 26th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. rednet.open("back")
  2. print("Waighting for Boss!!!")
  3. local boss = rednet.receive()
  4. print("Boss is id:"..boss)
  5. print("IC2 power level: Left")
  6. print("TE power level: Right")
  7. while true do
  8.         local a,b = os.pullEvent()
  9.         if b == "hud" then
  10.                 rednet.broadcast("toggle")
  11.         end
  12.         local id, analog = rednet.receive()
  13.         if analog ~= "Hello" then
  14.                 if id == boss and analog[1] < 16 and analog[2] < 16 then
  15.                         rs.setAnalogOutput("left",tonumber(analog[1]))
  16.                         rs.setAnalogOutput("right",tonumber(analog[2]))
  17.                         --print("Left:"..analog[1].." Right:"..analog[2])
  18.                 else
  19.                         print("YOUR NOT MY BOSS!!!!")
  20.                 end
  21.         end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement