akihex

drumMachine

Jul 9th, 2014
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local signalSide = "left"
  2. local drum = peripheral.wrap("front")
  3. --local rTank = peripheral.wrap("back")
  4. --local limit = -256000
  5. --local limit = -3500000
  6. local tank, rtank
  7.  
  8. while true do
  9.   --rtank = rTank.getTankInfo("in")
  10.   --if(rtank and rtank[1] and rtank[1].amount-rtank[1].capacity >= limit) then
  11.    
  12.     if not turtle.detect() then
  13.       print("Trying to place new drum.")
  14.       --encourage block placer to do his job
  15.       redstone.setOutput(signalSide,true)
  16.       sleep(1)
  17.       redstone.setOutput(signalSide,false)
  18.     end
  19.   --end
  20.   if turtle.detect() then
  21.     drum = peripheral.wrap("front")
  22.     if drum then
  23.       tank = drum.getTankInfo("in")
  24.       if(tank and tank[1] and tank[1].amount-tank[1].capacity>=0) then
  25.         turtle.dig()
  26.        redstone.setOutput(signalSide,true)
  27.         sleep(1)
  28.         redstone.setOutput(signalSide,false)
  29.       end
  30.     end
  31.   end
  32.   sleep(10)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment