Thank you so much @crazyarashi I just modified a bit of the script on dispbottom for steps checking and continuous attack. I am adding the detachrid inside the for loop before that's why I am not getting it right.
- script test_bot -1,{
OnInit:
bindatcmd "testsc",strnpcinfo(3) + "::OnAtcommand";
end;
OnAtcommand:
if (getgroupid() > 90) {
getmapxy(.@m$,.@x0,.@y0,BL_PC);
.@plusx = .@x0 + 5;
.@plusy = .@y0 + 5;
.@minx = .@x0 - 5;
.@miny = .@y0 - 5;
dispbottom .@m$ + " " + .@x0 + " " + .@y0;
.@num = getareaunits(BL_MOB,.@m$,.@plusx,.@plusy,.@minx,.@miny,.@array[0]);
dispbottom "1";
.@gid = getcharid(3);
.@cid = getcharid(0);
detachrid;
dispbottom "the number of Monsters in Prontera in that Coordinates is " + .@num + " .",0x00FF00,.@cid;
dispbottom "list of Monsters GID :",0x00FF00,.@cid;
freeloop(1); // for if the list was too big.
for(.@i=0;.@i<getarraysize(.@array);.@i++) {
dispbottom (.@i + 1) + " " + .@array[.@i],0x00FF00,.@cid;
//unitskilluseid getcharid(3),"WL_JACKFROST",5,getcharid(3),-4;
unitattack .@gid,.@array[.@i],1;
}
freeloop(0);
dispbottom "end",0x00FF00,.@cid;
end;
} else {
dispbottom "Currently for testing only.";
end;
}
}