here is a little bit faster script
NPC Code:
// NPC made by screen_name
if (created) {
this.x=0;
this.y=0;
timeout=.05; }
if (timeout) {
if (this.x<64) {
for (i=0; i<=3; i++) {
if (tiles[this.x+i,this.y]==9) {
putnpc treeimage,textfile,this.x-1+i,this.y; } }
for (i=0; i<=3; i++) {
if (tiles[this.x+i,this.y+1]==9) {
putnpc treeimage,textfile,this.x-1+i,this.y+1; } }
for (i=0; i<=3; i++) {
if (tiles[this.x+i,this.y+2]==9) {
putnpc treeimage,textfile,this.x-1+i,this.y+2; } }
for (i=0; i<=3; i++) {
if (tiles[this.x+i,this.y+3]==9) {
putnpc treeimage,textfile,this.x-1+i,this.y+3; } }
this.x+=4; } else if (this.x==64) {
this.y+=4;
this.x=0; }
timeout=.05; }