Camaro'
2010-12-21 18:15:59
Please read this: Here
Thus the following….
Globals.simba
Walking_Color.simba
Please note the following:
-You must change MSI_LoadAllWalkInfo to the one I use in this version. I think its in setup.simba
-Added Varrock East Mine
-Remade Lumbridge West Swamp
-Added Varrock east oaks and trees
-Didn't really give much testing to anything in varrock, tested the LSW mine for one load.
-I tested east mining once but it failed because I think MSI_Flag failed :(
Thus the following….
Globals.simba
const
COLOR_ROAD_GENERAL = 6579821;
COLOR_ROAD_VARROCK = 8686729;
COLOR_ROAD_FALLY = 7831173;
COLOR_ROAD_LUMBY = 8225677;
COLOR_ROAD_DRAYNOR = 7171953;
COLOR_ROAD_DIRT = 1853272;
COLOR_BANKER = 1179390;
COLOR_WATER = 10850700;
COLOR_ROCK = 5789528;
COLOR_TREE = 1532978;
COLOR_SAND = 0;
COLOR_DB_BANK_FLOOR = 3026991; //darker part
COLOR_NPC = 195836;
COLOR_GE_FLOOR = 5600640;
COLOR_GE_PATH = 6720921;
COLOR_PS_PATH = 1324616; //Board walk
COLOR_PS_WILLOW_MM = 1063963;
COLOR_TREE_TRUNK_MM = 2046808; //Reg tree trunk
COLOR_VE_MINE = 2706300; //Rock
(**
* The different color walking points; used similar to reflection paths where
* instead of a TPointArray (or TTileArray), it's a TIntegerArray
*)
const
WALK_WC_VE_TREE_1 = 0;
WALK_WC_VE_TREE_2 = 1;
WALK_WC_VE_TREE_3 = 2;
WALK_WC_VE_OAKS_1 = 4;
WALK_WC_VE_OAKS_2 = 5;
WALK_WC_VE_BANK_1 = 6;
WALK_WC_VE_BANK_2 = 7;
WALK_WC_VE_BANK_3 = 8;
WALK_WC_DB_WILLOWS_1 = 10;
WALK_WC_DB_WILLOWS_BANK_1 = 11;
WALK_MINE_LSW_1 = 12;
WALK_MINE_LSW_2 = 13;
WALK_MINE_LSW_3 = 14;
WALK_MINE_LSW_4 = 15;
WALK_MINE_LSW_5 = 16;
WALK_MINE_LSW_6 = 17;
WALK_MINE_LSW_7 = 18;
WALK_MINE_LSW_8 = 19;
WALK_MINE_LSW_BANK_1 = 20;
WALK_MINE_LSW_BANK_2 = 21;
WALK_MINE_LSW_BANK_3 = 22;
WALK_MINE_LSW_BANK_4 = 23;
WALK_MINE_LSW_BANK_5 = 24;
WALK_MINE_LSW_BANK_6 = 25;
WALK_MINE_LSW_BANK_7 = 26;
WALK_FISH_DB_1 = 27;
WALK_FISH_DB_BANK_1 = 28;
WALK_WC_GE_YEW_1 = 29;
WALK_WC_GE_YEW_2 = 30;
WALK_WC_GE_YEW_3 = 31;
WALK_WC_GE_YEW_BANK_1 = 32;
WALK_WC_GE_YEW_BANK_2 = 33;
WALK_WC_GE_YEW_BANK_3 = 34;
WALK_WC_PS_WILLOW_1 = 35;
WALK_WC_PS_WILLOW_2 = 36;
WALK_WC_PS_WILLOW_BANK_1 = 37;
WALK_WC_PS_WILLOW_BANK_2 = 38;
WALK_VE_MINE_1 = 39;
WALK_VE_MINE_2 = 40;
WALK_VE_MINE_3 = 41;
WALK_VE_MINE_4 = 42;
WALK_VE_MINE_5 = 43;
WALK_VE_MINE_6 = 44;
WALK_VE_MINE_BANK_1 = 45;
WALK_VE_MINE_BANK_2 = 46;
WALK_VE_MINE_BANK_3 = 47;
WALK_VE_MINE_BANK_4 = 48;
(**
* All the different indexes for MSI_WalkInfo global variable; each index is
* used in MSI_WalkTPA by 3Garrett3 in Walking_Color.simba
*)
const
WALK_ARRAY_LENGTH = 50; // Change to the highest walk constant
Walking_Color.simba
{==============================================================================\
| MSI Group Scripting Include |
| Walking_Color.scar |
|==============================================================================|
| For all the walking functions that are color based. |
| This needs to be updated |
| * procedure MSI_Flag(); * by Coh3n |
| * function MSI_RemovePointsInBox(): TPointArray; * by Markus |
| * function MSI_CreateColorBox(): TBox; * by Blumblebee |
| * function MSI_SwitchGETrees: Boolean; * by Lordsaturn |
| * function MSI_WC_VEPoints(): TPoint; * by The MSI Team |
| * function MSI_WC_DBPoints(): TPoint; * by The MSI Team |
| * function MSI_WC_GEPoints(): TPoint; * by Camaro' |
| * function MSI_MINE_LSWPoints(): TPoint; * by Camaro' |
| * function MSI_CreateWalkIndex(): TPoint; * by The MSI Team |
| * 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 : function(Color, sRadial, eRadial, r, modX, modY, Tol: Integer): Boolean;
Failsafe : array of Integer;
end;
TWalkPointArray = array of TWalkPoint;
var
MSI_WalkPoints: array[0..WALK_ARRAY_LENGTH] of TWalkPoint;
function MSI_WalkFailSafe(Color, sRadial, eRadial, r, modX, modY, Tol: Integer): Boolean; forward;
procedure MSI_LoadWalkPoint(Index: Integer);
begin
case Index of
{ Varrock ======================================= ]
[=================================================== }
WALK_VE_MINE_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(682, 49);
Offsets := Point(0, 1);
Failsafe := [srl_VarrockRoadColor, 45, 90, 55, 4, 4, 25];
end;
WALK_VE_MINE_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(687, 83);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 75, 105, 65, 4, 4, 25];
end;
WALK_VE_MINE_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(653, 145);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 150, 170, 65, 4, 4, 25];
end;
WALK_VE_MINE_4:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(638, 153);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 160, 180, 65, 4, 4, 25];
end;
WALK_VE_MINE_5:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(637, 138);
Offsets := Point(-7, 14);
Failsafe := [srl_VarrockRoadColor, 165, 185, 55, 4, 4, 25];
end;
WALK_VE_MINE_6:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(609, 132);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 190, 220, 65, 4, 4, 25];
end;
WALK_VE_MINE_BANK_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
BlindPT := Point(651, 21);
end;
WALK_VE_MINE_BANK_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(632, 16);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 350, 10, 65, 4, 4, 25];
end;
WALK_VE_MINE_BANK_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(632, 16);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 350, 10, 65, 4, 4, 25];
end;
WALK_VE_MINE_BANK_4:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east mine';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(608, 21);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 345, 10, 65, 4, 4, 25];
end;
WALK_WC_VE_OAKS_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east oaks';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(682, 49);
Offsets := Point(0, 1);
Failsafe := [srl_VarrockRoadColor, 45, 90, 55, 4, 4, 25];
end;
WALK_WC_VE_OAKS_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east oaks';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(687, 83);
Offsets := Point(0, 0);
Failsafe := [srl_VarrockRoadColor, 75, 105, 65, 4, 4, 25];
end;
WALK_WC_VE_TREE_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east trees';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(682, 49);
Offsets := Point(0, 1);
Failsafe := [srl_VarrockRoadColor, 45, 90, 55, 4, 4, 25];
end;
WALK_WC_VE_TREE_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east trees';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(687, 83);
Offsets := Point(0, -22);
Failsafe := [srl_VarrockRoadColor, 75, 105, 65, 4, 4, 25];
end;
WALK_WC_VE_TREE_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east trees';
Color := COLOR_TREE_TRUNK_MM;
Tolerance := 20;
SortFrom := Point(620, 24);
Offsets := Point(7, 0);
Failsafe := [COLOR_TREE_TRUNK_MM, 0, 35, 65, 2, 1, 20];
end;
WALK_WC_VE_BANK_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east bank';
Color := COLOR_TREE_TRUNK_MM;
Tolerance := 20;
SortFrom := Point(634, 155);
Offsets := Point(0, 0);
Failsafe := [COLOR_TREE_TRUNK_MM, 350, 20, 65, 2, 1, 20];
end;
WALK_WC_VE_BANK_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east trees';
Color := srl_VarrockRoadColor;
Tolerance := 25;
SortFrom := Point(566, 101);
Offsets := Point(1, 0);
Failsafe := [srl_VarrockRoadColor, 250, 280, 65, 4, 4, 25];
end;
WALK_WC_VE_BANK_3:
with MSI_WalkPoints[Index] do
begin
Name := 'Varrock east trees';
Color := COLOR_NPC;
Tolerance := 20;
SortFrom := Point(594, 125);
Offsets := Point(0, -5);
Failsafe := [COLOR_NPC, 190, 230, 65, 4, 4, 25];
end;
{ 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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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(622, 151);
Offsets := Point(5, -3);
Failsafe := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [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 := [0, 0, 0, 0, 0, 0, 0];
end;
WALK_WC_DB_WILLOWS_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Draynor Willows';
BlindPT := Point(RandomRange(595, 613), RandomRange(113, 130));
end;
WALK_WC_DB_WILLOWS_BANK_1:
with MSI_WalkPoints[Index] do
begin
Name := 'Draynor Willows';
BlindPT := Point(RandomRange(645, 656), RandomRange(44, 53));
end;
{ Port Sarim ======================================= ]
[=================================================== }
WALK_WC_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 := [0, 0, 0, 0, 0, 0, 0];
end;
WALK_WC_PS_WILLOW_2:
with MSI_WalkPoints[Index] do
begin
Name := 'Port sarim willows';
Color := COLOR_PS_WILLOW_MM;
Tolerance := 20;
SortFrom := Point(639, 72);
Offsets := Point(4, 4);
Failsafe := [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 := [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 := [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;
{******************************************************************************}
{ 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_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_WalkFailsafe(.....: Integer): Boolean; }
{ By: The MSI Team }
{ Date: 21 December 2010 }
{ Description: Uses radial walking if MSI_WalkToColorPoint fails }
{******************************************************************************}
function MSI_WalkFailSafe(Color, sRadial, eRadial, r, modX, modY, Tol: Integer): Boolean;
begin
MSI_AddHeader('MSI_WalkFailsafe');
if RadialWalkTolerance(Color, sRadial, eRadial, r, modX, modY, Tol) then
begin
Result := True;
MSI_CloseHeader('MSI_WalkFailsafe'+BoolToStr(Result));
Exit;
end;
MSI_Debug('Failed walking with a failsafe');
MSI_CloseHeader('MSI_WalkFailsafe'+BoolToStr(Result));
end;
{
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.
}
{******************************************************************************}
{ function MSI_GetMMPoint(WalkPoint: Integer): TPoint; }
{ By: Camaro', RM, Markus }
{ Date: 17 December 2010 }
{ Description: Loads and gets a TPoint of where to walk. }
{******************************************************************************}
function MSI_GetMMPoint(WalkPoint: Integer): TPoint;
var
TPA: TPointArray;
I : Integer;
Bool : Boolean;
begin
if (MSI_WalkPoints[WalkPoint].BlindPT.X > 1) then
begin
Result := MSI_WalkPoints[WalkPoint].BlindPT;
Exit;
end;
Bool := True;
if (WalkPoint = WALK_WC_GE_YEW_BANK_1) then
begin
Bool := False;
if (MSI_SwitchGETrees) then
Bool := True;
end;
if (not(Bool)) then
Exit;
FindColorsSpiralTolerance(MSI_WalkPoints[WalkPoint].SortFrom.X, MSI_WalkPoints[WalkPoint].SortFrom.Y, TPA, MSI_WalkPoints[WalkPoint].Color, MMX1, MMY1, MMX2, MMy2, MSI_WalkPoints[WalkPoint].Tolerance);
for I := 0 to High(TPA) do
begin
if not RS_onMinimap(TPA[I].X + MSI_WalkPoints[WalkPoint].Offsets.X, TPA[I].Y + MSI_WalkPoints[WalkPoint].Offsets.Y) then
Continue;
Result := Point(TPA[I].X + MSI_WalkPoints[WalkPoint].Offsets.X, TPA[I].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(WalkPoint);
if (p.x = -1) then
begin
if (MSI_WalkFailSafe(MSI_WalkPoints[WalkPoint].Failsafe[0], MSI_WalkPoints[WalkPoint].Failsafe[1], MSI_WalkPoints[WalkPoint].Failsafe[2], MSI_WalkPoints[WalkPoint].Failsafe[3], MSI_WalkPoints[WalkPoint].Failsafe[4], MSI_WalkPoints[WalkPoint].Failsafe[5], MSI_WalkPoints[WalkPoint].Failsafe[6])) then
begin
MSI_Flag;
Result := True;
Exit;
end;
end;
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_WalkToColorPoint: Failed to walk to, index: ' +
IntToStr(WalkPoint) + '; not on the minimap');
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_WalkToColorPoint(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;
Please note the following:
-You must change MSI_LoadAllWalkInfo to the one I use in this version. I think its in setup.simba
-Added Varrock East Mine
-Remade Lumbridge West Swamp
-Added Varrock east oaks and trees
-Didn't really give much testing to anything in varrock, tested the LSW mine for one load.
-I tested east mining once but it failed because I think MSI_Flag failed :(