Advertisement
Guest User

smelt

a guest
Oct 5th, 2012
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1.  
  2. while true do
  3.  
  4. -- collect items
  5. for n=8,16 do
  6. turtle.select(n)
  7. turtle.suck()
  8. end
  9.  
  10. -- put items in furnace
  11. for n=8,16 do
  12.   turtle.select(n)
  13.   if turtle.compareTo(1) then
  14.    -- coal
  15.    turtle.turnRight()
  16.    turtle.turnRight()
  17.    turtle.down()
  18.    turtle.forward()
  19.    turtle.dropUp()
  20.    turtle.turnRight()
  21.    turtle.turnRight()
  22.    turtle.forward()
  23.    turtle.up()
  24.  elseif turtle.compareTo(2) or
  25.    turtle.compareTo(3) or
  26.    turtle.compareTo(4) or
  27.    turtle.compareTo(6) or
  28.    turtle.compareTo(7) then
  29.    -- ore
  30.    turtle.turnRight()
  31.    turtle.turnRight()
  32.    turtle.up()
  33.    turtle.forward()
  34.    turtle.dropDown()
  35.    turtle.turnRight()
  36.    turtle.turnRight()
  37.    turtle.forward()
  38.    turtle.down()
  39.    turtle.drop()
  40.    
  41.  elseif turtle.compareTo(5) then
  42.    -- gravel
  43.    turtle.turnRight()
  44.    turtle.drop()
  45.    turtle.turnLeft()
  46.  elseif turtle.getItemCount(n) > 0 then
  47.  
  48.    -- junk
  49.    turtle.turnLeft()
  50.    turtle.drop()
  51.    turtle.turnRight()
  52.  end
  53. end
  54.  
  55. -- wait a bit
  56. sleep(10)
  57.  
  58. -- extract ores
  59. while true do
  60.  turtle.turnRight()
  61.  turtle.turnRight()
  62.  if turtle.suck() then
  63.   turtle.turnRight()
  64.   turtle.drop()
  65.   turtle.turnRight()
  66.   sleep(5)
  67.  else
  68.   turtle.turnRight()
  69.   turtle.turnRight()
  70.   break
  71.  end
  72. end
  73.  
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement