Guest User

scanForHammer.lua

a guest
Oct 23rd, 2024
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. local crafter_side = "back"
  2. local hammer_found_status = "right"
  3. local redstone_output = "front"
  4. local inv = peripheral.wrap(crafter_side)
  5. local hammer_name = "alltheores:copper_ore_hammer"
  6.  
  7.  
  8. while true do
  9.     local found = false    
  10.     for slot,item in pairs(inv.list()) do    
  11.         if item.name == hammer_name then
  12.            found = true
  13.            redstone.setOutput(hammer_found_status,true)
  14.            redstone.setOutput(redstone_output,false)
  15.         end
  16.     if found == false then
  17.         redstone.setOutput(hammer_found_status,false)        
  18.         redstone.setOutput(redstone_output,true)
  19.     end
  20.     end
  21. end
  22.  
Add Comment
Please, Sign In to add comment