convert bin/lapis to lua