local robot = require("robot") local component = require("component") function checkSwitch() robot.setLightColor(0xF4FF0D) --yellow if robot.count(1) > 50 then =component.inventory_controller.equip() expUse() else expUse() end function expUse() robot.setLightColor(0x00FF00) --green if robot.use() else checkSwitch() end while true do checkSwitch() end