i havent tested this or compiled,but it will compare inventory count of before barter - after barter,so if items swapped are the same number,it will fail to return a different value,but it should work
variable inv1;
variable inv2;
procedure barter1 begin
inv1 :=...
its simple to add merchant items if u have the source code,for instance rp source for mom in den box : (DIMOMBOX.SSL)
check_restock_item(PID_STIMPAK, 0, 2, 90)
check_restock_item(PID_CROWBAR, 1, 1, 40)
check_restock_item(PID_KNIFE, 1, 1, 40)...