Advertisement
DragonFromSpace

Untitled

Dec 28th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.17 KB | None | 0 0
  1. --function declarations
  2. function Deposit()
  3.     turtle.turnLeft()
  4.     turtle.turnLeft()
  5.  
  6.     turtle.drop()
  7.     os.reboot()
  8. end
  9.  
  10. function Craft63()
  11.     print("crafting with 63")
  12.  
  13.     turtle.transferTo(1, 7)
  14.     turtle.transferTo(2, 7)
  15.     turtle.transferTo(3, 7)
  16.     turtle.transferTo(5, 7)
  17.     turtle.transferTo(6, 7)
  18.     turtle.transferTo(7, 7)
  19.     turtle.transferTo(9, 7)
  20.     turtle.transferTo(10, 7)
  21.     turtle.transferTo(11, 7)
  22.  
  23.     if turtle.getItemCount(16) >= 1 then
  24.         turtle.drop()
  25.     end
  26.  
  27.     turtle.select(4)
  28.  
  29.     turtle.craft(7)
  30.     Deposit()
  31. end
  32.  
  33. function Craft45()
  34.     print("crafting with 45")
  35.  
  36.     turtle.transferTo(1, 5)
  37.     turtle.transferTo(2, 5)
  38.     turtle.transferTo(3, 5)
  39.     turtle.transferTo(5, 5)
  40.     turtle.transferTo(6, 5)
  41.     turtle.transferTo(7, 5)
  42.     turtle.transferTo(9, 5)
  43.     turtle.transferTo(10, 5)
  44.     turtle.transferTo(11, 5)
  45.  
  46.     if turtle.getItemCount(16) >= 1 then
  47.         turtle.drop()
  48.     end
  49.  
  50.     turtle.select(4)
  51.    
  52.     turtle.craft(5)
  53.     Deposit()
  54. end
  55.  
  56. function Craft18()
  57.     print("crafting with 18")
  58.  
  59.     turtle.transferTo(1, 2)
  60.     turtle.transferTo(2, 2)
  61.     turtle.transferTo(3, 2)
  62.     turtle.transferTo(5, 2)
  63.     turtle.transferTo(6, 2)
  64.     turtle.transferTo(7, 2)
  65.     turtle.transferTo(9, 2)
  66.     turtle.transferTo(10, 2)
  67.     turtle.transferTo(11, 2)
  68.  
  69.     if turtle.getItemCount(16) >= 1 then
  70.         turtle.drop()
  71.     end
  72.  
  73.     turtle.select(4)
  74.    
  75.     turtle.craft(2)
  76.     Deposit()
  77. end
  78.  
  79. function Craft9()
  80.     print("crafting with 9")
  81.  
  82.     turtle.transferTo(1, 1)
  83.     turtle.transferTo(2, 1)
  84.     turtle.transferTo(3, 1)
  85.     turtle.transferTo(5, 1)
  86.     turtle.transferTo(6, 1)
  87.     turtle.transferTo(7, 1)
  88.     turtle.transferTo(9, 1)
  89.     turtle.transferTo(10, 1)
  90.     turtle.transferTo(11, 1)
  91.  
  92.     if turtle.getItemCount(16) >= 1 then
  93.         turtle.drop()
  94.     end
  95.  
  96.     turtle.select(4)
  97.    
  98.     turtle.craft(1)
  99.     Deposit()
  100. end
  101.  
  102. function FailEverything()
  103.     turtle.drop()
  104.     turtle.turnLeft()
  105.     turtle.turnLeft()
  106.     os.reboot()
  107. end
  108. --end functions declarations
  109.  
  110. --run code
  111. turtle.turnLeft()
  112. turtle.turnLeft()
  113.  
  114. turtle.select(16)
  115.  
  116. turtle.suck(63)
  117.  
  118. if turtle.getItemCount() == 63 then
  119.     Craft63()
  120. elseif turtle.getItemCount() >= 45 then
  121.     Craft45()
  122. elseif turtle.getItemCount() >= 18 then
  123.     Craft18()
  124. elseif turtle.getItemCount() >= 9 then
  125.     Craft9()
  126. else
  127.     FailEverything()  
  128. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement