m
→Any to Any
No edit summary |
m (→Any to Any) |
||
| Line 110: | Line 110: | ||
/script if ( not CursorHasItem() ) then PickupInventoryItem(17); if ( CursorHasItem() ) then PickupContainerItem(offhandBag, offhandBagSlot); end PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); end | /script if ( not CursorHasItem() ) then PickupInventoryItem(17); if ( CursorHasItem() ) then PickupContainerItem(offhandBag, offhandBagSlot); end PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); end | ||
</code> | </code> | ||
=== Any to Any === | |||
Script to swap from one set of weapons to another, in any combination. I've included an expanded version of the somewhat obfuscated code, although it's a too long to be usable itself. The CloseMerchant() call is included for safety reasons. | |||
The shorter version uses bag 3, slot 5 for the main weapon and bag 4, slot 6 for the offhand item, whereas the expanded version uses more descriptive terms for those locations. | |||
Note that the held weapons will end up in those inventory slots after the swap, so if you're swapping between a two-handed weapon and a one-handed + offhand configuration, you'll need to leave the offhand bag slot empty while you're wielding it, or swapping it out won't work properly. | |||
''/script local a,b,c=CursorHasItem,PickupInventoryItem,PickupContainerItem;if(not a())then CloseMerchant();b(17);if(a())then c(4,6);c(4,5);b(16)else c(4,5);b(16);c(4,6);b(17)end end | |||
/script | |||
if ( not CursorHasItem() )then | |||
CloseMerchant(); | |||
PickupInventoryItem(17); | |||
if ( CursorHasItem() ) then | |||
PickupContainerItem(offhandBag, offhandBagSlot); | |||
PickupContainerItem(mainhandBag, mainhandBagSlot); | |||
PickupInventoryItem(16); | |||
else | |||
PickupContainerItem(mainhandBag, mainhandBagSlot); | |||
PickupInventoryItem(16); | |||
PickupContainerItem(offhandBag, offhandBagSlot); | |||
PickupInventoryItem(17); | |||
end | |||
end | |||
=== From mainhand to mainhand === | === From mainhand to mainhand === | ||