I decided to make another combine Heroic Resists macro. It is based on Dimurs macro, but is heavily modified.
Key features:
- Combines all resist augs in inventory (not bank) up to the max rank set, going rank by rank.
- Only combines ranks X and XV in sets of 8 not 2
- Works with stacked Augments
- If you run out of inventory slots, skips to next rank
Make a file called ResistAugs.mac (or whatever you want) and paste this code into it.
To run, just type
/mac ResistAugs [
max combine up to rank]
Example 1: If you only have 26x Rank I augs in your inventory and ran "
/mac ResistAugs IV". This would end with you having 1x Rank I, 1x Rank II, and 3x Rank IV.
Example 2: If you only have 300x Rank X augs in your inventory and ran "
/mac ResistAugs XVI". This would end with you having 1x Rank XIII, 1x Rank XV, and 1x Rank XVI.
ResistAugs.mac
|==== Version 1.0
|==== Coded by Ogru for use on EZServer
|==== Based on Dimurs Heroic Resists macro
|-------------------------------------------------------
|--------- A Magic Box in slot 10 is required ----------
|-------------------------------------------------------
#turbo
|==== Sub Main
Sub Main(MaxRank)
|Adjust min/max delays if not combining properly
/if (!${Defined[minDelay]}) /declare minDelay int outer 5
/if (!${Defined[maxDelay]}) /declare maxDelay int outer 15
/if (!${Defined[HRAugsInBags]}) /declare HRAugsInBags int outer
/if (!${Defined[HROpenBagSlots]}) /declare HROpenBagSlots string outer
/if (!${Defined[MagicBoxItemCount]}) /declare MagicBoxItemCount string outer
/if (!${Defined[MaxRankNum]}) /declare MaxRankNum int outer 0
/if (!${Defined[HRRank]}) /declare HRRank string outer
/if (!${Defined[HRRankID]}) /declare HRRankID int outer
/declare i int local
/declare a string local I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX|
|Find Max Rank Number
/for i 1 to 20
/if (${MaxRank.Equal[${a.Arg[${i},|]}]}) {
/varcalc MaxRankNum ${i}-1
}
/next i
/call OpenBags
/If (${InvSlot[pack10].Item.Name.NotEqual[A Magic Box]}) {
/bc [+r+]SLOT 10 Must be A Magic Box[+x+]
/goto :TheEnd
}
/If (${InvSlot[pack10].Item.Items} > 0) {
/bc [+r+]A Magic Box in slot 10 MUST be empty to start[+x+]
/goto :TheEnd
}
|Loop through each rank of SoHR
/for i 1 to ${MaxRankNum}
/varset HRRank ${a.Arg[${i},|]}
/varset HRRankID ${FindItem[=stone of heroic resistance ${HRRank}].ID}
/call HRTallyBagSlots
/delay 1
/call HRCombineAugs
/next i
:TheEnd
/autoinventory
/cleanup
/Return
|==== End Sub Main
|==== Sub HRTallyBagSlots
Sub HRTallyBagSlots
/declare i int local 1
/declare j int local
/varset HRAugsInBags 0
/if (${FindItemCount[=stone of heroic resistance ${HRRank}]} > 0 ) {
/for i 1 to 9
/for j 1 to ${InvSlot[pack${i}].Item.Container}
/if (${InvSlot[pack${i}].Item.Item[${j}].ID}==${HRRankID}) {
/varcalc HRAugsInBags ${HRAugsInBags} + ${InvSlot[pack${i}].Item.Item[${j}].Stack}
}
/next j
/next i
/bc [+y+]Rank: ${HRRank}[+x+] > In bags: [+t+]${HRAugsInBags}[+x+] - Equipped: [+t+]${Int[${Math.Calc[${FindItemCount[=stone of heroic resistance ${HRRank}]}-${HRAugsInBags}]}]}[+x+]
}
/Return
|==== End Sub HRTallyBagSlots
|==== Sub OpenBags
Sub OpenBags
/declare i int local
/for i 1 to 10
/if (${InvSlot[pack${i}].Item.Container}) {
/if (!${Window[pack${i}].Open}) /itemnotify pack${i} rightmouseup
}
/next i
/Return
|==== End Sub OpenBags
|==== End Sub CheckBagSpace
Sub CheckBagSpace
/declare i int local
/varset HROpenBagSlots 0
/for i 1 to 9
/if (${InvSlot[pack${i}].Item.Container}) /varcalc HROpenBagSlots ${HROpenBagSlots}+${Int[${Math.Calc[${InvSlot[pack${i}].Item.Container}-${InvSlot[pack${i}].Item.Items}]}]}
/next i
/varset MagicBoxItemCount ${InvSlot[pack10].Item.Items}
/Return
|==== Sub CheckBagSpace
|==== Sub HRCombineAugs
Sub HRCombineAugs
/declare Bag int local 1
/declare Slot int local
/declare FirstPass bool local true
/declare TotalAugsInBags int local ${HRAugsInBags}
:CombineLoop
/call CheckBagSpace
|--- Rank X and XV
/if ((${HRRank.Equal[X]}) || (${HRRank.Equal[XV]})) {
/if (${TotalAugsInBags}<8) /goto :TheEnd
/if (${Math.Calc[${MagicBoxItemCount}+${HRAugsInBags}]}<8) {
/goto :TheEnd
}
/if ((${HROpenBagSlots}<1) && (${Math.Calc[${MagicBoxItemCount}+${HRAugsInBags}]}>8)) {
/echo Not enough bag slots, moving to next Rank
/goto :TheEnd
}
|--- All other Ranks
} else {
/if (${HRAugsInBags}<2) /goto :TheEnd
/if ((${HROpenBagSlots} < 1) && (!${FirstPass})) {
/echo Not enough bag slots, moving to next Rank
/goto :TheEnd
}
}
/varset FirstPass False
/for Bag 1 to 9
/for Slot 1 to ${InvSlot[pack${Bag}].Item.Container}
/if (${InvSlot[pack${Bag}].Item.Item[${Slot}].ID}==${HRRankID}) {
/ctrlkey /itemnotify in pack${Bag} ${Slot} leftmouseup
/delay ${minDelay}
/delay ${maxDelay} (${Cursor.ID})
/itemnotify in pack10 ${Int[${Math.Calc[${InvSlot[pack10].Item.Items}+1]}]} leftmouseup
/delay ${minDelay}
/delay ${maxDelay} (!${Cursor.ID})
/varcalc HRAugsInBags ${HRAugsInBags}-1
/if (((${HRRank.Equal[X]}) || (${HRRank.Equal[XV]})) && (${InvSlot[pack10].Item.Items}<8)) {
/goto :CombineLoop
}
/if ((${InvSlot[pack10].Item.Items}==2) || (${InvSlot[pack10].Item.Items}==8)) {
/combine pack10
/delay ${minDelay}
/delay ${maxDelay} (${Cursor.ID})
/autoinventory
/delay ${minDelay}
/delay ${maxDelay} (!${Cursor.ID})
/call ClearBag10
/goto :CombineLoop
}
}
/next Slot
/next Bag
/goto :CombineLoop
:TheEnd
/Return
|==== End Sub HRCombineAugs
|==== Sub ClearBag10
Sub ClearBag10
/declare j int local
/If (${InvSlot[pack10].Item.Items} > 0) {
/for j 1 to ${InvSlot[pack10].Item.Container}
/if (${InvSlot[pack10].Item.Item[${j}].ID}) {
/shiftkey /itemnotify in pack10 ${j} leftmouseup
/delay ${minDelay}
/delay ${maxDelay} (${Cursor.ID})
/if (${Cursor.ID}) /autoinv
/delay ${maxDelay} (!${Cursor.ID})
}
/next j
}
/Return
|==== End Sub ClearBag10
Please let me know in game or here if there are any issues or suggestions.