Advertisement
Wassaa

gravesand

Apr 30th, 2020
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local sides = require("sides")
  2. local component = require("component")
  3.  
  4. inv=component.inventory_controller
  5. red=component.redstone
  6. sand=sides.south
  7. gravel=sides.east
  8. amt = 0
  9.  
  10. function amount(side,name)
  11.   if inv.getStackInSlot(side, 4) ~= nil then
  12.     amt = inv.getStackInSlot(side, 4).size
  13.   else
  14.     amt = 0
  15.   end
  16.  
  17.   print(name .." amount is " .. amt)
  18.   return amt
  19. end
  20.  
  21. while true do
  22.   if amount(sand, "Sand") > 1000 then
  23.     print("sand extract on")
  24.     red.setOutput(sand, 15)
  25.   else
  26.     print("sand extract off")
  27.     red.setOutput(sand, 0)
  28.   end
  29.  
  30.   if amount(gravel, "Gravel") > 1000 then
  31.     print("gravel extract on")
  32.     red.setOutput(gravel, 15)
  33.   else
  34.     print("gravel extract off")
  35.     red.setOutput(gravel, 0)
  36.   end
  37.   os.sleep(5)
  38. end
  39.  
  40.  
  41. amount(sand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement