Advertisement
ozozx235

altar.lua

Dec 5th, 2022 (edited)
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | Gaming | 0 0
  1. os.loadAPI("AltUtil.lua")
  2. alt = peripheral.wrap("front")
  3. while true do
  4.     sleep(0.1)
  5.     shell.run("clear")
  6.     ing = turtle.getItemDetail()
  7.     if not ing then
  8.         rs.setOutput("left",false)
  9.         print("no item")
  10.     else
  11.         rec = AltUtil.findRec(ing)
  12.         if not rec then
  13.             rs.setOutput("left",false)
  14.             print("invalid item")
  15.             turtle.dropUp()
  16.         else
  17.             if AltUtil.getBlood(alt)<rec.blood then
  18.                 print("insufficient blood")
  19.                 rs.setOutput("left",true)
  20.             else
  21.                 rs.setOutput("left",false)
  22.                 print("receipe in progress")
  23.                 turtle.drop(1)
  24.                 while alt.getItemDetail(1).name~=rec.product.name do
  25.                     sleep(0.1)
  26.                 end
  27.                 alt.pushItems("top",1)
  28.             end
  29.         end
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement