Advertisement
VaMinion

evenSplit

Jul 11th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. -- Have the turtle facing the device that will be feeding into it
  2. -- Larger stack to the left, smaller stack to the right
  3. os.sleep(300)
  4. print("Beginning distribution protocol")
  5. while true do
  6.  print("Distributing")
  7.  turtle.select(1)
  8.  stackSize = turtle.getItemCount(1)
  9.  distSize = (stackSize-(stackSize % 2)) / 2
  10.  turtle.transferTo(2, distSize)
  11.  turtle.turnLeft()
  12.  turtle.select(1)
  13.  turtle.drop()
  14.  turtle.turnRight()
  15.  turtle.turnRight()
  16.  turtle.select(2)
  17.  turtle.drop()
  18.  turtle.turnLeft()
  19.  print("Sleeping until next transfter")
  20.  os.sleep(600)
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement