Page 1 of 3

SwapItems(.mac|.inc) INI based item swapping..

Posted: Sun Mar 05, 2006 10:24 am
by brianman
This is an old macro I made for fast swapping item sets in/out.

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
/return
Example INI:

Code: 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

Posted: Mon Mar 27, 2006 4:07 pm
by horseshoecrabs
Does the mq2exchange plugin make this any faster than simply doing a swap via macro? In my own macros where I fetch items and equip them, the real lag is in opening and closing bags and not in the macros' execution.

Posted: Mon Mar 27, 2006 4:37 pm
by fearless
exchange (and bandolier) are much faster.

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 9:21 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 9:22 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 9:23 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 10:36 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 10:37 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 10:38 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 11:16 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 11:17 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 11:18 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 11:19 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 11:20 pm
by xyilla

Re: SwapItems(.mac|.inc) INI based item swapping..

Posted: Mon Jul 07, 2025 11:21 pm
by xyilla