Jayex_Designs

pipe

Jun 15th, 2021 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. args = {...}
  2. SLOT_COUNT = 16
  3. Directions = {
  4.     ["potatoDirection"] = args[1],
  5.     ["moneyDirection"] = args[2]
  6. }
  7. TurtleDirections = {
  8.     ["f"] = turtle.drop,
  9.     ["u"] = turtle.dropUp,
  10.     ["d"] = turtle.dropDown
  11. }
  12. if not Directions["potatoDirection"] then
  13.     error("Set the direction of the baked potatos (f)ront, (u)p or (d)own")
  14. end
  15.  
  16.  
  17.  
  18. while true do
  19.     sleep(0.1)
  20.     for i = 1, SLOT_COUNT, 1 do
  21.         turtle.select(i)
  22.         local item = turtle.getItemDetail()
  23.         if item ~= nil then
  24.             if item["name"] == "minecraft:baked_potato" then
  25.                 TurtleDirections[Directions["potatoDirection"]]()
  26.             else
  27.                 TurtleDirections[Directions["moneyDirection"]]()
  28.             end
  29.         end
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment