SRL Archive - SRL Archives

MouseWaitFF...


pwnaz0r

2007-10-21 16:09:44

Well, I made this function for my newest script. I hated having to mess with MFNF, etc because they don't really solve the problem if the flag is not on Minimap. Thus, I made this. Basically, it will wait a maximum of 7 seconds (b/c if they are walking) to wait for flag, but will break out of this is the flag is found. then it will wait until you get to the flag. i also made it so if you character gets stuck, like if the flag stays in the same postition the whole time, it will click on the flag again if possible.


function InMiniMap(ax, ay: integer): boolean;
begin
result:= ((ax >= MMX1) and (ax <= MMX2) and (ay >= MMY1) and (ay <= MMY2));
end;

function MouseWaitFF(ax, ay, rx, ry: integer): boolean;
var
FMark, cx, cy, lx, ly, i: integer;
begin
Flag; // <-- To Stop current Flag.
wait(200+ random(150));
if not InMiniMap(ax, ay) then
begin
Writeln('Point not in MiniMap');
exit;
end;
Mouse(ax, ay, rx, ry, true);
lx:= 0;
ly:= 0;
MarkTime(FMark);
repeat
wait(10);
until((FlagPresent) or (TimeFromMark(FMark) >= 7000));
if not (FlagPresent) then
begin
Writeln('Error finding flag');
exit;
end else
Writeln('Flag Found!');
for i:= 0 to (FlagDistance * 2) do
begin
inc(i);
wait(50);
if not FindColor(cx, cy, 255, MMX1, MMY1, MMX2, MMY2) then break;
if ((i mod 10) = 0)then
begin
if (lx = cx) or (ly = cy) then
begin
Writeln('Flag has stopped');
if FindColor(lx, ly, 255, MMX1, MMY1, MMX2, MMY2) then
MouseWaitFF(lx, ly, rx, ry);
end else
begin
lx:= cx;
ly:= cy;
end;
end;
end;
result:= true;
end;

Bobarkinator

2007-10-21 17:19:33

Quick suggestions:

FFlag(0); I think works better than flag, just because

rs_OnMinimap(x,y);, I think you can figure that out ;)

pwnaz0r

2007-10-21 18:10:30

From: Bobarkinator
Quick suggestions:

FFlag(0); I think works better than flag, just because

rs_OnMinimap(x,y);, I think you can figure that out ;)


I know about rs_onminimap, it didn't work for me though because whenever you click off the exact minimap, it results false, and that is the purpose of this function..

you can click off the minimap and still move as long as it is in that box, you just can't see the flag.