HamBrick327

dioriteWORKING.lua

Dec 4th, 2022
66
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. modem = peripheral.find("modem")
  2. chest1 = peripheral.wrap("minecraft:chest_9")
  3. chest2 = peripheral.wrap("minecraft:chest_10")
  4. out = peripheral.wrap("minecraft:chest_12")
  5. turt = modem.getNameLocal()
  6. t = turtle
  7.  
  8. -- main loop
  9. while 1 do
  10.  
  11. t.craft(4)
  12. chest2.pushItems(turt, 1, 1) -- get cobble from chest and to slot on int eh turtle
  13. chest1.pushItems(turt, 1, 1) -- get quartz from chicken and send to slot 2 on the turtle
  14.  
  15. item3 = t.getItemCount(3)
  16. item4 = t.getItemCount(4)
  17.  
  18. if (item3 > 0) then
  19.     item = t.getItemDetail(3).name
  20.  
  21.     if (item == "minecraft:quartz") then
  22.         t.select(3)
  23.         t.transferTo(6, item3)
  24.         print("quartz detected")
  25.     elseif (item == "minecraft:cobblestone") then
  26.         t.select(3)
  27.         t.transferTo(5, item3)
  28.         print("cobble detected")
  29.     elseif (item == "minecraft:diorite") then
  30.             print("diorite detected")
  31.             t.select(3)
  32.             out.pullItems(turt, 3)
  33.             t.select(1)
  34.     else
  35.         print("Error: cannot add L to var 'ratio'")
  36.     end    
  37.    
  38. end
  39.  
  40. if (item4 > 0) then
  41.     item = t.getItemDetail(4).name
  42.    
  43.     if (item == "minecraft:quartz") then
  44.         t.select(4)
  45.         t.transferTo(6, item4)
  46.         print("quartz detected")
  47.     elseif (item == "minecraft:cobblestone") then
  48.         t.select(4)
  49.         t.transferTo(5, item4)
  50.         print("cobble detected")
  51.     elseif (item == "minecraft:diorite") then
  52.         print("diorite detected")
  53.         t.select(4)
  54.         out.pullItems(turt, 4)
  55.         t.select(1)
  56.     else
  57.         print("Error: cannot add var 'L' to var 'ratio'")
  58.     end
  59.  
  60. end
  61. end
Comments
Add Comment
Please, Sign In to add comment