Code: Select all
| - base.mac -
| basis for any tradeskill macro
#include routines.mac
#define CombinerType medicine
sub Main
/call FindCombiner CombinerType
/if $return==99 /return
/varset v80 $return
/cleanup
:CleaningLoop
/if "$target()"=="TRUE" /goto :CleaningLoop
/click left auto
/click right inv $v80
| Check to make sure the combiner is / can be made empty
/varset v39 0
/if "$cursor()"=="TRUE" /click left auto
:CleanCombiner
/if $pack($v80,empty)==FALSE /call CleanContainer $v80
/if n $v39==30 /goto :TooMuchStuff
/varadd v39 1
/if $pack($v80,empty)==FALSE /goto :CleanCombiner
/if "$cursor()"=="TRUE" /click left auto
| Do whatever you are going to do here, call a param, put the code
| here, whatever
/goto :End
:TooMuchStuff
/echo You have too much stuff on you! Aborting...
/mqlog You have too much stuff on you! Aborting...
:End
/return
sub CleanContainer
/varcalc l0 $pack($p0,slots)-1
/sendkey down shift
/for l1 0 to $l0
/if "$item($p0,$l1)"=="NULL" /goto :AlreadyClean
/click left pack $p0 $l1
:CleanContainerWait0
/if "$cursor()"!="TRUE" /goto :CleanContainerWait0
/doevents
/click left auto
:CleanContainerWait1
/if "$cursor()"=="TRUE" /goto :CleanContainerWait1
/doevents
:AlreadyClean
/next l1
/sendkey up shift
/return
Obviously enough, you'll have to make some changes. I just went and ripped from a few posts and macros to put that together - its a little messy. Well, okay, maybe not a little... but you should get the general idea.