For those that are trying to skill up, I added a beep so you can keep up with the skill ups. For those making costly tradeskill items in quantity, i have created a section that tracks how much you recover via salvage. This is very useful when trying to determine cost and sale value.
Code: Select all
#event OutOfStuff "Sorry, but you don't have everything you need for this recipe in your general inventory."
#event Com_Succeed "You have fashioned the items together to create something new:#*#"
#event Com_Fail "You lacked the skills to fashion the items together."
#event Com_Salvage "#*#but you managed to recover #1#.#*#"
#event Com_Skillups "You have become better at#*#"
Sub Main
/declare CombineAttempts int outer 0
/declare CombineSkillups int outer 0
/declare CombineSuccess int outer 0
/declare CombineFails int outer 0
/declare Salv[10] int outer 0
/declare SalvItem[10] string outer 0
/declare SalvItemCount[10] int outer 0
/declare MultiCombine int outer 0
/varset CombineAttempts 0
/if (!${Defined[Param0]}) /return
/echo Will make ${Param0} combine attempts!
:Loop
/notify COMBW_CombineArea CombineButton leftmouseup
/varset MultiCombine 0
:WaitforCombineDone
/if (!${Window[COMBW_CombineArea].Child[CombineButton].Enabled}) {
:ClearCursor
/if (${Cursor.ID}) {
/autoinventory
/doevents
/goto :ClearCursor
}
/doevents
/goto :WaitforCombineDone
}
/doevents
/if (${Param0}==${CombineAttempts}) /call Event_OutofStuff
/goto :Loop
/return
Sub Event_OutOfStuff
/delay 2s
/doevents
/declare iLoop int 0
/echo You have run out of a critical supply. Ending the macro.
/echo - You skilled up ${CombineSkillups} time(s).
/echo - Succeeded ${CombineSuccess} time(s) out of ${CombineAttempts} attempt(s).
/for iLoop 1 to 10
/if (${Salv[${iLoop}]}==1) {
/echo - You recovered ${SalvItemCount[${iLoop}]} of ${SalvItem[${iLoop}]}
}
/next iLoop
/endmacro
/return
Sub Event_Com_Succeed
/varcalc MultiCombine ${MultiCombine}+1
/if (${MultiCombine}>1) /return
/varcalc CombineAttempts ${CombineAttempts}+1
/echo Attempt #${CombineAttempts}
/ECHO Success!
/varcalc CombineSuccess ${CombineSuccess}+1
/return
Sub Event_Com_Fail
/echo Fail!
/varcalc CombineAttempts ${CombineAttempts}+1
/echo Attempt #${CombineAttempts}
/varcalc CombineFails ${CombineFails}+1
/return
Sub Event_Com_Salvage(Junk,RecoveredItem)
/declare iLoop int 0
/for iLoop 1 to 10
/if (${Salv[${iLoop}]}==1) {
/if (${SalvItem[${iLoop}].Equal[${RecoveredItem}]}) {
/varcalc SalvItemCount[${iLoop}] ${SalvItemCount[${iLoop}]}+1
/echo Recovered another ${RecoveredItem}.
/return
}
}
/next iLoop
/for iLoop 1 to 10
/if (${Salv[${iLoop}]}==0) {
/varcalc SalvItemCount[${iLoop}] ${SalvItemCount[${iLoop}]}+1
/varset Salv[${iLoop}] 1
/varset SalvItem[${iLoop}] ${RecoveredItem}
/echo Recovered ${RecoveredItem}.
/return
}
/next iLoop
/return
Sub Event_Com_Skillups
/echo Skillup!
/beep
/varcalc CombineSkillups ${CombineSkillups}+1
/return



