Program 2
public unlisted lua v1 · immutablelocal robot = require("robot")local component = require("component")function checkSwitch()robot.setLightColor(0xF4FF0D) --yellowif robot.count(1) > 50 then=component.inventory_controller.equip()expUse()else expUse()endfunction expUse()robot.setLightColor(0x00FF00) --greenif robot.use()else checkSwitch()endwhile true docheckSwitch()end