local component = require("component") local sides = require("sides") local db = component.database --首选数据库组件 local invcontrol = component.inventory_controller --首选物品栏控制器 --定义槽位序号 dbSlot = 1 invSlot = 1 --将外部物品容器中的物品与数据库第一个槽位中的物品进行对比 if db.get(dbSlot).label == invcontrol.getStackInSlot(sides.north, invSlot).label then --物品匹配,进行对应操作。 else --物品不匹配,什么都不做,或者进行其他操作 end