I'm 100% both should have the same offsets.
On another note:
I rewrote LSW(Haven't tested):
Heres what I have, does
not compile as of now. Please sweeten her up someone. I would of gone more, but I'm starting to get confused :p
Some conventions may be wrong. Iono :confused:
Edit: Oh no… I hope I did the LoadPoints function correct :p
{==============================================================================\
| MSI Group Scripting Include |
| Walking_Color.scar |
|==============================================================================|
| For all the walking functions that are color based. |
| |
| * function MSI_LoadWalkInfo(); * by Coh3n |
| * procedure MSI_LoadAllWalkInfo; * by Coh3n |
| * procedure MSI_Flag(); * by Coh3n |
| * procedure MSI_SortColors(); * by Blumblebee |
| * function MSI_RemovePointsInBox(): TPointArray; * by Markus |
| * function MSI_CreateColorBox(): TBox; * by Blumblebee |
| * function MSI_FindColorInBox(): Boolean; * by Blumblebee |
| * function MSI_InLWSMine: Boolean; * by Camaro' |
| * function MSI_SwitchGETrees: Boolean; * by Lordsaturn |
| * function MSI_WalkToColorIndex(): Boolean; * by Coh3n |
| * function MSI_CreateWalkFailsafe(): Boolean; * by Blumblebee & NCDS |
| * function MSI_LoadColorPath(): TIntegerArray; * by Coh3n |
| * function MSI_ColorWalk(): Boolean; * by Coh3n |
| * function MSI_IsWorldMapUp: Boolean; * by Zyt3x |
| * function MSI_CloseWorldMap: Boolean; * by Zyt3x |
| * function MSI_OpenWorldMan: Boolean; * by Zyt3x |
\_____________________________________________________________________________}
type
TWalkPoint = record
Name : string;
Color : Integer;
Tolerance : Integer;
SortFrom : TPoint;
Offsets : TPoint;
BlindPT : TPoint;
Failsafe : array of function(Color, sRadial, eRadial, r, modX, modY, Tol: Integer): Boolean;
end;
TWalkPointArray = array of TWalkInfo;
var
MSI_WalkPoints: array[0..WALK_ARRAY_LENGTH] of TWalkInfo;
procedure MSI_LoadWalkPoint(Index: Integer);
begin
case Index of
{ Grand Exchange =================================== ]
[=================================================== }
WALK_WC_GE_YEW_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Grand Exchange Yews';
Color := Color_GE_Floor;
Tolerance := 20;
SortFrom := Point(697, 81);
Offsets := Point(-5, RandomRange(-3, 3));
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_GE_YEW_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Grand Exchange Yews';
Color := Color_GE_Floor;
Tolerance := 20;
SortFrom := Point(683, 47);
Offsets := Point(2, 2);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_GE_YEW_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Grand Exchange Yews';
Color := Color_GE_Floor;
Tolerance := 20;
SortFrom := Point(672, 64);
Offsets := Point(0, -6);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_GE_YEW_BANK_1:
with MSI_WalkPoints[Index] do
begin
//if not (MSI_Players[CurrentPlayer].Scripts[CurrentScript].LeftTree) then
//if (MSI_SwitchGETrees) then
Name := 'Grand Exchange Yews';
Color := Color_GE_Floor;
Tolerance := 20;
SortFrom := Point(579, 134);
Offsets := Point(0, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_GE_YEW_BANK_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Grand Exchange Yews';
Color := Color_GE_Floor;
Tolerance := 20;
SortFrom := Point(575, 98);
Offsets := Point(-3, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_GE_YEW_BANK_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Grand Exchange Yews';
Color := 329453;
Tolerance := 20;
SortFrom := Point(564, 86);
Offsets := Point(5, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
{ Lumbridge West =================================== ]
[=================================================== }
WALK_MINE_LSW_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := COLOR_ROAD_DRAYNOR;
Tolerance := 25;
SortFrom := Point(685, 116);
Offsets := Point(RandomRange(-3, 3), RandomRange(-3, 3));
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := COLOR_ROAD_DRAYNOR;
Tolerance := 25;
SortFrom := Point(660, 139);
Offsets := Point(RandomRange(-3, 3), RandomRange(-3, 3));
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
BlindPT := Point(671, 136);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_4:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(679, 128);
Offsets := Point(4, -2);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_5:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(637, 153);
Offsets := Point(6, -1);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_6:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(640, 151);
Offsets := Point(6, -1);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_7:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(641, 151);
Offsets := Point(6, -1);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_8:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(633, 151);
Offsets := Point(8, -3);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_BANK_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(624, 21);
Offsets := Point(7, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_BANK_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(616, 20);
Offsets := Point(6, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_BANK_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(620, 21);
Offsets := Point(6, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_BANK_4:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(577, 44);
Offsets := Point(2, -5);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_BANK_5:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := COLOR_ROAD_DRAYNOR;
Tolerance := 25;
SortFrom := Point(588, 29);
Offsets := Point(3, 1);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_BANK_6:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := COLOR_ROAD_DRAYNOR;
Tolerance := 25;
SortFrom := Point(596, 30);
Offsets := Point(1, -3);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_MINE_LSW_BANK_7:
with MSI_WalkPoints[Index] do
begin
Name := 'Lumbridge West Swamp';
Color := COLOR_DB_BANK_FLOOR;
Tolerance := 20;
SortFrom := Point(578, 59);
Offsets := Point(2, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
{ Draynor ========================================== ]
[=================================================== }
WALK_FISH_DB_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Draynor Fish';
Color := Color_Water;
Tolerance := 25;
SortFrom := Point(612, 140);
Offsets := Point(4, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_FISH_DB_BANK_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Draynor Fish';
Color := Color_NPC;
Tolerance := 20;
SortFrom := Point(649, 24);
Offsets := Point(5, 4);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_DB_WILLOWS_1:
begin
Name := 'Draynor Willows';
BlindPT := Point(RandomRange(595, 613), RandomRange(113, 130));
end;
WALK_WC_DB_WILLOWS_BANK_1:
begin
Name := 'Draynor Willows';
BlindPT := Point(RandomRange(645, 656), RandomRange(44, 53));
end;
{ Port Sarim ======================================= ]
[=================================================== }
WALK_PS_WILLOW_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim willows';
Color := Color_PS_Path;
Tolerance := 20;
SortFrom := Point(662, 30);
Offsets := Point(8, -3);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_PS_WILLOW_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim willows';
Color := Color_Willow_MM;
Tolerance := 20;
SortFrom := Point(639, 72);
Offsets := Point(4, 4);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_WILLOW_BANK_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim willows';
Color := Color_PS_PATH;
Tolerance := 20;
SortFrom := Point(585, 115);
Offsets := Point(0, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_WILLOW_BANK_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim willows';
Color := Color_PS_PATH;
Tolerance := 20;
SortFrom := Point(628, 140);
Offsets := Point(-5, -5);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_YEW_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim yews';
Color := Color_PS_Path;
Tolerance := 20;
SortFrom := Point(662, 30);
Offsets := Point(8, -3);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_YEW_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim yews';
Color := Color_Tree_Trunk;
Tolerance := 20;
SortFrom := Point(599, 19);
Offsets := Point(RandomRange(-5, 5), 5);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_YEW_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim yews';
Color := Color_Tree_Symbol;
Tolerance := 20;
SortFrom := Point(MMCX, MMCY);
Offsets := Point(2, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_YEW_BANK_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim yews';
Color := Color_Red_Door;
Tolerance := 20;
SortFrom := Point(625, 131);
Offsets := Point(0, -2);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_YEW_BANK_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim yews';
Color := Color_PS_Path;
Tolerance := 20;
SortFrom := Point(628, 151);
Offsets := Point(-4, 4);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
WALK_WC_PS_YEW_BANK_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim yews';
Color := Color_PS_Path;
Tolerance := 20;
SortFrom := Point(616, 129);
Offsets := Point(-3, 0);
//Failsafe := @NoFailsafe(0, 0, 0, 0, 0, 0, 0);
end;
end;
end;
{******************************************************************************}
{ procedure MSI_LoadAllWalkPoints(); }
{ By: Coh3n }
{ Date: 17 December 2010 }
{ Description: Loads all walking points. }
{******************************************************************************}
procedure MSI_LoadAllWalkPoints();
var
i: Integer;
begin
for i := 0 to High(MSI_WalkPoints) do
MSI_LoadWalkPoint(i);
end;
{******************************************************************************}
{ function MSI_GetMMPoint(WalkPoint: Integer): TPoint; }
{ By: Camaro' }
{ Date: 17 December 2010 }
{ Description: Loads and gets a TPoint of where to walk. }
{******************************************************************************}
function MSI_GetMMPoint(WalkPoint: Integer): TPoint;
begin
MSI_LoadWalkPoint(WalkPoint);
if (MSI_WalkPoints[WalkPoint].BlindPT.X > 1) then
begin
Result := MSI_WalkPoints[WalkPoint].BlindPT;
Exit;
end;
FindColorsSpiralTolerance(MMCX, MMCY, TPA, MSI_WalkPoints[WalkPoint].Color, MMX1, MMY1, MMX2, MMy2, MSI_WalkPoints[WalkPoint].Tolerance);
SortTPAFrom(TPA, MSI_WalkPoints[WalkPoint].SortFrom);
for I := 0 to High(TPA) do
begin
X := TPA[I].x;
Y := TPA[I].y;
if not RS_onMinimap(X + MSI_WalkPoints[WalkPoint].Offsets.X, Y + MSI_WalkPoints[WalkPoint].Offsets.Y) then
Continue;
Result := Point(X + MSI_WalkPoints[WalkPoint].Offsets.X, Y + MSI_WalkPoints[WalkPoint].Offsets.Y);
Break;
end;
end;
{******************************************************************************}
{ function MSI_WalkToColorPoint(WalkPoint: Integer): Boolean; }
{ By: The MSI Team }
{ Date: 17 December 2010 }
{ Description: Walked to a point specified by 'WalkPoint' on the minimap }
{******************************************************************************}
function MSI_WalkToColorPoint(WalkPoint: Integer): Boolean;
var
p: TPoint;
begin
p := MSI_GetMMPoint(index);
if (p.x = -1) then//Fit in failsafe here
Exit;
if (rs_OnMinimap(p.x, p.y)) then
begin
Mouse(p.x, p.y, 3, 3, True);
MSI_Flag;
Result := True;
end else
MSI_SubDebug('MSI_WalkToColorIndex: Failed to walk to, index: ' +
IntToStr(index) + '; not on the minimap');
end;
{******************************************************************************}
{ procedure MSI_Flag; }
{ By: Coh3n Edited by NCDS }
{ Date: 27 September 2010 }
{ Description: Waits while the flag is on the minimap. Will still work when }
{ walking around obstacles }
{******************************************************************************}
procedure MSI_Flag;
var
t: Integer;
begin
repeat
if (FindNPCChatText('erous', Nothing)) then // Only if total level < 60
begin
ClickContinue(True, True);
t := GetSystemTime + 5000;
while (GetSystemTime < t) do
begin
Wait(500 + Random(300));
if (FindNPCChatText('eave', ClickLeft)) then
Break;
end;
end;
Wait(RandomRange(200, 500));
t := (GetSystemTime + 12000);
if ((not FlagPresent) and (IsMoving)) then
begin
MSI_Antiban(RandomRange(300, 1000), ANTI_BAN_CHANCE);
Continue;
end;
MSI_FindRandoms;
MSI_AntiBan(RandomRange(200, 800), ANTI_BAN_CHANCE);
MSI_SubDebug('Flag distance: '+IntToStr(FlagDistance));
while (FlagDistance = -1) and (t < GetSystemTime) do
Wait(10);
if (FlagDistance <= TOLERANCE_FLAG) or (not IsMoving) then
Exit;
until((not (FlagPresent)) and (not (IsMoving))) or (t < GetSystemTime);
end;
{******************************************************************************}
{ function RemovePointsInBox(points: TPointArray; box: TBox): TPointArray; }
{ By: Markus }
{ Date: 05 November 2010 (Added) }
{ Description: Removes all points in tpa 'points' in a box specified by 'box' }
{ }
{******************************************************************************}
function MSI_RemovePointsInBox(points: TPointArray; box: TBox): TPointArray;
var
i, L, rescnt: Integer;
begin
L := GetArrayLength(points)-1
for i := 0 to L do
begin
if not PointInBox(points[i], box) then
begin
rescnt := rescnt + 1;
SetArrayLength(Result, rescnt);
Result[rescnt - 1] := points[i];
end;
end;
end;
{******************************************************************************}
{ function MSI_CreateColorBox(Color: Integer): TBox; }
{ By: Blumblebee }
{ Date: 10 June 2010 }
{ Description: Returns a box around the colors found }
{******************************************************************************}
function MSI_CreateColorBox(Color: Integer): TBox;
var
TPA: tPointArray;
begin
FindColors(TPA, Color, MMx1, MMy1, MMx2, MMy2);
if Length(TPA) <= 0 then Exit;
Result := GetTPABounds(TPA);
end;
{******************************************************************************}
{ function MSI_FindColorInBox(Color: Integer; Box: TBox): Boolean; }
{ By: Blumblebee }
{ Date: 10 June 2010 }
{ Description: Returns true if the color is found in a box }
{******************************************************************************}
function MSI_FindColorInBox(Color: Integer; Box: TBox): Boolean;
var
TPA: tPointArray;
i: Integer;
begin
FindColorsTolerance(TPA, Color, Box.x1-5, Box.y1-5, Box.x2+5, Box.y2+5, 15);
if Length(TPA) <= 0 then Exit;
SortTPAFrom(TPA, Point(687, 50));
for i := 0 to High(TPA) do
begin
if not rs_OnMiniMap(TPA[i].x, TPA[i].y) then continue;
Mouse(TPA[i].x, TPA[i].y, 5, 5, True);
Wait(750+random(450));
if FlagPresent then
begin
FFlag(10);
Result := True;
Exit;
end;
end;
end;
{******************************************************************************}
{ function MSI_InLWSMine: Boolean; }
{ By: Camaro' }
{ Date: October 30th 2010 }
{ Description: Determines if you are in the Lumbridge West Swamp Mine }
{******************************************************************************}
function MSI_InLWSMine: Boolean;
var
TPA1, TPA2, TPA: TPointArray;
X, Y, I, A: Integer;
ATPA : T2DPointArray;
TB: TBox;
begin
FindColorsTolerance(TPA1, 2640509, MMX1, MMY1, MMX2, MMY2, 20);
FindColorsTolerance(TPA2, 1588046, MMX1, MMY1, MMX2, MMY2, 20);
TPA := CombineTPA(TPA1, TPA2);
if (Length(TPA) < 1) then
begin
Result := False;
Writeln('Failed detecting the mine');
Exit;
end;
ATPA := TPAToATPAEx(TPA, 25, 25);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
A := High(ATPA);
for I := 0 to A do
begin
MiddleTPAEx(ATPA[I], X, Y);
TB := GetTPABounds(ATPA[I]);
if (TB.X2 - TB.X1 >= 18) and (TB.Y2 - TB.Y1 >= 18) then
begin
if (Distance(X, Y, MMCX, MMCY) < 25) then
begin
Result := True;
Exit;
end;
end;
end;
end;
{******************************************************************************}
{ function MSI_SwitchGETrees: Boolean; }
{ By: LordSaturn }
{ Date: 05 November 2010 }
{ Description: Switchs Trees at the Grand Exchange location }
{******************************************************************************}
function MSI_SwitchGETrees: Boolean;
var
c, d1, d2, mn: integer;
Pt: TPoint;
P: TPointArray;
s, s2: string;
begin
if not LoggedIn then Exit;
while not Result do
begin
Inc(c);
FindSymbols(P, 'tree');
P := MSI_RemovePointsInBox(P, inttobox(MMX1, MMCY+20, MMX2, MMY2));
if Length(P) <> 3 then Exit;
SortTPAFrom(P, Point(MMX1, MMY1));
d1 := Distance(MMCX, MMCY, P[0].x, P[0].y);
d2 := Distance(MMCX, MMCY, P[2].x, P[2].y);
mn := Min(d1, d2);
case mn of
d1: s := 'd1';
d2: s := 'd2';
end;
if c = 2 then
begin
Result := s2 <> s;
case MSI_Players[CurrentPlayer].Scripts[CurrentScript].LeftTree of
True: MSI_Players[CurrentPlayer].Scripts[CurrentScript].LeftTree := False;
False: MSI_Players[CurrentPlayer].Scripts[CurrentScript].LeftTree := True;
end;
Exit;
end;
s2 := s;
if mn = d2 then
begin
Pt := MiddleTPA([P[0], P[1]]);
IncEx(Pt.y, 8);
end else
Pt := Point(P[2].x-8, P[2].y+2);
Mouse(Pt.x, Pt.y, 2, 2, True);
MSI_Flag;
end;
end;
{******************************************************************************}
{ function MSI_CreateWalkFailsafe(index: Integer): Boolean; }
{ By: The MSI Team }
{ Date: 10 June 2010 }
{ Description: Uses radial walking if MSI_WalkToColorIndex fails }
{******************************************************************************}
function MSI_CreateWalkFailsafe(index: Integer): Boolean;
begin
try
MSI_AddHeader('MSI_CreateWalkFailsafe');
if not MSI_WalkToColorPoint(index) then
begin
case index of
WALK_WC_VE_TREE_1:
if not RadialWalkAutoColor(srl_VarrockRoadColor, 45, 90, 55, 4, 4) then
if not RadialWalkAutoColor(srl_RockColor, 45, 90, 70, 4, 4) then
begin
MSI_Debug('Failed to WALK_WC_VE_TREE_1');
Exit;
end;
WALK_WC_VE_TREE_2:
if not RadialWalkAutoColor(srl_VarrockRoadColor, 75, 105, 65, 4, 4) then
if not RadialWalkAutoColor(srl_VarrockRoadColor, 65, 115, 65, 4, 4) then
begin
MSI_Debug('Failed to WALK_WC_VE_TREE_2');
Exit;
end;
WALK_WC_VE_TREE_3:
if not RadialWalkAutoColor(srl_VarrockRoadColor, 0, 35, 65, 2, 1) then
if not RadialWalkAutoColor(srl_VarrockRoadColor, 345, 35, 60, 2, 2) then
if not RadialWalkAutoColor(srl_VarrockRoadColor, 0, 45, 65, 5, 5) then
if not RadialWalkAutoColor(srl_VarrockRoadColor, 60, 110, 70, 5, 5) then
begin
MSI_Debug('Failed to WALK_WC_VE_TREE_3');
Exit;
end;
WALK_WC_VE_TREE_4:
if not RadialWalkAutoColor(srl_TreeColor, 310, 350, 6, 2, 1) then
if not RadialWalkAutoColor(srl_TreeColor, 60, 100, 60, 2, 1) then //for if the player ends up in the museum
begin
MSI_Debug('Failed to WALK_WC_VE_TREE_3');
Exit;
end;
WALK_WC_VE_BANK_1:
if not RadialWalkAutoColor(srl_RockColor, 350, 50, 65, 5, 5) then
begin
MouseBox(631, 114, 667, 130, 1); // random co-ord clicking
Wait(RandomRange(1000, 2000));
MSI_Flag;
end else
begin
MSI_Debug('Failed to WALK_WC_VE_BANK_1');
Exit;
end;
WALK_WC_VE_BANK_2:
if not RadialWalkAutoColor(srl_VarrockRoadColor, 180, 200, 65, 4, 4) then
if not RadialWalkAutoColor(srl_VarrockRoadColor, 170, 220, 65, 4, 4) then
begin
MSI_Debug('Failed to WALK_WC_VE_BANK_2');
Exit;
end;
WALK_WC_VE_BANK_3:
if not RadialWalkAutoColor(srl_VarrockRoadColor, 255, 280, 70, 4, 4) then
if not RadialWalkAutoColor(srl_VarrockRoadColor, 245, 290, 70, 4, 4) then
begin
MSI_Debug('Failed to WALK_WC_VE_BANK_3');
Exit;
end;
WALK_WC_VE_BANK_4:
Exit; // add a DTM of Bankers here.
end;
end;
result := true;
finally
MSI_CloseHeader('MSI_CreateWalkFailsafe: ' + BoolToStr(result));
end;
end;
{******************************************************************************}
{ function MSI_LoadColorPath(sLoc, eLoc: Integer): TIntegerArray; }
{ By: Coh3n }
{ Date: 04 August 2010 }
{ Description: Loads the specified color walking path }
{******************************************************************************}
function MSI_LoadColorPath(sLoc, eLoc: Integer): TIntegerArray;
var
Script: TScript;
begin
Script := MSI_Scripts[MSI_Players[CurrentPlayer].Scripts[CurrentScript].Name];
if (sLoc = Script.PathInfo.StartLoc) then
Result := Script.PathInfo.ColorTo
else
if (sLoc = Script.PathInfo.EndLoc) then
Result := Script.PathInfo.ColorFrom;
end;
{******************************************************************************}
{ function MSI_ColorWalk(startLoc, endLoc: Integer): Boolean; }
{ By: Coh3n }
{ Date: 10 June 2010 }
{ Description: Walks from startLoc to endLoc }
{******************************************************************************}
function MSI_ColorWalk(startLoc, endLoc: Integer): Boolean;
var
i: Integer;
thePath: TIntegerArray;
begin
if (not LoggedIn) then
Exit;
try MSI_AddHeader('MSI_ColorWalk');
thePath := MSI_LoadColorPath(startLoc, endLoc);
for i := 0 to High(thePath) do
begin
if (not MSI_CreateWalkFailsafe(thePath[i])) then
begin
MSI_Players[CurrentPlayer].ReportInfo.FalseReason := 'Failed to walk to ' + MSI_Locations[endLoc].Name + ', index: ' + IntToStr(thePath[i]);
MSI_Players[CurrentPlayer].Location := LOC_LOST;
Exit;
end;
MSI_FindRandoms;
Result := (i = High(thePath));
end;
if (Result) then
begin
MSI_Players[CurrentPlayer].Location := endLoc;
Wait(RandomRange(750, 1500));
end;
finally
MSI_CloseHeader('MSI_ColorWalk: ' + BoolToStr(Result));
end;
end;
{******************************************************************************}
{ function MSI_IsWorldmapUp : Boolean; }
{ By: Zyt3x }
{ Date: 05 October 2010 }
{ Description: Returns true if the worldmap is showing. }
{******************************************************************************}
function MSI_IsWorldMapUp : Boolean;
var
tmp : string;
begin
Result := False;
if GetMMLevels('hp', tmp) = -1 then
Result := GetColor(268, 482) = 10066329;
// Grey pixel in the "." in "Search the map by typing here." text.
end;
{******************************************************************************}
{ function MSI_CloseWorldmap : Boolean; }
{ By: Zyt3x }
{ Date: 05 October 2010 }
{ Description: Returns true if the worldmap has been closed }
{******************************************************************************}
function MSI_CloseWorldMap : Boolean;
var
timeout : Integer;
begin
Result := not MSI_IsWorldmapUp;
if Result then Exit;
MouseBox(740, 10, 755, 25, 1);//clickLeft);
timeout := GetSystemTime + 20000;
while (GetSystemTime < timeout) do
begin
if not MSI_IsWorldmapUp then Break;
Wait(500+Random(500));
MSI_AntiBan(RandomRange(0, 3000), ANTI_BAN_CHANCE);
end;
Result := (not MSI_IsWorldmapUp);
end;
{******************************************************************************}
{ function MSI_IsWorldmapUp : Boolean; }
{ By: Zyt3x }
{ Date: 05 October 2010 }
{ Description: Returns true if the worldmap has been opened. }
{******************************************************************************}
function MSI_OpenWorldMap : Boolean;
var
timeout : Integer;
begin
Result := MSI_IsWorldmapUp;
if Result then Exit;
MouseBox(526, 124, 559, 157, 1);//clickLeft);
Wait(1500);
timeout := GetSystemTime + 20000;
while (GetSystemTime < timeout) do
begin
if GetColor(229, 195) <> 0 then Break;
Wait(500+Random(500));
MSI_AntiBan(RandomRange(0, 3000), ANTI_BAN_CHANCE);
end;
Result := MSI_IsWorldmapUp;
end;