SHOW:
|
|
- or go back to the newest paste.
| 1 | function mine() | |
| 2 | - | redstone.setBundledOutput("right",1)
|
| 2 | + | redstone.setBundledOutput("right",1) --activating the tesseract through MFR rednet cable
|
| 3 | - | sleep(13) |
| 3 | + | sleep(13) --waiting for mining wells to finish |
| 4 | - | redstone.setBundledOutput("right",0)
|
| 4 | + | redstone.setBundledOutput("right",0) --deactivating the tesseract
|
| 5 | - | redstone.setOutput("bottom",true)
|
| 5 | + | redstone.setOutput("bottom",true) --activating force manipulator which is directly underneath
|
| 6 | - | sleep(2) |
| 6 | + | |
| 7 | - | redstone.setOutput("bottom",false)
|
| 7 | + | local p = peripheral.wrap("front") --wrapping an ender chest as a peripheral. ender chest is in front of the computer
|
| 8 | - | sleep(2) |
| 8 | + | while true do --loop |
| 9 | if p.getStackInSlot(1) then --checking if there is anything in slot 1(top right) of the ender chest and running the following code if there is | |
| 10 | - | local p = peripheral.wrap("front")
|
| 10 | + | |
| 11 | - | while true do |
| 11 | + | mine() --running the mine function which is defined above |
| 12 | - | if p.getStackInSlot(1) then |
| 12 | + | else --in the event that there is no item in the chest(your 'switch' is in off position) it just waits 5 seconds and exits the loop |
| 13 | print("false")
| |
| 14 | - | mine() |
| 14 | + | |
| 15 | - | else |
| 15 | + | |
| 16 | end |