Only requirement is that you have a free inventory slot. It'll end and tell you so if you don't have one free. And the item needs to have one charge or less.
All you have to do is destroy your toolbox when you're done. I gave this out to some people so I didn't want any accidents with /destroy.
Code: Select all
|charge.mac
|5-9-2004 - ieatacid
#turbo
Sub Main
/declare invSlot int local
/declare recharge string local
/declare rechslot int local
/declare container string local
/declare reagant string local
/declare cbag int local
/declare rbag int local
/declare cslot int local
/declare cslot1 int local
/declare rslot int local
/varset recharge "Anizok's Minimizing Device"
/varset container "Collapsed Toolkit"
/varset reagant "Mana Battery - Class Six"
/echo ${Macro.Name}: Recharging your ${recharge} with a ${reagant}
/if (${FindItem[${recharge}].Charges}>1) {
/popup Still ${FindItem[${recharge}].Charges} charges left, exiting.
/end
}
/if (!${FindItem[${recharge}].InvSlot}) {
/echo You don't have ${recharge}.
/end
}
/if (!${FindItem[${reagant}].InvSlot}) {
/echo You're out of ${reagant}.
/end
}
/if (!${FindItem[${container}].InvSlot}) {
/echo You don't seem to have ${container} on you.
/end
}
/for invSlot 22 to 29
/if (!${Me.Inventory[${invSlot}].ID}) {
|/echo Empty slot found at ${invSlot}
/goto :chargeit
}
/next invSlot
/echo Free up an Inv slot.
/popup No free Inv slot, ending.
/end
:chargeit
/cleanup
/if (${Me.Sitting}) /stand
/if (!${Window[InventoryWindow].Open}) /keypress Inventory
/varset cbag ${FindItem[${container}].InvSlot.Pack}
/varset rbag ${FindItem[${reagant}].InvSlot.Pack}
/varset rechslot ${FindItem[${recharge}].InvSlot}
/if (${cbag} != ${rbag}) /itemnotify ${cbag} rightmouseup
/itemnotify ${rbag} rightmouseup
/varset cslot ${FindItem[${container}].InvSlot}
/varset rslot ${FindItem[${reagant}].InvSlot}
/delay 1s ${Cursor.ID}
/itemnotify ${cslot} leftmouseup
/delay 1s ${Cursor.ID}
/autoinv
/varset cslot1 ${FindItem[${container}].InvSlot}
/itemnotify ${FindItem[${container}].InvSlot} rightmouseup
/delay 2s !${Me.Casting.ID}
/delay 1s ${Cursor.ID}
/itemnotify ${FindItem[${container}].InvSlot} leftmouseup
/delay 1s ${Cursor.ID}
/itemnotify ${cslot} leftmouseup
/delay 1s ${Cursor.ID}
/itemnotify ${cslot1} rightmouseup
/delay 1s ${Cursor.ID}
/ctrl /itemnotify ${rslot} leftmouseup
/delay 1s ${Cursor.ID}
/notify ContainerWindow ContainerSlot1 leftmouseup
/itemnotify ${rechslot} leftmouseup
/delay 1s ${Cursor.ID}
/notify ContainerWindow ContainerSlot2 leftmouseup
/delay 1s ${Cursor.ID}
/notify ContainerWindow Container_Combine leftmouseup
/delay 1s ${Cursor.ID}
/itemnotify ${rechslot} leftmouseup
/delay 1s ${Cursor.ID}
/cleanup
/return