Hey, thanks for this script, btw, there was a problem for me : The directions were incorrect (showing E when i was poiting to West, and W for east…)

You just have to replace :

local directions = {"N", "NE", "E", "SE", "S", "SW", "W", "NW", "N"}

by

local directions = {"N", "NW", "W", "SW", "S", "SE", "E", "NE", "N"}

Enjoy !