| combine.mac : A Simple Combine macro
| Author : Chill
| Version : v1.2 23-Feb-2007 2:00AM EST
| Useage : /macro combine [combines] -- have tradeskill window open with recipie highlighted.
| /target yourself to pause the macro, target anything else (or nothing) to resume.
| Description : This macro will do the selected recipie until you run out of components or reach
[combines], pausing whenever you are targeted, and report success/fail rates when done.
#event done "Sorry, but you don't have everything you need for this recipe in your general inventory."
#event success "You have fashioned the items together to create something new:#*#"
#event failure "You lacked the skills to fashion the items together."
#event trivial "You can no longer advance your skill from making this item."
#event skillup "You have become better at#*#"
Sub Main(int max)
/declare triv int outer 0
/declare stats int outer 1
/declare dropit int outer 0
/declare sellit int outer 0
/declare skills int outer 0
/declare wins int outer 0
/declare fails int outer 0
/declare total int outer 0
/declare rate float outer 0
/declare zero int outer 0
/doevents flush
:Loop
/if (${Target.ID}==${Me.ID}) {
/delay 60m ${Target.ID}!=${Me.ID}
}
/if (${Cursor.ID}) {
/if (${dropit}) /drop
/autoinventory
/autoinventory
/autoinventory
/autoinventory
/goto :Loop
}
/if (${Defined[max]} && ${total} >= ${max}) /call Event_done
/nomodkey /notify TradeskillWnd CombineButton leftmouseup
/delay 2s ${Cursor.ID}
/doevents
/doevents trivial
/goto :Loop
/return
Sub ShowRate
/varcalc rate 100*${wins}/${total}
/echo (${wins}) of (${total}) combines succeeded (${rate}%).
/if (${fails}) {
/varcalc rate 100*${fails}/${total}
/echo (${fails}) of (${total}) combines failed (${rate}%).
}
/return
Sub Event_trivial
/if (${triv}) /call Event_done
/return
Sub Event_done
/if (${total}) {
/if (${stats}) /call ShowRate
} else {
/echo You had no combines made! Maybe you have the wrong recipe selected or didn't have everything?
}
/endmacro
/return
Sub Event_success
/varcalc wins ${wins}+1
/varcalc total ${total}+1
/autoinventory
/autoinventory
/autoinventory
/autoinventory
/return
Sub Event_failure
/varcalc fails ${fails}+1
/varcalc total ${total}+1
/autoinventory
/autoinventory
/autoinventory
/delay 5s
/return
Sub Event_skillup
/varcalc skills ${skills}+1
/return