04-05-2005, 05:44 PM
I wonder if there is any code for this purpose that is completely problem free. This macro works most of the time:
/script if( not GetInventoryItemQuality("player",17)) then PickupContainerItem(X,1) PickupInventoryItem(16) UseContainerItem(X,2) else PickupInventoryItem(17) PickupContainerItem(X,2) UseContainerItem(X,1);end
Usage
X = bag#
1,2 = slot#
Example: for a 10 slot bag in (leftmost) position 4
1. Equip 1H weapon & shield
2. Place 2H weapon in bag 4, slot 9
3. Don't put loot items in slot 10!
/cast Bloodrage
/script if( not GetInventoryItemQuality("player",17)) then PickupContainerItem(4,9) PickupInventoryItem(16) UseContainerItem(4,10) else PickupInventoryItem(17) PickupContainerItem(4,10) UseContainerItem(4,9);end
There is enough space left to /cast Rage also. Two problems: the last slot must be kept clear of loot, and, if the switch occurs when a mob hits, one of the items may end up in an arbitrary place in one of the bags.
/script if( not GetInventoryItemQuality("player",17)) then PickupContainerItem(X,1) PickupInventoryItem(16) UseContainerItem(X,2) else PickupInventoryItem(17) PickupContainerItem(X,2) UseContainerItem(X,1);end
Usage
X = bag#
1,2 = slot#
Example: for a 10 slot bag in (leftmost) position 4
1. Equip 1H weapon & shield
2. Place 2H weapon in bag 4, slot 9
3. Don't put loot items in slot 10!
/cast Bloodrage
/script if( not GetInventoryItemQuality("player",17)) then PickupContainerItem(4,9) PickupInventoryItem(16) UseContainerItem(4,10) else PickupInventoryItem(17) PickupContainerItem(4,10) UseContainerItem(4,9);end
There is enough space left to /cast Rage also. Two problems: the last slot must be kept clear of loot, and, if the switch occurs when a mob hits, one of the items may end up in an arbitrary place in one of the bags.