``` o sub ; Move tool carousel best direction to pocket P ; Parameter #5170 is used to track the current tool pocket (persistently) O110 if [#5171 NE 1] M13 O110 endif # = [#5170 - #

] (print, o P#

, steps=#) o1000 if [# GT 6] #=[# - 12] o1000 endif o1001 if [# LT -6] #=[# + 12] o1001 endif o1003 if [# GT 0] M12 P[#] o1003 elseif [# LT 0] #=[# * -1] M11 P[#] o1003 endif o endsub [1] M2