Advertisement
Ni_Jay_Ni

bread.lua

Jun 10th, 2021
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. function GetFlour()
  2.     turtle.suck() -- Get Mortar & Pestle
  3.     turtle.up()
  4.     turtle.suck() -- Get Wheat
  5.     turtle.down()
  6.     turtle.craft() -- Make Flour
  7.     turtle.drop()
  8. end
  9.  
  10. function GetSalt()
  11.     turtle.suck() -- Get Pot
  12.     turtle.up()
  13.     turtle.suck() -- Get Water
  14.     turtle.down()
  15.     turtle.craft()
  16.     turtle.select(1)
  17.     turtle.drop()
  18.     turtle.select(2)
  19.     turtle.transferTo(5)
  20. end
  21.  
  22. function GetDough()
  23.     turtle.suck() -- Get Mixing Bowl
  24.     turtle.up()
  25.     turtle.suck() -- Get Water
  26.     turtle.turnLeft()
  27.     turtle.suck() -- Get Salt
  28.     turtle.down()
  29.     turtle.turnRight()
  30.     turtle.select(3)
  31.     turtle.transferTo(5)
  32.     turtle.select(4)
  33.     turtle.transferTo(6)
  34.     turtle.craft() -- Make Dough
  35.     turtle.select(1)
  36.     turtle.drop()
  37.     turtle.select(4)
  38.     turtle.transferTo(2)
  39.     turtle.select(1)
  40.  
  41.     -- FIXME: drop any excess salt and water
  42.     -- RemoveExcess(5)
  43.     -- RemoveExcess(6)
  44. end
  45.  
  46. function RemoveExcess(slotNum)
  47.     local details = turtle.getItemDetails(slotNum)    
  48.     if details ~= nil and details.count ~= nil and details.count > 0 then
  49.         turtle.dropDown()
  50.     end
  51. end
  52.  
  53. function GetBread()
  54.     turtle.suck() -- Get Bakeware
  55.     turtle.up()
  56.     turtle.craft() -- Make Bread
  57.     turtle.select(2)
  58.     turtle.drop() -- Store Bread
  59.     turtle.down()
  60.     turtle.select(1)
  61.     turtle.drop()
  62. end
  63.  
  64. function Bake()
  65.     turtle.select(1)
  66.  
  67.     GetFlour()
  68.  
  69.     turtle.turnLeft()
  70.     turtle.forward()
  71.     turtle.turnRight()
  72.  
  73.     GetDough()
  74.  
  75.     turtle.back()
  76.     turtle.turnLeft()
  77.  
  78.     GetBread()
  79.  
  80.     turtle.back()
  81.     turtle.turnRight()
  82.     turtle.forward()
  83. end
  84.  
  85. Bake()
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement