Advertisement
Diamssword

quarry_filter.lua

Jun 17th, 2021
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. --route les minerais d'une quarry vers fours, crusher et stockage
  2.  
  3. routed=0
  4. notCrushable= {["thaumcraft:ore_cinnabar"]=true}--list des minerais non crushables
  5. p = peripheral.wrap("bottom")
  6. while true do
  7.     for k=1,p.size(),1 do
  8.         item = p.getItemMeta(k)
  9.         c1,c2=term.getCursorPos()
  10.         term.setCursorPos(1,1)
  11.         print(routed.." items routeds.")
  12.         term.setCursorPos(c1,c2)
  13.         if(item) then
  14.             routed=routed+1
  15.         if(notCrushable[item.name] == true) then
  16.             p.pushItems("south",k)
  17.             print("routing "..item.displayName.." to furnace")
  18.         elseif(string.find(item.displayName," ore")) then
  19.             p.pushItems("north",k)
  20.             print("routing "..item.displayName.." to crusher")
  21.         else
  22.             p.pushItems("east",k)
  23.             print("routing "..item.displayName.." to chests")
  24.         end
  25.         end
  26.     end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement