SHARE
TWEET

TakeItems.lua

fatboychummy May 30th, 2020 875 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function getItems()
  2.   print("Collecting items.")
  3.   local tTurtles = {peripheral.find("turtle")}
  4.   local sChest
  5.  
  6.   for _, sName in ipairs(peripheral.getNames()) do
  7.     if sName:find("chest") then
  8.       sChest = sName
  9.       break
  10.     end
  11.   end
  12.   if not sChest then
  13.     error("Couldn't find chest!")
  14.   end
  15.   for i = 1, #tTurtles do
  16.     local tCurrent = tTurtles[i]
  17.     for o = 1, 16 do
  18.       tCurrent.pushItems(sChest, o, 1, o)
  19.     end
  20.   end
  21. end
  22.  
  23. getItems()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top