abc123mewot

Angelheart vials

Dec 23rd, 2023
954
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1. print("Angelheart vial autocrafting turtle")
  2.  
  3. -- ME Interface must be placed in front of the turtle
  4.  
  5. if not fs.exists("utils.lua") then
  6.     print("Downloading Botany Base Utils API")
  7.     shell.run("pastebin get zBLN8K4d utils.lua")
  8. end
  9. os.loadAPI("utils.lua")
  10.  
  11. utils.setSignalItem("minecraft:cobblestone")
  12.  
  13. local expectingRune = false
  14.  
  15. while true do
  16.     if utils.scanForItem("botania:livingrock") then
  17.         print("Crafting an angelheart vial")
  18.         os.sleep(1) -- Wait for the turtle to get all the items from the interface
  19.         utils.dropDownAllItems() -- Drop all items on runic alter
  20.         os.sleep(3) -- Give it some time to craft
  21.         expectingRune = true
  22.     end
  23.    
  24.     if utils.scanForItem("xreliquary:angelheart_vial") then
  25.         if expectingRune then print("Angelheart vial was crafted") else print("Got unexpected angelheart vial!") end
  26.         utils.dropAllItems(true) -- Also drop the signal item
  27.         expectingRune = false
  28.         os.sleep(0.1)
  29.     end
  30.    
  31.     if not expectingRune then -- If a rune is expected to craft then constantly check for it
  32.         if utils.isServerRestartingSoon() then
  33.             break -- Stop crafting if the servers going to restart
  34.         end
  35.         os.sleep(1)
  36.     end
  37. end
  38.  
Advertisement
Add Comment
Please, Sign In to add comment