$${
if(cana);
log("&b[&3Macro&b] &aCana &4&lOFF");
unset(cana);
stop();
else;
set(cana);
log("&b[&3Macro&b] &aCana &2&lON");
&dir=%DIRECTION%;
ifmatches(%&dir%,N);&dir=NORTH;endif;
ifmatches(%&dir%,S);&dir=SOUTH;endif;
ifmatches(%&dir%,E);&dir=EAST;endif;
ifmatches(%&dir%,W);&dir=WEST;endif;
look(%&dir%);
do;
wait(10ms);
look(+50,0);
wait(100ms);
key(attack);
loop;
endif;
}$$