View difference between Paste ID: E8Z6vZeR and cDHFTM0K
SHOW: | | - or go back to the newest paste.
1-
local control = 111
1+
local control = 236
2-
local objects = {"Turtle", "Dirt", "Sand", "Stone"}
2+
local objects = {"Obsidian"}
3
4
rednet.open("right")
5
6
while true do
7
	id, msg = rednet.receive()
8
	if id == control then
9
		command = loadstring(msg)
10-
		command()
10+
		toDo = setfenv(command, getfenv(1))
11
		toDo()
12
		front = "Unknown"
13
		if turtle.detect() then
14
			for i = 1, #objects do
15
				turtle.select(i)
16
				if turtle.compare() then
17
					front = objects[i]
18
					break
19
				end
20
			end
21
		else
22
			front = "Air"
23
		end
24-
			turtle.dig()
24+
25
			--turtle.dig()
26
		end
27
		up = "Unknown"
28
		if turtle.detectUp() then
29
			for i = 1, #objects do
30
				turtle.select(i)
31
				if turtle.compareUp() then
32
					up = objects[i]
33
					break
34
				end
35
			end
36-
			up = "Unknown"
36+
37
			up = "Air"
38
		end
39-
			turtle.digUp()
39+
40
			--turtle.digUp()
41
		end
42
		down = "Unknown"
43
		if turtle.detectDown() then
44
			for i = 1, #objects do
45
				turtle.select(i)
46
				if turtle.compareDown() then
47
					down = objects[i]
48
					break
49
				end
50
			end
51
		else
52
			down = "Air"
53
		end
54-
			turtle.digDown()
54+
55
			--turtle.digDown()
56-
		toSend = textutils.serialize({r, front, up, down})
56+
57
		toSend = textutils.serialize({ret, front, up, down})
58
		rednet.send(control, toSend)
59
	end
60
end