Advertisement
paramus

Auto Miner

Feb 20th, 2025
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.85 KB | Gaming | 0 0
  1. -- Requieres GeoScanner
  2. local scanner = peripheral.wrap("left")
  3. local Location, Oriented, Heading = {x=0,y=0,z=0}, "FORWARD", {x=0,y=0,z=0}
  4. local loop = true
  5. local Ore = "minecraft:ancient_debris"
  6.  
  7. function Forward()
  8.     if (turtle.forward()) then
  9.         if (Oriented == "FORWARD") then
  10.             Location.z=Location.z+1
  11.         elseif (Oriented == "RIGHT") then
  12.             Location.x=Location.x+1
  13.         elseif (Oriented == "BACK") then
  14.             Location.z=Location.z-1
  15.         elseif (Oriented == "LEFT") then
  16.             Location.x=Location.x-1
  17.         end
  18.     end
  19. end
  20.  
  21. function TurnRight()
  22.     if (turtle.turnRight()) then
  23.         if (Oriented == "FORWARD") then
  24.             Oriented == "RIGHT"
  25.         elseif (Oriented == "RIGHT") then
  26.             Oriented == "BACK"
  27.         elseif (Oriented == "BACK") then
  28.             Oriented == "LEFT"
  29.         elseif (Oriented == "LEFT") then
  30.             Oriented == "FORWARD"
  31.         end
  32.     end
  33. end
  34.  
  35. function TurnLeft()
  36.     if (turtle.TurnLeft()) then
  37.         if (Oriented == "FORWARD") then
  38.             Oriented == "LEFT"
  39.         elseif (Oriented == "RIGHT") then
  40.             Oriented == "FORWARD"
  41.         elseif (Oriented == "BACK") then
  42.             Oriented == "RIGHT"
  43.         elseif (Oriented == "LEFT") then
  44.             Oriented == "BACK"
  45.         end
  46.     end
  47. end
  48.  
  49. function Search()
  50.     local scan = scanner.scan(16)
  51.     local i, data = ipairs()[1]
  52.     Heading = {x=data.x,y=data.y,z=data.z}
  53. end
  54.  
  55. function Movement()
  56.     if (Heading == {x=0,y=0,z=0}) then
  57.        
  58.     else
  59.         -- X
  60.         local x = Location.x
  61.         for i=x,Heading.x,1 do
  62.            
  63.         end
  64.        
  65.         -- Y
  66.         local y = Location.y
  67.         for i=y,Heading.y,1 do
  68.            
  69.         end
  70.        
  71.         -- Z
  72.         local z = Location.z
  73.         for i=z,Heading.z,1 do
  74.            
  75.         end
  76.     end
  77. end
  78.  
  79. -- Main --
  80. while(loop) do
  81.     Search()
  82.     Movement()
  83. end
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement