View difference between Paste ID: q1CdH3bN and VnRd9e6C
SHOW: | | - or go back to the newest paste.
1
--[[
2
	2013 (c) psychedelixx
3-
	Minecraft Turtle: Hallway
3+
	Minecraft Turtle: Redwood Chopper
4-
	2013-05-21
4+
	2013-05-22
5
6-
	Digs a simple hallway and places missing ground blocks and torches (every 11th horizontal block).
6+
	Chops a whole redwood tree and returns to the ground. It should work on every other 2x2 tree as well.
7
8
	Usage: 
9-
	- use turtle and type "label set <name>" 
9+
	- Place the turtle [T] on the ground in front of the redwood [R] tree on the left side:
10-
	  (to give your turtle an unique name so it remembers its programs)
10+
11-
	- type "pastebin get VnRd9e6C hallway"
11+
		[R][R]
12-
	- place solid blocks in slot 16 (lower right corner)
12+
		[R][R]
13-
	- place torches in slot 15 (left of slot 16)
13+
		[T]
14-
	- type "hallway <length>"
14+
15-
		• where <length> represents the maximum length of the hallway
15+
		(top view)
16
17
        - use turtle and type "label set <name>"
18-
local args = { ... }
18+
          (to give your turtle an unique name so it remembers its programs)
19-
if #args < 1 then
19+
        - type "pastebin get q1CdH3bN redwood"
20-
  print( "Usage: hallway <length>" )
20+
	- type "redwood"
21-
  error()
21+
22
23-
limit = tonumber(args[1])
23+
24
	turtle.refuel()
25
end
26
27
if turtle.getFuelLevel() == 0 then
28
	print("I need fuel!")
29
else
30
	print("======== 2013 (c) psychedelixx ========")
31
	print("Let's go!")
32
	h=0
33
	turtle.dig()
34
	turtle.forward()
35-
	torchCount = 0
35+
	repeat
36-
	
36+
37-
	while turtle.getFuelLevel() > 0 and limit > 0 do
37+
38-
		print("")
38+
39-
		print("Remaining: " .. limit) 
39+
		turtle.up()
40
		h = h+1
41-
		print("Next torch in: " .. 11-torchCount%11 .. "m")
41+
		
42
		if turtle.getFuelLevel() < 2 then 
43
			turtle.refuel() 
44-
		turtle.forward()
44+
45
	until not turtle.detectUp()
46
	turtle.turnRight()
47-
		if not turtle.detectDown() then	
47+
	turtle.dig()
48-
			turtle.select(16)
48+
	turtle.forward()
49-
			turtle.placeDown()
49+
	turtle.turnLeft()
50
	while h>0 do
51-
	
51+
52-
		if torchCount%11 == 0 then
52+
53-
			turtle.turnRight()
53+
		turtle.digDown()
54-
			turtle.dig()
54+
		turtle.down()
55-
			turtle.select(15)
55+
		h = h-1
56-
			turtle.place()
56+
		
57-
			turtle.turnLeft()
57+
		if turtle.getFuelLevel() < 2 then 
58
			turtle.refuel() 
59-
		limit = limit-1
59+
60-
		torchCount = torchCount + 1
60+
61-
		if limit > 0 and turtle.getFuelLevel() < 2 then 
61+
	turtle.dig()
62
end