Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
component:database [2015/08/12 19:30]
rashy
component:database [2015/08/12 19:31] (current)
rashy
Line 31: Line 31:
 local db = component.database -- primary database component local db = component.database -- primary database component
 local invcontrol = component.inventory_controller -- primary inventory controller local invcontrol = component.inventory_controller -- primary inventory controller
 +
 +-- define slot numbers
 +dbSlot = 1
 +invSlot = 1
  
 -- compare item inside remote inventory to item in first slot of database -- compare item inside remote inventory to item in first slot of database
-if db.get(1).label == invcontrol.getStackInSlot(sides.north, ​1).label then+if db.get(dbSlot).label == invcontrol.getStackInSlot(sides.north, ​invSlot).label then
  -- items match, do stuff with it.   -- items match, do stuff with it. 
 else else