Advertisement
Wihad

OC Mystical Flowers

Apr 3rd, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. local component=require("component")
  2. local sides=require("sides")
  3. local ts=component.transposer
  4. local tsGIN=ts.getInventoryName
  5. local tsGIS=ts.getInventorySize
  6. local tsGSSS=ts.getSlotStackSize
  7. local tsGSIS=ts.getStackInSlot
  8. local tsTI=ts.transferItem
  9. local rs=component.redstone
  10. local sdPl, sdDr, sdCrUs
  11. --Placer, Drawer, CrafterUser
  12.  
  13. for a=0, 5 do
  14.   if tsGIN(a)=="actuallyadditions:block_placer" then sdPl=a
  15.   elseif tsGIN(a)=="storagedrawers:controller" then sdDr=a
  16.   elseif tsGIN(a)=="extrautils2:analogcrafter" then sdCrUs=a
  17.   end
  18. end
  19.  
  20. while true do
  21.   for a=1,tsGIS(sdDr) do
  22.     local item=tsGSIS(sdDr,a)
  23.     if item then
  24.       if item.name=="botania:petal" then
  25.         local count=0
  26.         for a=1, tsGIS(sdPl) do count=count+tsGSSS(sdPl,a) end
  27.         for a=1, count do
  28.           rs.setOutput(sides.back,1)
  29.           rs.setOutput(sides.back,0)
  30.           os.sleep(0.5)
  31.           rs.setOutput(sides.left,1)
  32.           rs.setOutput(sides.left,0)
  33.           os.sleep(1)
  34.         end
  35.         count=0
  36.         for a=1, tsGIS(sdCrUs) do count=count+tsGSSS(sdCrUs,a) end
  37.         if count==0 and item.size<200 then
  38.           tsTI(sdDr,sdPl,(220-item.size)/4,a)
  39.         end  
  40.       end
  41.     end
  42.   end
  43.   os.sleep(30)
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement