Awkwardsaw
2010-07-30 10:17:26
it doesnt seem to be working. here is my function:
my problem is that after the script clicks the last tile, it breaks out of the loop like its suposed to, and when it gets to r_fflag, it just skips it and says "finished walking path"
function A_WalkPath : Boolean;
var
temppath : TTileArray;
i, c : Integer;
tp, ntp : TPoint;
begin
case CheckLoc of
LOC_TANNER : temppath := tantobank;
LOC_BANK : temppath := banktotan;
LOC_LOST :
begin
writeln('player is lost, D:');
exit;
end;
end;
checkrest;
for i := 0 to high(temppath) do
begin
tp := TileToMM(temppath[i]);
if i < high(temppath) then
begin
ntp := TileToMM(temppath[i + 1]);
if rs_OnMinimap(ntp.x, ntp.y) then
continue;
end;
if not rs_OnMinimap(tp.x, tp.y) then
begin
debug('tile not on map: ' + inttostr(i));
continue;
end;
mouse(tp.x, tp.y, 1, 1, true);
if i < high(temppath) then
begin
ntp := TileToMM(temppath[i + 1]);
while not rs_OnMinimap(ntp.x, ntp.y) do
begin
ntp := TileToMM(temppath[i + 1]);
wait(100 + random(50));
r_findrandoms;
inc(c);
if c > 500 then
begin
result := false;
debug('took to long to walk, exiting');
exit;
end;
if not ismoving then continue;
end;
end;
end;
//while ismoving do wait(1 + random(3));
r_fflag(0); //this is where it messes up
wait(600 + random(600)); //if r_fflag actually gets to the last tile, it still needs to wait
debug('finished walking path');
result := true;
end; my problem is that after the script clicks the last tile, it breaks out of the loop like its suposed to, and when it gets to r_fflag, it just skips it and says "finished walking path"