Fixed the OpenWorldScreen.
I shorten, made it faster and more basic.
No need to over do something that FindColors can handle..
New OpenWorldScreen
SCAR Code:
Function OpenWorldScreen: Boolean;
var
X, Y, iTime: Integer;
begin
Result := WorldScreen;
if Result then
Exit;
if not RSReady then
begin
srl_Warn('OpenWorldScreen', 'not start screen', -2);
exit;
end;
If FindColor(x, y, 13158, 342, 235, 425, 262) or
FindColor(x, y, 16777215, 342, 235, 425, 262)then
begin
MouseBox(348, 239, 415, 245, 1);
iTime := GetTimeRunning + 10000;
while (not Result) do
begin
if GetTimeRunning > iTime then Exit;
Wait(RandomRange(75, 300));
Result := WorldScreen;
end;
end;
end;
Old one
SCAR Code:
{*******************************************************************************
function OpenWorldScreen: Boolean;
by: Nava2
Description: Opens the world screen. Returns true if world screen is opened.
*******************************************************************************}
function OpenWorldScreen: Boolean;
var
TPA: array [0..1] of TPointArray;
W, TheDC, iTime: Integer;
Box: TBox;
begin
Result := WorldScreen;
if Result then Exit;
if not RSReady then
begin
srl_Warn('OpenWorldScreen', 'not start screen', -2);
exit;
end;
W := BitmapFromString(17, 13, 'beNpjYKAb+I8ESBXBNAfTcDwK' +
'CGrBVIPmDEz15GlB1oWVgSfokBUQ1EKM8whqwRV0eIIRv5OIBQByA' +
'K1T');
TheDC := GetTargetDC;
SetTargetDC(GetBitmapDc(w));
FindColorsTolerance(TPA[0], clWhite, 0, 0, 17, 13, 0);
SetTargetDC(TheDC);
FindColorsTolerance(TPA[1], 13158, 305, 239, 368, 272, 3);
if FindTPAinTPA(TPA[0], TPA[1], TPA[0]) then
begin
Box := GetTPABounds(TPA[0]);
Box := IntToBox(Box.x1, Box.y1, Box.x1 + 82, Box.y2);
MouseBox(Box.x1, Box.y1, Box.x2, Box.y2, 1);
iTime := GetTimeRunning + 10000;
while not Result do
begin
if GetTimeRunning > iTime then Exit;
Wait(RandomRange(40, 80));
Result := WorldScreen;
end;
end;
end;