Advertisement
Stewie410

ItemCheck

Sep 15th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. -- Output Redstone Signal when ID changes states
  2. local altar = peripheral.wrap("tealtar_3")
  3.  
  4. function getStack() return altar.getStackInSlot(1) end
  5.  
  6. function isOrb(stack)
  7.     if stack == nil then return nil end
  8.     if string.find(stack.id, "BloodOrb") then return true end
  9.     return false
  10. end
  11.  
  12. function hasChanged(stack)
  13.     local id = stack.id
  14.     if getStack().id == id then return true end
  15.     return false
  16. end
  17.  
  18. while true do
  19.     sleep(0)
  20.     redstone.setOutput("top", false)
  21.     local stack = getStack()
  22.     print("Stack: "..stack.id)
  23.     if getStack().id ~= stack.id then
  24.         redstone.setOutput("top", true)
  25.         sleep(0.1)
  26.     end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement