Munson
11-27-2004, 03:15 PM
I have made some macros for switching weapons, but I have run into some problems.
If you have a item on the cursor already, that item will be switched with the item I pick up from my inventory (which I dont want). Can you either find the first empty inv slot or just simulate a right click to cancel the item-on-cursor-action.
Exampel code
** SwITCH 2H and 1H+SHIELD **
/script if( not CursorHasItem() ) then
/script PickUpInventoryItem(17);
/script if( CursorHasItem() ) then
/script PickUpContainerItem(bag1, slot1); //Place shield in empty slot in left most bag, slot has to be empty
/script PickUpContainerItem(bag2, slot2); //Pick up 2h
/script PickUpInventoryItem(16); //Switch 1h to 2h
/script PickUpContainerItem(bag2, slot2); //Place 1h where 2h was
/script else
/script PickUpInventoryItem(16);
/script PickUpContainerItem(bag2, slot2); //Place 2h and grab 1h
/script PickUpInventoryItem(16); //Equip 1h
/script PickUpContainerItem(bag1, slot1); //Pick up shield
/script PickUpInventoryItem(17);
/script end
/script else
/script *This is where I run into problems. I want to either place the item anywhere in the inv, or right click to remove the item from the cursor.*
/script end
If you have a item on the cursor already, that item will be switched with the item I pick up from my inventory (which I dont want). Can you either find the first empty inv slot or just simulate a right click to cancel the item-on-cursor-action.
Exampel code
** SwITCH 2H and 1H+SHIELD **
/script if( not CursorHasItem() ) then
/script PickUpInventoryItem(17);
/script if( CursorHasItem() ) then
/script PickUpContainerItem(bag1, slot1); //Place shield in empty slot in left most bag, slot has to be empty
/script PickUpContainerItem(bag2, slot2); //Pick up 2h
/script PickUpInventoryItem(16); //Switch 1h to 2h
/script PickUpContainerItem(bag2, slot2); //Place 1h where 2h was
/script else
/script PickUpInventoryItem(16);
/script PickUpContainerItem(bag2, slot2); //Place 2h and grab 1h
/script PickUpInventoryItem(16); //Equip 1h
/script PickUpContainerItem(bag1, slot1); //Pick up shield
/script PickUpInventoryItem(17);
/script end
/script else
/script *This is where I run into problems. I want to either place the item anywhere in the inv, or right click to remove the item from the cursor.*
/script end