SRL Archive - SRL Archives

Flag & FFlag fixes, Get rid of the Stuck problem.


Naike

2009-04-01 10:04:37

I took the time to fix Flag & FFlag, as no one seems to do it..
(Adding a timer doesn't count ^^).

Changed: Theres a distance check, if the distance between player & flag
is the same after 230 millisecs, your stuck & it result true.


{*******************************************************************************
function Flag: Boolean;
By: PPLSUQBAWLZ/Odie533 modified by N1ke!
Description: Waits while flag exists.
*******************************************************************************}

function Flag: Boolean;
var
timeout, x, y, D, OldD: Integer;
begin
if (FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) then
begin
Result := True;
repeat
OldD := Distance(MMCX, MMCY, x + 1, y + 14);
Wait(230);
D := Distance(MMCX, MMCY, x + 1, y + 14);
if (SRL_Procs[srl_AntiBan] <> nil) then
SRL_Procs[srl_AntiBan]();
timeout := timeout + 1;
until (not FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) or (timeout > 300) or(D = OldD);
end;
end;


{*******************************************************************************
procedure FFlag(Distance: Integer);
By: Wizzup? / WT-Fakawi slightly modified by N1ke!
Description: Waits until Flag is within "Distance" distance or not moving.
*******************************************************************************}
function FFlag(Dist: Integer): boolean;
var
XK, YK, XL, YL, D, OldD, x, y: Integer;
var
T1, T2: Extended;
begin
Result := False;
T1 := GetTickCount;
repeat
if (not LoggedIn) then Exit;
T2 := GetTickCount;
Wait(230);
if FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2) Then
begin
D := Distance(MMCX, MMCY, x + 1, y + 14);
if (Dist > D)or(D = OldD) then
begin
Result := True;
Break;
end;
end;
OldD := Distance(MMCX, MMCY, x + 1, y + 14);
Wait(100);
if T2 - T1 > 30000 then
begin
Result := False;
if FindColor(XL, YL, 255, MMX1, MMY1, MMX2, MMY2) then
MFNF(XL, YL, 1, 1)
else
begin
Mouse(MMCX, MMCY, 0, 0, True);
end;
Exit;
end;
if Random(20) = 1 Then IdleTime(500, 1000, 0.01);
if (SRL_Procs[srl_AntiBan] <> nil) then
SRL_Procs[srl_AntiBan]();
until (not FindColor(XK, YK, 255, MMX1, MMY1, MMX2, MMY2));
end;

Sir R. M8gic1an

2009-04-01 10:13:11

hum… http://www.villavu.com/forum/showthread.php?t=43228

also, 230 ms might be too little.

edit: might as well just do this too:


Function Flag: boolean;
begin
Result := FFlag(0);
end;

~RM

lordsaturn

2009-04-01 12:32:10

Here's mine, works great.
procedure DFlag(FDist: integer);
var
dist, a, check: Integer;
begin
check := GetSystemTime;
while FlagPresent do
begin
dist := FlagDistance;
if (dist = 0) or (dist < FDist) then Exit;
a := GetSystemTime;
if GetSystemTime - check > 20000 then
begin
Mouse(MMCX, MMCY, 0, 0, True);
Exit;
end;
while dist = FlagDistance do
begin
if GetSystemTime - a > 1500 then
Exit;
Wait(10);
end;
if Random(30) = 1 Then IdleTime(500, 1000, 0.01);
end;
end;

Naum

2009-04-01 12:40:36

Hey Lordsaturn, do you mind if I use that?

lordsaturn

2009-04-01 13:10:50

Go for it, creds please :)

JPHamlett

2009-04-01 18:01:36

From: lordsaturn
Here's mine, works great.
procedure DFlag(FDist: integer);
var
dist, a, check: Integer;
begin
check := GetSystemTime;
while FlagPresent do
begin
dist := FlagDistance;
if (dist = 0) or (dist < FDist) then Exit;
a := GetSystemTime;
if GetSystemTime - check > 20000 then
begin
Mouse(MMCX, MMCY, 0, 0, True);
Exit;
end;
while dist = FlagDistance do
begin
if GetSystemTime - a > 1500 then
Exit;
Wait(10);
end;
if Random(30) = 1 Then IdleTime(500, 1000, 0.01);
end;
end;


do i put tht instead of my flag file on srl or how do i use it

Cazax

2009-04-01 18:02:13

We should also have a 'loading please wait' finder:
If GetColor(18, 12) = 0 Then 
Wait(800 + Random(250));

JPHamlett

2009-04-01 18:18:02

From: Cazax
We should also have a 'loading please wait' finder:
If GetColor(18, 12) = 0 Then 
Wait(800 + Random(250));


y it waits anyways

mormonman

2009-04-01 18:22:51

hmm…

MarkTime(Start);
While GetColor(18, 12) = 0 Then
Begin
If (TimeFromMark(Start) > 10000) Then Break;
Wait(250);
End;

lordsaturn

2009-04-01 19:26:52

procedure DFlag(FDist: integer);
var
dist, a, check: Integer;
begin
check := GetSystemTime;
while FlagPresent do
begin
dist := FlagDistance;
if (dist = 0) or (dist < FDist) then Exit;
a := GetSystemTime;
if GetSystemTime - check > 20000 then
begin
Mouse(MMCX, MMCY, 0, 0, True);
Exit;
end;
while dist = FlagDistance do
begin
if GetSystemTime - a > 1500 then
if GetColor(18, 12) > 0 then
Exit;
Wait(10);
end;
if Random(30) = 1 Then IdleTime(500, 1000, 0.01);
end;
end;
Thanks cazax.

Nava2

2009-04-01 19:41:17

http://www.villavu.com/forum/showthread.php?p=545200

Please post suggestions here, just trying to organize it all! :)

Tniffoc

2009-04-01 20:36:15

From: Rasta Magician
hum… http://www.villavu.com/forum/showthread.php?t=43228

also, 230 ms might be too little.

edit: might as well just do this too:


Function Flag: boolean;
begin
Result := FFlag(0);
end;

~RM

My fix was sort of temporary. It didn't have a distance checker, just a timer.

EDIT: 500th post.

Ogre

2009-04-03 18:25:31

EDIT: Stupid mistake.