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

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

brianman
a ghoul
a ghoul
Posts: 114
Joined: Mon Jun 07, 2004 7:46 am

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

Post by brianman » Sun Mar 05, 2006 10:24 am

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

horseshoecrabs
a ghoul
a ghoul
Posts: 89
Joined: Fri Jun 10, 2005 6:35 pm

Post by horseshoecrabs » Mon Mar 27, 2006 4:07 pm

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.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Mon Mar 27, 2006 4:37 pm

exchange (and bandolier) are much faster.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 9:21 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 9:22 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 9:23 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 10:36 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 10:37 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 10:38 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 11:16 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 11:17 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 11:18 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 11:19 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 11:20 pm


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

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

Post by xyilla » Mon Jul 07, 2025 11:21 pm