Advertisement
JOBGG

Untitled

Sep 21st, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. extractor = peripheral.wrap("bottom")
  2. input_direction = "left"
  3. output_direction = "right"
  4. function hasOre()
  5.     items = extractor.getAllStacks()
  6.     for i = 1,#items do
  7.         if string.find(items[i]["rawName"],"tile") then
  8.             return true
  9.         end
  10.     end
  11.     return false
  12. end
  13.  
  14. while true do
  15.     local event = os.pullEvent("redstone")
  16.     while rs.getInput(input_direction) do
  17.         sleep(1)
  18.         rs.setOutput(output_direction,hasOre())
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement