Advertisement
1gA

CC Reinforced Stone Trigger

1gA
Jan 25th, 2022 (edited)
867
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. c = peripheral.wrap("right")
  2. r_side = "bottom"
  3.  
  4. current_redstone = false
  5. function set_redstone(status)
  6.     if status ~= current_redstone then
  7.         current_redstone = status
  8.         redstone.setOutput(r_side, current_redstone)
  9.     end
  10. end
  11.  
  12. while true do
  13.     total = 0
  14.     condition_met = false
  15.     for k, item in pairs(c.getAllStacks()) do
  16.         if total == 1 then
  17.             condition_met = false
  18.             break
  19.         end
  20.         item_basic = item.basic()
  21.         if item_basic.name == "cobblestone" then
  22.             condition_met = true
  23.         else
  24.             condition_met = false
  25.             break
  26.         end
  27.     end
  28.        
  29.     set_redstone(condition_met)
  30.     os.sleep(0.1)
  31. end
  32.  
Advertisement
RAW Paste Data Copied
Advertisement