Code: Select all
#turbo 2
#define CombinerPack v97
#define IngredSize v98
#chat tell
Sub Main
/press ctrl
/press alt
/press shift
/varset IngredSize 0
/call AddIngred "celestial solvent" | List of ingredients. The AddIngred
/call AddIngred "the scent of marr" | subroutine automatically sets the index.
/call FindCombiner "mortar and pestle" | Name of the container to combine in.
| It's highly recommented to put the combine
| container in slot 7.
/echo $CombinerPack
:RunMake
/press shift
/sendkey down ctrl
/delay 5
/for v99 0 to $v90
/if $pack($p0,empty)==FALSE {
/call ClearPack
/press shift
/sendkey down ctrl
}
/call ClearCursor
/finditem "$a(0,$v99)"
/delay 5
/if $find()==FALSE {
/goto :Done
}
/click left pack $CombinerPack $v99
/delay 5
/next v99
/click left pack $CombinerPack combine
/doevents
/goto :RunMake
:Done
/return
Sub ClearCursor
:Start
/if $cursor()!=NULL {
/click left auto
/delay 5
}
/delay 0
/if $cursor()!=NULL /goto :Start
/return
Sub ClearPack
/call ClearCursor
/if $pack($p0,empty)==TRUE /goto :Finished
:ReClear
/press ctrl
/sendkey down shift
/varcalc v50 $pack($p0,slots)-1
/delay 5
/for v99 0 to $v50
/click left pack $p0 $v99
/delay 5
/call ClearCursor
/next v99
/if $pack($p0,empty)==FALSE /goto :ReClear
:Finished
/return
Sub AddIngred
/varset v90 $IngredSize
/varset a(0,$IngredSize) "$p0"
/varcalc IngredSize $IngredSize+1
/echo $p0
/return
Sub FindCombiner
/varset CombinerPack 99
/for v99 0 to 7
/if "$pack($v99,name)"=="$p0" /varset CombinerPack $v99
/next v99
/if $CombinerPack==99 {
/echo No container named "$p0" found.
/endmacro
}
/return $CombinerPack
Sub Event_Chat
/endmacro
/returnRun-time Error '5':
Invalid procedure or call argument
Any idea what is wrong? Is it something wrong with my macro or the editor?
edit: Valerian likes code brackets.

