resources/[ui]/caue-inventory/nui/scripts.js
// slot2 is the object being moved originally, slot 1 is the item it is replacing with.
slot2 is the object being moved originally, slot 1 is the item it is replacing with.
slot2 is the object being moved originally slot 1 is the item it is replacing with .
function SwapStacks(targetSlot, originSlot, inv1, inv2, itemid1, metainformation1, itemid2, metainformation2) {
    let originInventory;
    let targetInventory;
    if (inv2 == 'wrapmain') {
        originInventory = PlayerInventoryName;
    } else {
        originInventory = TargetInventoryName;
    }
    if (inv1 == 'wrapmain') {
        targetInventory = PlayerInventoryName;
    } else {
        targetInventory = TargetInventoryName;
    }
    RequestItemData();
    $.post(
        'https://caue-inventory/SlotJustUsed',
        JSON.stringify({
            targetslot: targetSlot,
            origin: originSlot,
            itemid: itemid,
            move: false,
            MyInvMove: targetInventory === PlayerInventoryName,
            metadata: metainformation1,
        }),
    );
    invSwap(targetSlot, targetInventory, originSlot, originInventory, itemid1, metainformation1, itemid2, metainformation2);
    UpdateSetWeights('');
}
function SwapStacks ( targetSlot , originSlot , inv1 , inv2 , itemid1 , metainformation1 , itemid2 , metainformation2 ) { let originInventory ; let targetInventory ; if ( inv2 == 'wrapmain' ) { originInventory = PlayerInventoryName ; } else { originInventory = TargetInventoryName ; } if ( inv1 == 'wrapmain' ) { targetInventory = PlayerInventoryName ; } else { targetInventory = TargetInventoryName ; } RequestItemData ( ) ; $ . post ( 'https://caue-inventory/SlotJustUsed' , JSON . stringify ( { targetslot : targetSlot , origin : originSlot , itemid : itemid , move : false , MyInvMove : targetInventory === PlayerInventoryName , metadata : metainformation1 , } ) , ) ; invSwap ( targetSlot , targetInventory , originSlot , originInventory , itemid1 , metainformation1 , itemid2 , metainformation2 ) ; UpdateSetWeights ( '' ) ; }
slot2 is the object being moved originally, slot 1 is the item it is replacing with.
slot2 is the object being moved originally slot 1 is the item it is replacing with .
// $.post('https://caue-inventory/swapstack', JSON.stringify({ //   slot1: slot1, //   slot2: slot2, //   inv1: inv1, //   inv2: inv2, // })); //InventoryLog("Swapped Slot " + targetSlot + " of " + targetInventory + " and " + originSlot + " of " + originInventory + " " + itemid1 + " " + metainformation1 + " " + itemid2 + " " + metainformation2 )