Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Vorne(soll)
- x = false
- count = 0
- while count < soll do
- repeat
- turtle.dig()
- x = turtle.forward()
- until x == true
- count = count + 1
- end
- end
- function Oben(soll)
- x = false
- count = 0
- while count < soll do
- repeat
- turtle.digUp()
- x = turtle.up()
- until x == true
- count = count + 1
- end
- end
- function Unten(soll)
- x = false
- count = 0
- while count < soll do
- repeat
- turtle.digDown()
- x = turtle.down()
- until x == true
- count = count + 1
- end
- end
- function check()
- turtle.select(1)
- if true ~= turtle.compareUp() then
- turtle.select(2)
- if true ~= turtle.compareUp() then
- turtle.select(3)
- if true ~= turtle.compareUp() then
- turtle.digUp()
- end
- end
- end
- turtle.select(1)
- if true ~= turtle.compareDown() then
- turtle.select(2)
- if true ~= turtle.compareDown() then
- turtle.select(3)
- if true ~= turtle.compareDown() then
- turtle.digDown()
- end
- end
- end
- turtle.turnLeft()
- turtle.select(1)
- if true ~= turtle.compare() then
- turtle.select(2)
- if true ~= turtle.compare() then
- turtle.select(3)
- if true ~= turtle.compare() then
- turtle.dig()
- end
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(1)
- if true ~= turtle.compare() then
- turtle.select(2)
- if true ~= turtle.compare() then
- turtle.select(3)
- if true ~= turtle.compare() then
- turtle.dig()
- end
- end
- end
- turtle.turnLeft()
- end
- function VorneMine(soll)
- x = false
- count = 0
- while count < soll do
- repeat
- turtle.dig()
- x = turtle.forward()
- until x == true
- check()
- count = count + 1
- end
- end
- function InvLeeren()
- slot = 5
- turtle.dig()
- turtle.select(4)
- turtle.place()
- repeat
- turtle.select(slot)
- turtle.drop()
- slot = slot + 1
- until slot > 16
- turtle.select(1)
- turtle.dig()
- end
- function refuel()
- slot = 1
- if 5000 > turtle.getFuelLevel() then
- repeat
- turtle.select(slot)
- turtle.refuel()
- slot = slot + 1
- until slot > 16
- end
- end
- function getInPos(ziel)
- print("Auf welcher Hoehe ist die Turtle gerade?")
- hoehe = read()
- Unten(hoehe - ziel)
- end
- function Left()
- turtle.turnLeft()
- refuel()
- InvLeeren()
- VorneMine(5)
- turtle.turnLeft()
- end
- function Right()
- turtle.turnRight()
- refuel()
- InvLeeren()
- VorneMine(5)
- turtle.turnRight()
- end
- function one()
- VorneMine(15)
- Right()
- VorneMine(15)
- Left()
- VorneMine(15)
- Right()
- VorneMine(15)
- Oben(1)
- turtle.turnRight()
- VorneMine(3)
- turtle.turnRight()
- end
- function two()
- VorneMine(15)
- Left()
- VorneMine(15)
- Right()
- VorneMine(15)
- Oben(1)
- turtle.turnRight()
- VorneMine(2)
- turtle.turnRight()
- end
- function three()
- VorneMine(15)
- Left()
- VorneMine(15)
- Right()
- VorneMine(15)
- Oben(1)
- turtle.turnRight()
- VorneMine(3)
- turtle.turnRight()
- end
- function four()
- VorneMine(15)
- Left()
- VorneMine(15)
- Right()
- VorneMine(15)
- Oben(1)
- turtle.turnRight()
- VorneMine(2)
- turtle.turnRight()
- end
- function five()
- VorneMine(15)
- Left()
- VorneMine(15)
- Right()
- VorneMine(15)
- Oben(1)
- turtle.turnRight()
- VorneMine(13)
- turtle.turnRight()
- end
- function Mine()
- refuel()
- print("Auf welcher Höhe soll die Turtle anfangen zu minen?")
- startHoehe = read()
- print("Bis zu welcher Hoehe soll die Turtle minen?")
- zielHoehe = read()
- getInPos(startHoehe)
- repeat
- line = 1
- lineC = 1
- repeat
- if line == 6 then line = 1 end
- if line == 1 then
- one()
- elseif line == 2 then
- two()
- elseif line == 3 then
- three()
- elseif line == 4 then
- four()
- elseif line == 5 then
- five()
- end
- line = line + 1
- lineC = lineC + 1
- until lineC > zielHoehe - startHoehe
- line = line - 1
- if line == 1 then
- turtle.turnRight()
- VorneMine(12)
- turtle.turnRight()
- VorneMine(16)
- elseif line == 2 then
- turtle.turnRight()
- VorneMine(4)
- turtle.turnRight()
- VorneMine(1)
- elseif line == 3 then
- turtle.turnLeft()
- VorneMine(11)
- turtle.turnRight()
- VorneMine(16)
- elseif line == 4 then
- turtle.turnRight()
- VorneMine(12)
- turtle.turnRight()
- VorneMine(1)
- end
- Unten(lineC - 1)
- until 1 == 2
- end
- Mine()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement