Another trouble with allocation
Posted: Fri Dec 07, 2007 12:00 pm
I wrote a simple script that scanns whole world for mobiles and restarts them.
And when the script was in about half of the way an allocation problem occured (POL097 was restarted minute earlier)
code:
I`m really troubled with this allocation problem so I search everywhere
And when the script was in about half of the way an allocation problem occured (POL097 was restarted minute earlier)
code:
Code: Select all
program resmobs(kto)
var list_realms_sp := {"britannia","ilshenar"};
foreach map in (list_realms_sp)
var i := 0;
for(i := -100; i <= 120; i:=i+20)
var x := 0;
var y := 0;
for(x:=50;x<=pobierz_wymiary(map)[1];x:=x+100)
for(y:=50;y<=pobierz_wymiary(map)[2];y:=y+100)
print("kolejna wspolrzedna: "+x+"/"+y+"/"+i+" mapa: "+cstr(map));
res(x,y,i,map);
sleepms(20);
endfor //y
endfor //x
endfor //z
endforeach
sendsysmessage(kto,"Zakonczono restartowanie mobow");
endprogram
function res(ax,ay,az,amap)
foreach wpis in (ListMobilesNearLocation( ax,ay,az, 55, cstr(amap) ))
sleepms(2);
if(wpis.npctemplate)
print("Restart moba: "+wpis.name);
RestartScript(wpis);
endif
sleepms(10);
endforeach
endfunction