SHOW:
|
|
- or go back to the newest paste.
1 | function RCT() | |
2 | while true do | |
3 | - | local scrap, msg = rednet.recieve() |
3 | + | local scrap, msg = rednet.receive() |
4 | - | local td = turtle.detect() |
4 | + | |
5 | if turtle.detect() == false then | |
6 | - | print("Attempting to Move Forward") |
6 | + | |
7 | - | if td == true then |
7 | + | |
8 | - | print("Move Failed, Block Detected!") |
8 | + | |
9 | - | else |
9 | + | if turtle.detect() then |
10 | - | print("Success! Moving Forward") |
10 | + | |
11 | end | |
12 | elseif msg == "RCGF" then | |
13 | if turtle.detect() then | |
14 | - | print("Moving and Mining Forward") |
14 | + | |
15 | - | if td == true then |
15 | + | |
16 | - | print("Block detected, Mining and Moving Forward") |
16 | + | |
17 | elseif msg == "RCPF" then | |
18 | - | else |
18 | + | if turtle.detect() == false then |
19 | - | print("No block detected, Moving Forward normally") |
19 | + | |
20 | end | |
21 | elseif msg == "RCAF" then | |
22 | - | elseif msg == "RCBF" then |
22 | + | |
23 | - | print("Attempting to Mine Block at Front") |
23 | + | |
24 | - | if td == true then |
24 | + | |
25 | - | print("Mining Block at Front") |
25 | + | |
26 | turtle.turnLeft() | |
27 | - | else |
27 | + | |
28 | - | print("Mine Front Failed! No Block to Mine") |
28 | + | |
29 | elseif msg == "RCU" then | |
30 | if turtle.detectUp() == false then | |
31 | - | print("Attempting to Place block Front") |
31 | + | |
32 | - | if turtle.detect() == true then |
32 | + | |
33 | - | print("Place block Front Failed! Block Detected") |
33 | + | |
34 | - | else |
34 | + | if turtle.detectUp() then |
35 | - | print("Placing block Front") |
35 | + | |
36 | end | |
37 | elseif msg == "RCGU" then | |
38 | if turtle.detectUp() then | |
39 | - | print("Attacking Front") |
39 | + | |
40 | end | |
41 | turtle.up() | |
42 | - | print("Moving Backwards") |
42 | + | |
43 | if turtle.detectUp() ==false then | |
44 | turtle.placeUp() | |
45 | - | print("Turning Right") |
45 | + | |
46 | elseif msg == "RCAU" then | |
47 | turtle.attackUp() | |
48 | - | print("Turning Left") |
48 | + | |
49 | if turtle.detectDown() == false then | |
50 | turtle.down() | |
51 | - | print("Attempting to Move Up") |
51 | + | |
52 | - | if turtle.detectUp() == true then |
52 | + | |
53 | - | print("Move Up Failed! Block Detected") |
53 | + | if turtle.detectDown() then |
54 | - | else |
54 | + | |
55 | - | print("Success! Moving Up") |
55 | + | |
56 | elseif msg == "RCGD" then | |
57 | if turtle.detectDown() then | |
58 | turtle.digDown() | |
59 | - | print("Moving and Mining Up") |
59 | + | |
60 | - | if turtle.detectUp() == true then |
60 | + | |
61 | - | print("Block detected, Mining and Moving Up") |
61 | + | |
62 | if turtle.detectDown() == false then | |
63 | - | else |
63 | + | |
64 | - | print("No block detected, Moving Up normally") |
64 | + | |
65 | elseif msg == "RCAD" then | |
66 | turtle.attackDown() | |
67 | - | elseif msg == "RCBU" then |
67 | + | |
68 | - | print("Attempting to Mine Block Above") |
68 | + | |
69 | - | if turtle.detectUp() == true then |
69 | + | |
70 | - | print("Mining Block Above") |
70 | + | |
71 | elseif msg == "RC3" then | |
72 | - | else |
72 | + | |
73 | - | print("Mine Up Failed! No Block to Mine") |
73 | + | |
74 | turtle.select(4) | |
75 | elseif msg == "RC5" then | |
76 | - | print("Attempting to Place Block Up") |
76 | + | |
77 | - | if turtle.detectUp() == true then |
77 | + | |
78 | - | print("Place block Up Failed! Block Detected") |
78 | + | |
79 | - | else |
79 | + | |
80 | - | print("Placing Block Up") |
80 | + | |
81 | elseif msg == "RC8" then | |
82 | turtle.select(8) | |
83 | elseif msg == "RCRF" then | |
84 | - | print("Attacking Up") |
84 | + | if turtle.getItemCount(16) == 0 then |
85 | sleep(0) | |
86 | --(Add): Send message to computer: No fuel available! | |
87 | - | print("Attempting to Move Down") |
87 | + | |
88 | - | if turtle.detectDown() == true then |
88 | + | |
89 | - | print("Move Down Failed! Block Detected") |
89 | + | sleep(0) |
90 | - | else |
90 | + | --(ADD): Send to computer: No need to refuel! |
91 | - | print("Success! Moving Down") |
91 | + | |
92 | if turtle.refuel(0) == false then | |
93 | sleep(0) | |
94 | --(ADD): Send to computer: Item in slot 16 is not a valid fuel! | |
95 | - | print("Moving and Mining Down") |
95 | + | |
96 | - | if turtle.detectDown() == true then |
96 | + | turtle.refuel(16) |
97 | - | print("Block detected, Mining and Moving Down") |
97 | + | --(ADD): Send to computer: Refuel successful! |
98 | end | |
99 | - | else |
99 | + | |
100 | - | print("No block detected, Moving Down normally") |
100 | + | |
101 | end | |
102 | end | |
103 | - | elseif msg == "RCBD" then |
103 | + | |
104 | - | print("Attempting to Mine Block Below") |
104 | + | |
105 | - | if turtle.detectDown() == true then |
105 | + | |
106 | - | print("Mining Block Below") |
106 | + | |
107 | term.setCursorPos(1,1) | |
108 | - | else |
108 | + | print[[Remote Controlled Turtle Initiated! |
109 | - | print("Mine Down Failed! No Block to Mine") |
109 | + | - This turtle is being controlled from a remote location |
110 | Program by 44shades44]] | |
111 | ||
112 | - | print("Attempting to Place Block Down") |
112 | + |