sub CombineInventory
for %CIType 1 6
{
for %CIArmor 1 12 ; Want armor of the same type processed at one time
{
for %CILevel 1 4 ; do not need to try to combine invulnerable
{
set %CICombineQvar Refinement , %CIType , %CILevel , %CIArmor ; this order allows 2 digit armor, but does the same type of armor together
gosub q_count %CICombineQvar
while #Result > %CILevel
{
set %CICombineQuantity %CILevel + 1
for %CIPullQty 1 %CICombineQuantity
{
gosub q_pop %CICombineQvar
if #Result <> _NoValue_
{
finditem #Result C
set %CILastBagid #findbagid ; we will put the new on back in the bag we got the last one from
exevent drag #Result
wait 5
exevent dropc #Backpackid
wait 20
}
}
; display yesno Is the Pulled Qty Correct?
; if #dispres = yes
; {
finditem %Refinements C_ , #backpackid
if #findcnt = %CICombineQuantity
{
for #findindex 1 #findcnt
{
set #lobjectid %AmalgamatorID
event macro 17
target 2s
set #ltargetid #findid
set #ltargetkind 1
event macro 22
wait 20
}
finditem %Refinements C_ , #backpackid
if #findcnt = 1
{
; add new to queue
event property #findid
wait 5
gosub SumInventory
wait 20
exevent drag #findid
wait 5
exevent dropc %CILastBagID %X %Y ; put new refinement into bag the last one was pulled from
wait 20
}
else
{
display ok I am confused by a miscount on refinements - expected 1 but found #findcnt
pause
}
}
; }
else
{
pause
}
gosub q_count %CICombineQvar
} ; end while
}
}
}