Code: Select all
Sub Main
/call SwapItems "${MacroQuest.Server}_${Me.Name}"
/return
Sub SwapItems(string Section)
/declare INIFile string local ini/SwapItems.ini
/declare Keys string local
/declare SwapDelay int local 1
/declare i int local 0
/if (!${Plugin[mq2exchange].Name.Equal[mq2exchange]}) {
/echo MQ2Exchange isn't loaded.
/echo This macro/snippet requires MQ2Exchange to function.
/return
}
/if (${Ini[${INIFile},${Section}].Equal[NULL]}) /return
/varset Keys ${Ini[${INIFile},${Section}]}
:TrimKeys
/if (${Keys.Right[1].Equal[|]}) /varset Keys ${Keys.Left[${Math.Calc[${Keys.Length}-1]}]}
/if (${Keys.Right[1].Equal[|]}) /goto :TrimKeys
/for i 1 to ${Math.Calc[${Keys.Count[|]}+1]}
/if (${InvSlot[${Keys.Arg[${i},|]}].Item.Name.NotEqual[${Ini[${INIFile},${Section},${Keys.Arg[${i},|]}]}]}) {
/exchange "${Ini[${INIFile},${Section},${Keys.Arg[${i},|]}]}" ${Keys.Arg[${i},|]}
/delay ${SwapDelay}
}
/next i
/returnCode: Select all
[server_Toon]
charm=Drachnid Candle
leftear=Dripping Grimcoat Earring
head=Chaos-Imbued Leather Skullcap
face=Mask of Forbidden Rites
rightear=Earring of Gray Waters
neck=Hive Silk Pearl Necklace
shoulder=Deathshed Priest Mantle
arms=Chaos-Imbued Leather Sleeves
back=Hive Silk Cloak
leftwrist=Bracer of Grievous Harm
rightwrist=Tempered Hive Bracelet
ranged=Korlach Sacrifice Plate
hands=Gloves of Coalesced Flame
mainhand=Kelp-Covered Hammer
offhand=Bulwark of Lost Souls
leftfinger=Faceted Nargilor Band
rightfinger=Clockwork Commander's Ring
chest=Dark Tunic of the Enslavers
legs=Molted Drachnid Chitin Pants
feet=Kerasha's Sylvan Boots
waist=Belt of Contempt
ammo=Black Ornate Chain Bridle
[Heal]
chest=Dark Tunic of the Enslavers
offhand=Bulwark of Lost Souls
