Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Copyright PrinceTommen - Script developed for CyanideEpic (twitch.tv/cyanideepic)]]--
- --[[You are all allowed to use it as long as you don't pretend it's yours]]--
- --[[Have fun !]]--
- --[[ FTB Players: I recommand you to use a "chunk loader mining turtle"]]--
- version = 3.4
- --[[
- Release Note:
- 3.4: Added: Favorite configuration system
- Ability to choose the direction of the series of parallel tunnels (right or left)
- Support of execution without torches or chests (will not try to place them)
- Security that stops the turtle when it runs out of chests or torches (suggested by CyanideEpic)
- Chests and torches status updated automatically
- Security that requires the user to press enter before the turtle starts (suggested by CyanideEpic)
- The turtle now returns to its starting position after it finishes
- New rotation function as well a a specific torch placing function
- Fixed: The turtle will now properly finish the hub after mining an odd number of tunnels
- The torch placement has been modified to avoid conflicts with chests
- 3.3: Added: Enderchest Support (suggested by Niseg and Daniteh)
- Release note
- 3.2: Fixed: Very important chest placing issue (only appeared in 3.1)
- 3.1: Added: New mining pattern for more efficiency (suggested by Niseg)
- Smarter fuel management: Will now consume the "stored" fuel before refueling
- Can now consume any type of fuel supported by turtles (check the wiki)
- Fuel type can be changed while the turtle is mining
- Optimized the mining of 3 blocks high tunnels
- Better interface, instructions remain visible and a line is dedicated to the fuel status (updated automatically)
- Option to throw cobblestone automatically (suggested by Niseg)
- Fixed: Refueling issue in certain circumstances (reported by CyanideEpic)
- ]]--
- local function turn(FacingAngle, Bool_rotation, Rotation_integer)
- if Bool_rotation then
- for u=1, Rotation_integer do
- turtle.turnRight()
- end
- FacingAngle = FacingAngle + Rotation_integer
- else
- for u=1, Rotation_integer do
- turtle.turnLeft()
- end
- FacingAngle = FacingAngle - Rotation_integer
- end
- FacingAngle = math.abs((FacingAngle - 1)%4+1)
- return FacingAngle
- end
- local function refuel()
- turtle.select(2)
- boolRefuel = turtle.refuel(1)
- if not(boolRefuel) then
- term.setCursorPos(1,11)
- write("No fuel -")
- while not(turtle.refuel(1)) do
- FacingAngle = turn(FacingAngle, true, 4)
- end
- end
- refuel_count = 80 - turtle.getFuelLevel()
- term.setCursorPos(1,11)
- write("Fuel OK -")
- return refuel_count
- end
- local function moveForward(FacingAngle, Boolfb, moving_integer, digUpBool, digDownBool, refuel_count)
- local moving_count = 1
- for moving_count=1,moving_integer do
- if (refuel_count == 80) then
- refuel_count = refuel()
- end
- Bool1 = false
- while not(Bool1) do
- if (Boolfb) then
- turtle.dig()
- Bool1 = turtle.forward()
- if (digUpBool) then
- turtle.digUp()
- end
- if (digDownBool) then
- turtle.digDown()
- end
- else
- Bool1 = turtle.back()
- if not(Bool1) then
- turn(FacingAngle, true, 2)
- turtle.dig()
- turn(FacingAngle, false, 2)
- end
- end
- end
- moving_count = moving_count + 1
- refuel_count = refuel_count + 1
- end
- return refuel_count
- end
- local function moveUp(Boolud, moving_integer, refuel_count, Bool_DigFront)
- local moving_count = 1
- for moving_count=1, moving_integer do
- if (refuel_count == 80) then
- refuel_count = refuel()
- end
- Bool2 = false
- if Bool_DigFront then
- turtle.dig()
- end
- while not(Bool2) do
- if (Boolud) then
- turtle.digUp()
- Bool2 = turtle.up()
- else
- turtle.digDown()
- Bool2 = turtle.down()
- end
- end
- moving_count = moving_count + 1
- refuel_count = refuel_count + 1
- end
- return refuel_count
- end
- local function inventoryManagement(saved_slots,refuel_count,Right_or_Left,throw_cobble)
- if Chest_approval then
- m = saved_slots + 1
- thrown_slots = 0
- if (throw_cobble) then
- m = m+1
- end
- n = m
- if (turtle.getItemCount(16) ~= 0) then
- repeat
- item_count = turtle.getItemCount(n)
- if (item_count ~= 0) then
- boolSlotOccupied = true
- n = n + 1
- else
- boolSlotOccupied = false
- end
- until (boolSlotOccupied == false) or (n == 17)
- if n==17 then
- if (throw_cobble) then
- for j=1, 12 do
- turtle.select(4)
- Bool_match_cobble = turtle.compareTo(j+4)
- if Bool_match_cobble then
- thrown_slots = thrown_slots + 1
- turtle.select(j+4)
- turtle.drop()
- end
- end
- turtle.select(4)
- turtle.drop(turtle.getItemCount(4)-1)
- end
- if (thrown_slots <= 2) then
- if Chest_shortage then
- turtle.select(3)
- turtle.drop()
- term.setCursorPos(24,11)
- write("No chests")
- repeat
- turn(FacingAngle, true, 4)
- until (turtle.getItemCount(3) ~= 0)
- term.setCursorPos(24,11)
- write("Chests OK")
- Chest_shortage = false
- end
- if (Right_or_Left == "left") then
- FacingAngle = turn(FacingAngle, true, 1)
- else
- FacingAngle = turn(FacingAngle, false, 1)
- end
- refuel_count = moveForward(FacingAngle, true, 1, false, true, refuel_count)
- turtle.select(3)
- turtle.digDown()
- turtle.placeDown()
- for u=m,16 do
- turtle.select(u)
- turtle.dropDown()
- end
- if enderchest then
- turtle.select(3)
- turtle.drop()
- turtle.digDown()
- end
- if (turtle.getItemCount(3) == 0) then
- Chest_shortage = true
- end
- refuel_count = moveForward(FacingAngle, false, 1, false, false, refuel_count)
- if (Right_or_Left == "left") then
- FacingAngle = turn(FacingAngle, false, 1)
- else
- FacingAngle = turn(FacingAngle, true, 1)
- end
- end
- end
- end
- end
- return refuel_count
- end
- local function placeTorch(Position)
- if Torch_approval then
- if Torch_shortage then
- turtle.select(1)
- turtle.drop()
- term.setCursorPos(11,11)
- write("No Torches -")
- repeat
- turn(FacingAngle, true, 4)
- until (turtle.getItemCount(1) ~= 0)
- term.setCursorPos(11,11)
- write("Torches OK -")
- Torch_shortage = false
- end
- turtle.select(1)
- if Position == "front" then
- turtle.dig()
- turtle.place()
- elseif Position == "below" then
- turtle.digDown()
- turtle.placeDown()
- elseif Position == "up" then
- turtle.digUp()
- turtle.placeUp()
- end
- if (turtle.getItemCount(1) == 0) then
- Torch_shortage = true
- end
- end
- end
- local function digVerticalLayer(refuel_count, FacingAngle, Width, Height, Height_Position, Bool_Torches, Right_or_Left)
- if Right_or_Left then
- Right_or_Left = "left"
- else
- Right_or_Left = "right"
- end
- done_columns = 0
- if (Height_Position == "up") then
- for columns=1, math.floor(Width/4) do
- turtle.digUp()
- if (Height > 3) then
- refuel_count = moveUp(true, 1, refuel_count, false)
- turtle.dig()
- refuel_count = moveUp(false, (Height-2), refuel_count, true)
- turtle.digDown()
- end
- refuel_count = moveForward(FacingAngle, true, 2, true, true, refuel_count)
- refuel_count = inventoryManagement(3, refuel_count, Right_or_Left, throw_cobble)
- if (Height > 3) then
- refuel_count = moveUp(false, 1, refuel_count, false)
- turtle.dig()
- refuel_count = moveUp(true, (Height-2), refuel_count, true)
- turtle.digUp()
- end
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- done_columns = done_columns + 1
- if (Width - 4*done_columns ~= 0) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- end
- end
- if ((Width - 4*math.floor(Width/4)) == 0) then
- Height_Position = "up"
- elseif ((Width - 4*math.floor(Width/4)) == 1) then
- turtle.digUp()
- refuel_count = moveUp(false, (Height-3), refuel_count, false)
- turtle.digDown()
- refuel_count = inventoryManagement(3, refuel_count, Right_or_Left, throw_cobble)
- Height_Position = "down"
- elseif ((Width - 4*math.floor(Width/4)) >= 2) then
- if (Height > 3) then
- refuel_count = moveUp(true, 1, refuel_count, false)
- turtle.dig()
- refuel_count = moveUp(false, (Height-2), refuel_count, true)
- turtle.digDown()
- end
- turtle.digUp()
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- refuel_count = inventoryManagement(3, refuel_count, Right_or_Left, throw_cobble)
- Height_Position = "down"
- if ((Width - 4*math.floor(Width/4)) == 3) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- refuel_count = moveUp(true, (Height - 3), refuel_count, false)
- turtle.digUp()
- Height_Position = "up"
- end
- end
- elseif (Height_Position == "down") then
- for columns=1, math.floor(Width/4) do
- turtle.digDown()
- if (Height > 3) then
- refuel_count = moveUp(false, 1, refuel_count, false)
- turtle.dig()
- refuel_count = moveUp(true, (Height - 2), refuel_count, true)
- turtle.digUp()
- end
- refuel_count = moveForward(FacingAngle, true, 2, true, true, refuel_count)
- if (Height > 3) then
- refuel_count = moveUp(true, 1, refuel_count, false)
- turtle.dig()
- refuel_count = moveUp(false, (Height - 2), refuel_count, true)
- turtle.digDown()
- end
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- done_columns = done_columns + 1
- if (Width - 4*done_columns ~= 0) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- end
- refuel_count = inventoryManagement(3, refuel_count, Right_or_Left, throw_cobble)
- if (done_columns%2 == 0) and Bool_Torches then
- FacingAngle = turn(FacingAngle,true , 1)
- placeTorch("front")
- FacingAngle = turn(FacingAngle, false, 1)
- end
- end
- if ((Width - 4*math.floor(Width/4)) == 0) then
- Height_Position = "down"
- elseif ((Width - 4*math.floor(Width/4)) == 1) then
- turtle.digDown()
- refuel_count = moveUp(true, (Height - 3), refuel_count, false)
- turtle.digUp()
- Height_Position = "up"
- elseif ((Width - 4*math.floor(Width/4)) >= 2) then
- if (Height > 3) then
- refuel_count = moveUp(false, 1, refuel_count, false)
- turtle.dig()
- refuel_count = moveUp(true, (Height - 2), refuel_count, true)
- turtle.digUp()
- end
- turtle.digDown()
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- Height_Position = "up"
- if ((Width - 4*math.floor(Width/4)) == 3) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- refuel_count = moveUp(false, (Height - 3), refuel_count, false)
- turtle.digDown()
- refuel_count = inventoryManagement(3, refuel_count, Right_or_Left, throw_cobble)
- Height_Position = "down"
- end
- end
- end
- return refuel_count, Height_Position
- end
- local function resetScreen()
- term.clear()
- term.setCursorPos(14,1)
- write("Mining Turtle")
- term.setCursorPos(5,2)
- write("For CyanideEpic and his friends")
- term.setCursorPos(1,13)
- write("By PrinceTommen, version "..version)
- end
- resetScreen()
- if (io.open("favorite", "r") ~= nil) then
- term.setCursorPos(1,4)
- repeat
- write("Do you wish to use your favorite configuration ? (Yes/No)")
- term.setCursorPos(1,6)
- Favorite_approval = read()
- until (Favorite_approval == "Yes") or (Favorite_approval == "No")
- if (Favorite_approval == "Yes") then
- handle = fs.open("favorite", "r")
- input = handle.readAll()
- handle.close()
- favorite = textutils.unserialize(input)
- tunnels_integer = favorite.tunnels_integer
- Width = favorite.Width
- Height = favorite.Height
- Length = favorite.Length
- tunnels_separation = favorite.tunnels_separation
- if favorite.throw_cobble == 1 then
- throw_cobble = true
- else
- throw_cobble = false
- end
- if favorite.enderchest == 1 then
- enderchest = true
- else
- enderchest = false
- end
- end
- end
- if (io.open("favorite", "r") == nil) or ((io.open("favorite", "r") ~= nil) and (Favorite_approval == "No")) then
- resetScreen()
- term.setCursorPos(1,4)
- print("Number of parallel tunnels ? ")
- term.setCursorPos(37,4)
- tunnels_integer = tonumber(read())
- term.setCursorPos(1,5)
- print("Width of the tunnels ? ")
- term.setCursorPos(37,5)
- Width = tonumber(read())
- term.setCursorPos(1,6)
- print("Height of the tunnels ? ")
- term.setCursorPos(37,6)
- Height = tonumber(read())
- if (Height < 3) then
- Height = 3
- end
- term.setCursorPos(1,7)
- print("Length of the tunnels ? ")
- term.setCursorPos(37,7)
- Length = tonumber(read())
- if (tunnels_integer > 1) then
- term.setCursorPos(1,8)
- print("Separating blocks between tunnels ? ")
- term.setCursorPos(37,8)
- tunnels_separation = tonumber(read())
- end
- repeat
- resetScreen()
- term.setCursorPos(1,4)
- print("Are you willing to throw cobblestone away ? (Yes/No)")
- term.setCursorPos(1,6)
- throw_cobble = read()
- until (throw_cobble == "Yes") or (throw_cobble == "No")
- repeat
- resetScreen()
- term.setCursorPos(1,4)
- print("Are you willing to use an enderchest ? (Yes/No)")
- term.setCursorPos(1,6)
- enderchest = read()
- until (enderchest == "Yes") or (enderchest == "No")
- resetScreen()
- term.setCursorPos(1,4)
- write("Do you want to save this configuration as your favorite ? (Yes/No)")
- repeat
- term.setCursorPos(1,6)
- New_favorite = read()
- until (New_favorite == "Yes") or (New_favorite == "No")
- if (New_favorite == "Yes") then
- favorite = {}
- favorite.tunnels_integer = tunnels_integer
- favorite.Width = Width
- favorite.Height = Height
- favorite.Length = Length
- favorite.tunnels_separation = tunnels_separation
- output = textutils.serialize(favorite)
- handle = fs.open("favorite", "w")
- handle.write(output)
- handle.close()
- end
- end
- if (tunnels_integer > 1) then
- repeat
- resetScreen()
- term.setCursorPos(1,4)
- print("The first tunnel will be in front of the turtle. Do you want the tunnels to be dug on the right or on the left of the first tunnel (They will be parallel to the first one) ? (Right/Left)")
- term.setCursorPos(1,9)
- Bool_direction = read()
- until (Bool_direction == "Right") or (Bool_direction == "Left")
- end
- if (tunnels_integer == 1) and (Width > 1) then
- repeat
- resetScreen()
- term.setCursorPos(1,4)
- print("Do you want the current position of the turtle to be the right or the left of the tunnel ? (Right/Left)")
- term.setCursorPos(1,9)
- Bool_direction = read()
- until (Bool_direction == "Right") or (Bool_direction == "Left")
- end
- resetScreen()
- term.setCursorPos(1,4)
- if (enderchest == "Yes") then
- enderchest = true
- write("Torches in the first (upper-left) slot. Coal (or anything that can power a turtle) in the second one, one enderchest (only one) in the third one.")
- else
- enderchest = false
- write("Torches in the first (upper-left) slot. Coal (or anything that that can power a turtle) in the second one, chests in the third one.")
- end
- if (throw_cobble == "Yes") then
- throw_cobble = true
- term.setCursorPos(1,8)
- write("Please make sure there is cobble in the fourth slot.")
- else
- throw_cobble = false
- end
- if (Bool_direction == "Right") then
- Bool_direction = true
- else
- Bool_direction = false
- end
- term.setCursorPos(1,11)
- write("Pres enter to start")
- while true do
- press, key = os.pullEvent()
- if press == "key" and key == 28 then
- break
- end
- end
- term.setCursorPos(1,11)
- write(" ")
- if (turtle.getItemCount(1) == 0) then
- repeat
- resetScreen()
- term.setCursorPos(1,4)
- print("The torches slot is empty. Are you sure you do not want to use torches ? (Yes/No)")
- term.setCursorPos(1,7)
- Torch_approval = read()
- until (Torch_approval == "Yes") or (Torch_approval == "No")
- else
- Torch_approval = "No"
- end
- if (Torch_approval == "Yes") then
- Torch_approval = false
- elseif (Torch_approval == "No") then
- Torch_approval = true
- end
- if (turtle.getItemCount(3) == 0) then
- repeat
- resetScreen()
- term.setCursorPos(1,4)
- print("The chests slot is empty. Are you sure you do not want to use chests ? (Yes/No)")
- term.setCursorPos(1,7)
- Chest_approval = read()
- until (Chest_approval == "Yes") or (Chest_approval == "No")
- else
- Chest_approval = "No"
- end
- if (Chest_approval == "Yes") then
- Chest_approval = false
- elseif (Chest_approval == "No") then
- Chest_approval = true
- end
- if Torch_approval and (turtle.getItemCount(1) == 0) then
- Torch_shortage = true
- term.setCursorPos(11,11)
- write("No Torches -")
- elseif Torch_approval and (turtle.getItemCount(1) ~= 0) then
- Torch_shortage = false
- term.setCursorPos(11,11)
- write("Torches OK -")
- end
- if Chest_approval and (turtle.getItemCount(3) == 0) then
- Chest_shortage = true
- term.setCursorPos(24,11)
- write("No Chests")
- elseif Chest_approval and (turtle.getItemCount(3) ~= 0) then
- Chest_shotage = false
- term.setCursorPos(24,11)
- write("Chests OK")
- end
- term.setCursorPos(1,11)
- write("Fuel OK -")
- refuel_count = 80 - turtle.getFuelLevel()
- FacingAngle = 0
- tunnel_forth = true
- refuel_count = moveUp(true, 1, refuel_count, false)
- if (Width == 1) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- end
- for done_tunnels=1, tunnels_integer do
- if (Width >= 2) then
- for done_layers=1, math.ceil(Length/2) do
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, Width, Height, "down", false, Bool_direction)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, Width, Height, Height_Position, false, not(Bool_direction))
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- if (done_layers%4 == 0) then
- refuel_count = moveUp(false, 1, refuel_count, false)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- placeTorch("front")
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- refuel_count = moveUp(true, 1, refuel_count, false)
- end
- end
- elseif (Width == 1) then
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, 2*math.ceil(Length/2), Height, "down", true, Bool_direction)
- end
- if (Height_Position == "up") then
- refuel_count = moveUp(false, (Height - 3), refuel_count, false)
- Height_Position = "down"
- end
- if tunnel_forth and (tunnels_integer - done_tunnels >= 1) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, ((2*Width)+tunnels_separation), Height, "down", false, not(Bool_direction))
- if (Height_Position == "up") then
- refuel_count = moveUp(false, (Height - 3), refuel_count, false)
- Height_Position = "down"
- end
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- placeTorch("below")
- elseif not(tunnel_forth) then
- refuel_count = moveForward(FacingAngle, true, 1, true, false, refuel_count)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, ((2*Width)-1+tunnels_separation), Height, "down", false, Bool_direction)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, ((2*Width)-1+tunnels_separation), Height, Height_Position, false, not(Bool_direction))
- if (Height_Position == "up") then
- refuel_count = moveUp(false, (Height - 3), refuel_count, false)
- Height_Position = "down"
- end
- FacingAngle = turn(FacingAngle, Bool_direction, 2)
- refuel_count = moveForward(FacingAngle, true, (Width-2), true, true, refuel_count)
- placeTorch("front")
- FacingAngle = turn(FacingAngle, not(Bool_direction), 2)
- refuel_count = moveForward(FacingAngle, true, (Width-2), true, true, refuel_count)
- if (tunnels_integer - done_tunnels ~= 0) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, (tunnels_separation+1), Height, Height_Position, false, Bool_direction)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, (tunnels_separation+1), Height, Height_Position, false, not(Bool_direction))
- refuel_count = moveForward(FacingAngle, false, tunnels_separation, true, true, refuel_count)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
- placeTorch("front")
- FacingAngle = turn(FacingAngle, not(Bool_direction), 2)
- end
- end
- if tunnel_forth and (tunnels_integer - done_tunnels == 0) and (Width > 1) then
- refuel_count = moveForward(FacingAngle, false, 2*math.ceil(Length/2), false, false, refuel_count)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- refuel_count = moveForward(FacingAngle, true, 1, false, false, refuel_count)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, (Width - 1), Height, Height_Position, false, Bool_direction)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- refuel_count = moveForward(FacingAngle, true, 1, false, false, refuel_count)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- refuel_count, Height_Position = digVerticalLayer(refuel_count, FacingAngle, (Width - 1), Height, Height_Position, false, not(Bool_direction))
- if (Height_Position == "up") then
- refuel_count = moveUp(false, (Height - 3), refuel_count, false)
- Height_Position = "down"
- end
- refuel_count = moveForward(FacingAngle, false, (Width - 2), false, false, refuel_count)
- FacingAngle = turn(FacingAngle, Bool_direction, 2)
- end
- tunnel_forth = not(tunnel_forth)
- if (Width == 1) and (tunnels_integer - done_tunnels ~= 0) then
- refuel_count = moveForward(FacingAngle, true, 1, true, true, refuel_count)
- elseif (Width == 1) and (tunnels_integer - done_tunnels == 0) then
- refuel_count = moveForward(FacingAngle, false, (2*math.ceil(Length/2)), false, false, refuel_count)
- end
- end
- refuel_count = moveUp(false, 1, refuel_count, false)
- if (Width == 1) then
- refuel_count = moveForward(FacingAngle, false, 1, false, false, refuel_count)
- FacingAngle = turn(FacingAngle, Bool_direction, 1)
- end
- refuel_count = moveForward(FacingAngle, false, ((tunnels_integer*Width) - 1 + (tunnels_separation*(tunnels_integer - 1))), false, false, refuel_count)
- FacingAngle = turn(FacingAngle, not(Bool_direction), 1)
Advertisement
Add Comment
Please, Sign In to add comment