SHOW:
|
|
- or go back to the newest paste.
1 | - | local robot = require("robot") |
1 | + | local robot = require("robot") |
2 | - | local component = require("component") |
2 | + | local component = require("component") |
3 | - | local i_c = component.inventory_controller |
3 | + | local i_c = component.inventory_controller |
4 | - | local sides = require("sides") |
4 | + | local sides = require("sides") |
5 | - | local term = require("term") |
5 | + | local term = require("term") |
6 | - | |
6 | + | |
7 | - | term.clear() |
7 | + | term.clear() |
8 | - | |
8 | + | |
9 | - | print("LEVSHX SOFTWARE") |
9 | + | print("LEVSHX SOFTWARE") |
10 | - | |
10 | + | |
11 | - | function dropRES() |
11 | + | function dropRES() |
12 | - | local i = 1 |
12 | + | local i = 1 |
13 | - | robot.turnLeft() |
13 | + | robot.turnLeft() |
14 | - | for i=1, 16 do |
14 | + | for i=1, 16 do |
15 | - | robot.select(i) |
15 | + | robot.select(i) |
16 | - | i_c.dropIntoSlot(sides.front, i ) |
16 | + | i_c.dropIntoSlot(sides.front, i ) |
17 | end | |
18 | - | robot.turnRight() |
18 | + | robot.turnRight() |
19 | - | robot.select(1) |
19 | + | robot.select(1) |
20 | end | |
21 | - | |
21 | + | |
22 | - | function takeRES() |
22 | + | function takeRES() |
23 | - | robot.turnAround() |
23 | + | robot.turnAround() |
24 | - | local inv, item = i_c.getInventorySize(sides.front) |
24 | + | local inv, item = i_c.getInventorySize(sides.front) |
25 | - | for slot = 1, inv do |
25 | + | for slot = 1, inv do |
26 | - | item = i_c.getStackInSlot(sides.front, slot) |
26 | + | item = i_c.getStackInSlot(sides.front, slot) |
27 | - | if item then |
27 | + | if item then |
28 | - | i_c.suckFromSlot(sides.front, slot) |
28 | + | i_c.suckFromSlot(sides.front, slot) |
29 | - | break |
29 | + | break |
30 | end | |
31 | end | |
32 | - | robot.turnAround() |
32 | + | robot.turnAround() |
33 | end | |
34 | - | |
34 | + | |
35 | - | function workRES() |
35 | + | function workRES() |
36 | - | robot.select(1) |
36 | + | robot.select(1) |
37 | - | local items_count = robot.count(1) |
37 | + | local items_count = robot.count(1) |
38 | - | for i=1, items_count do |
38 | + | for i=1, items_count do |
39 | - | robot.place() |
39 | + | robot.place() |
40 | - | robot.swing() |
40 | + | robot.swing() |
41 | end | |
42 | end | |
43 | - | |
43 | + | |
44 | - | while true do |
44 | + | while true do |
45 | - | takeRES() |
45 | + | takeRES() |
46 | - | workRES() |
46 | + | workRES() |
47 | - | dropRES() |
47 | + | dropRES() |
48 | - | term.clear() |
48 | + | term.clear() |
49 | - | print("") |
49 | + | print("") |
50 | - | print("") |
50 | + | print("") |
51 | - | print("") |
51 | + | print("") |
52 | - | print("") |
52 | + | print("") |
53 | - | print(" LEVSHX SOFTWARE") |
53 | + | print(" LEVSHX SOFTWARE") |
54 | - | print("") |
54 | + | print("") |
55 | - | print("") |
55 | + | print("") |
56 | - | print(" Press Ctrl+Alt+C for exit program") |
56 | + | print(" Press Ctrl+Alt+C for exit program") |
57 | - | os.sleep(1) |
57 | + | os.sleep(1) |
58 | - | term.clear() |
58 | + | term.clear() |
59 | - | print("") |
59 | + | print("") |
60 | - | print("") |
60 | + | print("") |
61 | - | print("") |
61 | + | print("") |
62 | - | print("") |
62 | + | print("") |
63 | - | print(" LEVSHX SOFTWARE ") |
63 | + | print(" LEVSHX SOFTWARE ") |
64 | - | print("") |
64 | + | print("") |
65 | - | print("") |
65 | + | print("") |
66 | - | print(" Robot working ... wait") |
66 | + | print(" Robot working ... wait") |
67 | end |