Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Requieres GeoScanner
- local scanner = peripheral.wrap("left")
- local Location, Oriented, Heading = {x=0,y=0,z=0}, "FORWARD", {x=0,y=0,z=0}
- local loop = true
- local Ore = "minecraft:ancient_debris"
- function Forward()
- if (turtle.forward()) then
- if (Oriented == "FORWARD") then
- Location.z=Location.z+1
- elseif (Oriented == "RIGHT") then
- Location.x=Location.x+1
- elseif (Oriented == "BACK") then
- Location.z=Location.z-1
- elseif (Oriented == "LEFT") then
- Location.x=Location.x-1
- end
- end
- end
- function TurnRight()
- if (turtle.turnRight()) then
- if (Oriented == "FORWARD") then
- Oriented == "RIGHT"
- elseif (Oriented == "RIGHT") then
- Oriented == "BACK"
- elseif (Oriented == "BACK") then
- Oriented == "LEFT"
- elseif (Oriented == "LEFT") then
- Oriented == "FORWARD"
- end
- end
- end
- function TurnLeft()
- if (turtle.TurnLeft()) then
- if (Oriented == "FORWARD") then
- Oriented == "LEFT"
- elseif (Oriented == "RIGHT") then
- Oriented == "FORWARD"
- elseif (Oriented == "BACK") then
- Oriented == "RIGHT"
- elseif (Oriented == "LEFT") then
- Oriented == "BACK"
- end
- end
- end
- function Search()
- local scan = scanner.scan(16)
- local i, data = ipairs()[1]
- Heading = {x=data.x,y=data.y,z=data.z}
- end
- function Movement()
- if (Heading == {x=0,y=0,z=0}) then
- else
- -- X
- local x = Location.x
- for i=x,Heading.x,1 do
- end
- -- Y
- local y = Location.y
- for i=y,Heading.y,1 do
- end
- -- Z
- local z = Location.z
- for i=z,Heading.z,1 do
- end
- end
- end
- -- Main --
- while(loop) do
- Search()
- Movement()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement