Guest User

craft.txt

a guest
Feb 17th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. os.loadAPI("tillapi")
  2.  
  3. local positions = { {-3,1,2} , {-2,1,2} , {-1,1,2} ,
  4.                     {-3,0,2} , {-2,0,2} , {-1,0,2} ,
  5.                     {-3,-1,2} , {-2,-1,2} , {-1,-1,2} }
  6.                    
  7. local slotList = { 1,2,3,5,6,7,9,10,11}
  8.  
  9. function goCrafting(count1)
  10.     tillapi.offsetGoTo(-4,1,2)
  11.     turtle.select(13)
  12.     turtle.place()
  13.     tillapi.offsetGoTo(-4,-1,0)
  14.     turtle.select(slotList[count1])
  15.     while turtle.getItemCount() == 0 do
  16.         redstone.setOutput("bottom",true)
  17.         sleep(1)
  18.         redstone.setOutput("bottom",false)
  19.         sleep(1)
  20.         turtle.suckUp(1)
  21.        
  22.     end
  23.     --tillapi.offsetGoTo(-4,1,2)
  24.     tillapi.forceMoveBack()
  25.     tillapi.forceMoveBack()
  26.     tillapi.forceMoveUp()
  27.     tillapi.forceMoveUp()
  28.     turtle.select(13)
  29.     turtle.attack()
  30.     local pos = positions[count1]
  31.     tillapi.offsetGoTo(pos[1],pos[2],pos[3])
  32.     turtle.place()
  33.    
  34. end
  35.  
  36. local count0 = 0
  37. for key,value in ipairs(positions) do
  38.     count0=count0+1
  39.     tillapi.offsetGoTo(value[1],value[2],value[3])
  40.     turtle.select(13)
  41.     turtle.attack()
  42.     local detail = turtle.getItemDetail(13)
  43.     if detail["name"]=="minecraft:item_frame" then
  44.         turtle.place()
  45.     else
  46.         goCrafting(count0)
  47.     end
  48. end
  49.  
  50. tillapi.offsetGoTo(0,-2,1)
  51. turtle.select(13)
  52. turtle.suck()
  53. turtle.equipRight()
  54. turtle.drop()
  55. turtle.select(14)
  56. turtle.craft()
  57. turtle.select(13)
  58. turtle.suck()
  59. turtle.equipRight()
  60. turtle.drop()
  61. tillapi.offsetGoTo(0,-1,1)
  62. turtle.select(14)
  63. turtle.drop()
  64. tillapi.offsetGoTo(0,0,0)
  65. tillapi.craftRefuel()
Advertisement
Add Comment
Please, Sign In to add comment