how to equip two weapons with same name?

anongamer

Active Member
I have two weapons with the same name on one of my chars. Here is what I think should work from reading the wiki but it does not.

Code:
variable string PrimaryWeapon = "Flawless Cavalier's Jagged Axe of Striking"
variable int PrimaryWeaponID
variable string SecondaryWeapon = "Flawless Cavalier's Jagged Axe of Striking"

function main()
{
	echo wear macro
	PrimaryWeaponID:Set[${Me.Inventory[${PrimaryWeapon}].ID}]
	echo ${PrimaryWeaponID}
	echo ${Me.Inventory[notid,${PrimaryWeaponID},${SecondaryWeapon}].ID}
}
The above code outputs the same id for both echos.

How do I use two different weapons with the same name?
 

Valerian

ISX Specialist
Perhaps you don't understand the meaning of an ID.

Every item of the same name has the same ID. Period. This is not negotiable.

How are you trying to "use" two weapons with the same name? If you are trying to equip both, simply do so. The Equipment and Inventory are separate, so when you equip the first, it is removed from the inventory. At that point, you would be able to access the second (now the only one in the inventory) to equip it.
 

anongamer

Active Member
Oh, well I guess I did. I thought it was a unique id. The way that vga equips items will not equip two weapons with the same name. It equips my axe in my primary hand and then moves it to my secondary hand.

Code:
;********************************************
function BardSong()
{
	if ${Me.Class.Equal[Bard]}
	{
	If ${fight.ShouldIAttack} && !${Me.Effect[${Me.FName}'s Bard Song - "${FightSong}"](exists)}
		{
     	 		If !${Me.Inventory[${PrimaryWeapon}].CurrentEquipSlot.Equal[Primary Hand]}
       				{
        			Me.Inventory[${PrimaryWeapon}]:Equip[Primary Hand]
        			Waitframe
        			}
      			If !${Me.Inventory[${SecondaryWeapon}].CurrentEquipSlot.Equal[Secondary Hand]}
        			{
         			Me.Inventory[${SecondaryWeapon}]:Equip[Secondary Hand]
         			Waitframe
        			}
			Songs[${FightSong}]:Perform
		}
	If !${fight.ShouldIAttack} && !${Me.Effect[${Me.FName}'s Bard Song - "${RunSong}"](exists)}
		{
  	             	Me.Inventory[${Drum}]:Equip
			wait 3
			Songs[${RunSong}]:Perform
		}
	}
}
I thought this was because they had the same name.
 

Valerian

ISX Specialist
Oh. Ignore me. I for some reason thought you were talking about EQ2 inventory. I know absolutely nothing about Vanguard data, and didn't realize which forum this post was in. My apologies.

Perhaps though with the code snippet and further clarification, someone more familiar with VG and ISXVG can assist you.
 

anongamer

Active Member
well I couldn't come up with a one liner so I figured I'd post what I did. I didn't see any negative selectors except for the notid on the wiki so if there is one for current slot please let me know.

here is what i came up with using a for loop (it took awhile because i went out of town):

Code:
variable string PrimaryWeapon = "Flawless Cavalier's Jagged Axe of Striking"
variable string SecondaryWeapon = "Flawless Cavalier's Jagged Axe of Striking"

function main()
{	
	;primary hand
	If !${Me.Inventory[${PrimaryWeapon}].CurrentEquipSlot.Equal[Primary Hand]}
		{
		Me.Inventory[${PrimaryWeapon}]:Equip[Primary Hand]
		wait 30 ${Me.Inventory[${PrimaryWeapon}].CurrentEquipSlot.Equal[Primary Hand]}
		}
	
	;secondary hand
	variable int inventory_number
	for ( inventory_number:Set[1]; ${Me.Inventory[${inventory_number}](exists)}; inventory_number:Inc )
	{
		;echo "${inventory_number}: ${Me.Inventory[${inventory_number}]}  --> ${Me.Inventory[${inventory_number}].CurrentEquipSlot}"
		if ${Me.Inventory[${inventory_number}].Name.Equal[${SecondaryWeapon}]} && ${Me.Inventory[${inventory_number}].CurrentEquipSlot.NotEqual[Primary Hand]}
		{
			Me.Inventory[${inventory_number}]:Equip[Secondary Hand]
         	Waitframe
			break
		}
	}
}
 

mmoaddict

Original Script Author: VGA
just a little warning.. repeated calls to me.inventory can cause instability for some people. Try to only check and switch weapons as little as possible in the script.

mmo
 
Top Bottom