SHOW:
|
|
- or go back to the newest paste.
1 | - | local sides = require("sides") |
1 | + | local sides = require("sides") |
2 | - | local component = require("component") |
2 | + | local component = require("component") |
3 | - | |
3 | + | |
4 | - | sand=component.proxy("a64a2542-b1cc-49bd-bb43-39416c64c671") |
4 | + | inv=component.inventory_controller |
5 | - | gravel=component.proxy("a473f7f7-9fc1-4950-be51-5d021e6b2475") |
5 | + | red=component.redstone |
6 | - | |
6 | + | sand=sides.south |
7 | - | function amount(compo,name) |
7 | + | gravel=sides.east |
8 | - | |
8 | + | amt = 0 |
9 | - | print(name .." amount is " .. compo.getStackInSlot(sides.east, 4).size) |
9 | + | |
10 | - | return compo.getStackInSlot(sides.east, 4).size |
10 | + | function amount(side,name) |
11 | - | end |
11 | + | if inv.getStackInSlot(side, 4) ~= nil then |
12 | - | |
12 | + | amt = inv.getStackInSlot(side, 4).size |
13 | - | while true do |
13 | + | else |
14 | - | if amount(sand, "Sand") > 1000 then |
14 | + | amt = 0 |
15 | - | print("sand extract on") |
15 | + | end |
16 | - | else |
16 | + | |
17 | - | print("sand extract off") |
17 | + | print(name .." amount is " .. amt) |
18 | - | end |
18 | + | return amt |
19 | - | |
19 | + | end |
20 | - | if amount(gravel, "Gravel") > 1000 then |
20 | + | |
21 | - | print("gravel extract on") |
21 | + | while true do |
22 | - | else |
22 | + | if amount(sand, "Sand") > 1000 then |
23 | - | print("gravel extract off") |
23 | + | print("sand extract on") |
24 | - | end |
24 | + | red.setOutput(sand, 15) |
25 | - | os.sleep(5) |
25 | + | else |
26 | - | end |
26 | + | print("sand extract off") |
27 | - | |
27 | + | red.setOutput(sand, 0) |
28 | - | |
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) |