Advertisement
CaptainSpaceCat

Gourmaryllis Automation

May 20th, 2022 (edited)
623
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local var = require "varutils"
  2. local save, load = var.save, var.load
  3.  
  4. delay_top = 3
  5. delay_bottom = 16
  6.  
  7. function search(a, b)
  8.     for i = a, b do
  9.         turtle.select(i)
  10.         if turtle.getItemCount() > 0 then
  11.             return true
  12.         end
  13.     end
  14.     return false
  15. end
  16.  
  17. lastDropped = load("lastDropped")
  18. while true do
  19.     if lastDropped == "bottom" then
  20.         if not search(1, 8) then break end
  21.         turtle.dropDown(1)
  22.         save("lastDropped", "top")
  23.         sleep(delay_top)
  24.     else
  25.         if not search(9, 16) then break end
  26.         turtle.dropDown(1)
  27.         save("lastDropped", "bottom")
  28.         sleep(delay_bottom)
  29.     end
  30. end
  31.  
Advertisement
RAW Paste Data Copied
Advertisement