Ok i have done it all now for VW Mine. (Still needs testing to insure it work flawlessly)
these are the full files (19/10/2010) areas where my code is is between the
//////////// MY CHANGES HERE ///////////////////////////
now for the files
Walking_Color.Simba
{==============================================================================\
| 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_FindMMLocation(): Boolean; * by marpis |
| * function MSI_AutoColorMM(): Integer; * by Blumblebee |
| * function MSI_AutoColor(): Integer; * by Coh3n |
| * function MSI_WalkTPA(): TPoint; * by 3Garrett3 |
| * function MSI_CreateWalkTPA(): TPointArray * by Blumblebee |
| * function MSI_WalkTPAPoint(): Boolean; * by Blumblebee |
| * function MSI_CreateColorBox(): TBox; * by Blumblebee |
| * function MSI_FindColorInBox(): Boolean; * by Blumblebee |
| * function MSI_WC_VEPoints(): TPoint; * by The MSI Team |
| * 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 |
\_____________________________________________________________________________}
//////////// MY CHANGES HERE ///////////////////////////
Function MyFindColor(What: string): integer; //on minimap(true) or main screen (false)
var
I, J, TheColor, Red, Green, Blue, color,
bL, bH, gL, gH, rL, rH, colTol: integer;
colorArray: TPointArray;
begin
case lowercase(What) of
'road': begin
color := 8817549;
bL := 129;
bH := 139;
gL := 134;
gH := 143;
rL := 136;
rH := 145;
colTol:= 7;
end;
'dirtroad': begin
color := 6720152;
bL := 97;
bH := 106;
gL := 133;
gH := 142;
rL := 147;
rH := 156;
colTol:= 7;
end;
'deadtree': begin
color := 1322306;
bL := 16;
bH := 23;
gL := 41;
gH := 49;
rL := 62;
rH := 70;
colTol:= 6;
end;
'mmrock': begin
color := 3167368;
bL := 44;
bH := 51;
gL := 79;
gH := 88;
rL := 131;
rH := 140;
colTol:= 7;
end;
end;
Result := 0;
FindColorsTolerance(colorArray, color, MMX1, MMY1, MMX2, MMY2, colTol)
J := High(colorArray);
for I := 0 to J do
if (rs_OnMinimap(colorArray[I].x, colorArray[I].y)) then
begin
TheColor := GetColor(colorArray[i].x, colorArray[i].y);
ColorToRGB(TheColor, Red, Green, Blue);
if (InRange(Blue, bL, bH) and InRange(Green, gL, gH) and InRange(Red, rL, rH)) then
begin
Result := TheColor;
//WriteLn(What + ' Colour Found: ' + IntToStr(TheColor));
Exit;
end;
end;
end;
//////////// MY CHANGES HERE ///////////////////////////
{******************************************************************************}
{ function MSI_LoadWalkInfo(WalkInfo: Integer): Boolean; }
{ By: The MSI Team }
{ Date: 11 September 2010 }
{ Description: Loads all the color walking info; should only be called in }
{ MSI_LoadAllWalkInfo }
{******************************************************************************}
function MSI_LoadWalkInfo(WalkInfo: Integer): Boolean;
begin
case WalkInfo of
WALK_VE_MINE_1:
begin
end;
WALK_VE_MINE_2:
begin
end;
end;
Result := (MSI_ColorAreas[WalkInfo].Name <> '');
end;
{******************************************************************************}
{ procedure MSI_LoadAllWalkInfo; }
{ By: Coh3n }
{ Date: 11 September 2010 }
{ Description: Loads all the color walking info used in MSI scripts; should }
{ only be called once in SetupMSI }
{******************************************************************************}
procedure MSI_LoadAllWalkInfo;
var
i: Integer;
begin
for i := 0 to High(MSI_WalkInfo) do
MSI_LoadWalkInfo(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);
if (FlagDistance <= TOLERANCE_FLAG) then
Exit;
until((not (FlagPresent)) and (not (IsMoving))) or (t < GetSystemTime);
end;
{******************************************************************************}
{ procedure MSI_SortColors(var Colors: tIntegerArray; col: Integer); }
{ By: Blumblebee }
{ Date: 10 June 2010 }
{ Description: Sorts an array of colors }
{******************************************************************************}
procedure MSI_SortColors(var Colors: tIntegerArray; col: Integer);
var
tempB: tIntegerArray;
Tol: ShortInt;
I: Integer;L: LongInt;
begin
tempB := Colors;
SetArrayLength(Colors, 0);
Tol := 0;
while Length(Colors) < (Length(tempB)/2) do
for i := 0 to High(tempB) do
begin
if SimilarColors(tempB[i], col, Tol) then
begin
L := GetArrayLength(Colors);
SetArrayLength(Colors, L+1);
Colors[L] := tempB[i];
end;
if Tol > 10 then Break;
Inc(Tol);
end;
end;
{******************************************************************************}
{ function MSI_AutoColorMM(const color: Integer): Integer; }
{ By: Blumblebee }
{ Date: 10 June 2010 }
{ Description: Autocolors the color 'color' on the minimap }
{******************************************************************************}
function MSI_AutoColorMM(const color: Integer): Integer;
var
TPA: tPointArray;
List: tIntegerArray;
I: Integer;
begin
for i := 0 to 20 do
begin
FindColorsTolerance(TPA, color, MMx1, MMy1, MMx2, MMy2, 5+i);
if Length(TPA) > 0 then Break;
end;
if Length(TPA) <= 0 then Exit;
List := getColors(TPA);
MSI_SortColors(List, color);
if Length(List) <= 0 then Exit;
result := List[0];
end;
{******************************************************************************}
{ function MSI_AutoColor(constSRL, constMSI: Integer): Integer; }
{ By: Coh3n }
{ Date: 10 June 2010 }
{ Description: Returns the correct color on the minimap. the parameters are }
{ for the different constants pertaining to SRL and MSI. }
{ ex. MSI_AutoColor(srl_VarrockRoadCOlor, COLOR_ROAD_VARROCK); }
{******************************************************************************}
function MSI_AutoColor(constSRL, constMSI: Integer): Integer;
var
acRecord: TAutoColorInfo;
begin
if (not LoadAutoColor(constSRL, acRecord)) then
result := MSI_AutoColorMM(constMSI)
else
result := acRecord.color;
end;
{******************************************************************************}
{ Function MSI_WalkTPA(WalkInfo: tWalkInfo): TPoint; }
{ By: 3Garrett3 }
{ Date: 11 September 2010 }
{ Description: Returns a TPoint of where to walk to based on a TWalkInfo }
{ record }
{******************************************************************************}
Function MSI_WalkTPA(Where: Integer): TPoint;
Var
TPA: TPointArray;
TDPA: T2DPointArray;
I, H, X, Y, CTS: Integer;
WalkInfo: TWalkInfo;
Begin
If Not LoggedIn Then Exit;
Result := Point(-1, -1);
MSI_AddHeader('MSI_WalkTPA');
WalkInfo := MSI_WalkInfo[Where];
cts := GetColorToleranceSpeed;
If WalkInfo.CTS2 Then
Begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(WalkInfo.HueMod, WalkInfo.SatMod);
End Else
ColorToleranceSpeed(1);
FindColorsTolerance(TPA, WalkInfo.Color, MMX1, MMY1, MMX2, MMY2, WalkInfo.Tolerance);
If Length(TPA) = 0 Then
Begin
MSI_Debug('Didn''t find the colour, exiting');
MSI_CloseHeader('MSI_WalkTPA: ' + BoolToStr(Result.x <> -1));
Exit;
End;
MSI_Debug('Found colour, length of array = ' + IntToStr(Length(TPA)));
If WalkInfo.Filter Then
FilterPointsPie(TPA, WalkInfo.StartRadial, WalkInfo.EndRadial, WalkInfo.MinRadius, WalkInfo.MaxRadius, MMCx, MMCy);
Case WalkInfo.SplitMethod Of
SPLIT_TPA_TO_ATPA:
TDPA := TPAToATPA(TPA, WalkInfo.SplitDist);
SPLIT_TPA_TO_ATPA_EX:
TDPA := TPAToATPAEx(TPA, WalkInfo.W, WalkInfo.H);
SPLIT_SPLIT_TPA:
TDPA := SplitTPA(TPA, WalkInfo.SplitDist);
SPLIT_SPLIT_TPA_EX:
TDPA := SplitTPAEx(TPA, WalkInfo.W, WalkInfo.H);
End;
Case WalkInfo.SortMethod Of
SORT_ATPA_FROM:
SortATPAFromFirstPoint(TDPA, WalkInfo.SortPoint);
SORT_FIRST_LARGE:
SortATPASize(TDPA, True);
SORT_FIRST_SMALL:
SortATPASize(TDPA, False);
End;
Wait(10);
H := High(TDPA);
if DEBUG_SMART then
DrawDotsMulti(true, TDPA);
For i := 0 To H Do
Begin
MiddleTPAEx(TDPA[i], x, y);
If rs_OnMinimap(x, y) Then
begin
Result := Point(x, y);
MSI_Debug('Found point: (' + IntToStr(x) + ', ' + IntToStr(y) + ')');
end;
End;
MSI_CloseHeader('MSI_WalkTPA: ' + BoolToStr(Result.x <> -1));
End;
{******************************************************************************}
{ function MSI_CreateWalkTPA( ... ): TPointArray; }
{ By: Blumblebee }
{ Date: 10 June 2010 }
{ Description: Creats a TPA of which can be walked to }
{******************************************************************************}
function MSI_CreateWalkTPA(x, y, color, width, height, tolerance: Integer): TpointArray;
var
TPA: tPointArray;
aTPA: t2DPointArray;
i: Integer;
L, P: Integer;
begin
FindColorsSpiralTolerance(x, y, TPA, color, MMx1, MMy1, MMx2, MMy2, tolerance);
aTPA := TPAtoATPAEx(TPA, width, height);
for i := 0 to High(aTPA) do
begin
if Length(aTPA) > 5 then
begin
l := getarraylength(Result);
SetArrayLength(Result, l+1);
Result[l] := MiddleTpa(aTPA[i]);
end;
end;
if Length(result) = 0 then Exit;
for i := 0 to High(Result) do
if rs_OnMiniMap(result[i].x, result[i].y) then Inc(p);
if p = 0 then SetArrayLength(Result, 0);
end;
{******************************************************************************}
{ function MSI_WalkTPAPoint( ... ): Boolean; }
{ By: Blumblebee }
{ Date: 10 June 2010 }
{ Description: Walks to a point on the minimap }
{******************************************************************************}
function MSI_WalkTPAPoint(TPA: tPointArray; sortP: tPoint; flagDist: shortInt): Boolean;
var
i: Integer;
t: LongInt;
begin
t := getSystemTime;
if Length(TPA) <= 0 then Exit;
SortTPAFrom(TPA, sortP);
for i := 0 to High(TPA) do
begin
if rs_OnMiniMap(TPA[i].x, TPA[i].y) then
begin
Mouse(TPA[i].x, TPA[i].y, random(8), random(8), true);
wait(randomRange(1000, 2000));
while not FlagPresent do
begin
wait(250+randomRange(150, 350));
if getSystemTime-t > randomRange(2500, 3750) then
continue;
end;
FFlag(flagDist);
Result := True;
Exit;
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_WC_VEPoints(index: integer): TPoint; }
{ By: The MSI Team }
{ Date: 10 June 2010 }
{ Description: Returns a point on the minimap depending on the specified }
{ location by 'index' }
{******************************************************************************}
function MSI_WC_VEPoints(index: integer): TPoint;
var
i, Tol: Integer;
aTPA: t2DPointArray;
TPA: tPointArray;
p: tPoint;
RockColor, TreeColor, BC: Integer;
t: LongInt;
begin
try MSI_AddHeader('MSI_WC_VEPoints');
Result := Point(-1, -1);
case index of
//road
WALK_WC_VE_TREE_1, WALK_WC_VE_OAKS_1:
begin
if countColor(RoadColor, MMx1, MMy1, MMx2, MMy2) <= 5 then
RoadColor := MSI_AutoColor(srl_VarrockRoadColor, COLOR_ROAD_VARROCK);
Tol := 2;
for i := 0 to 2 do
begin
FindColorsTolerance(TPA, RoadColor, MMCx, MMy1, MMx2, MMCy, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 1.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMX2, MMY1));
try
t := High(TPA) - randomRange(3, 6);
except
t := High(TPA);
end;
Result := Point(TPA[t].x, TPA[t].y);
end;
//road
WALK_WC_VE_TREE_2, WALK_WC_VE_OAKS_2:
begin
Tol := 2;
for i := 0 to 2 do
begin
RoadColor := MSI_AutoColor(srl_VarrockRoadColor, COLOR_ROAD_VARROCK);
FindColorsTolerance(TPA, RoadColor, MMCx + 40, MMCY - 40, MMx2, MMCy + 15, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 2.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMCx, MMCy));
i := (High(TPA) - RandomRange(1, 5));
Result := Point(TPA[i].x, TPA[i].y);
end;
//rock
WALK_WC_VE_TREE_3:
begin
RockColor := MSI_AutoColorMM(COLOR_ROCK);
TPA := MSI_CreateWalkTPA(MMcx, MMy1, RockColor, 2, 2, 8);
if length(TPA) <= 0 then Exit;
for i := 0 to High(TPA) do
begin
if TPA[i].y > MMcy then continue;
Result := Point(TPA[i].x, TPA[i].y);
Exit;
end;
end;
//final
WALK_WC_VE_TREE_4:
begin
TreeColor := MSI_AutoColor(srl_TreeColor, COLOR_TREE);
MSI_Debug('Tree AutoColor = '+IntToStr(TreeColor));
FindColorsTolerance(TPA, TreeColor, MMx1, MMy1, MMx2, MMy2, 8);
if Length(TPA) <= 0 then Exit;
aTPA := SplitTPAEx(TPA, 10, 10);
if Length(aTPA) <= 0 then Exit;
SortATPASize(aTPA, true);
p := MiddleTPA(aTPA[0]);
if (p.x < MMcx+20) and (p.y < MMcy) then
Result := Point(p.x, p.y);
end;
//rock
WALK_WC_VE_BANK_1:
begin
RockColor := MSI_AutoColorMM(COLOR_ROCK);
TPA := MSI_CreateWalkTPA(MMcx, MMy2, RockColor, 2, 2, 10);
if Length(TPA) <= 0 then Exit;
SortTPAFrom(TPA, point(700, 150));
for i := 0 to High(TPA) do
begin
if (TPA[i].y < MMcy+ 20) or (TPA[i].x < MMCX) then
continue;
Result := Point(TPA[i].x-5, TPA[i].y);
Exit;
end;
end;
//path
WALK_WC_VE_BANK_2:
begin
RoadColor := MSI_AutoColor(srl_VarrockRoadColor, COLOR_ROAD_VARROCK);
FindColorsTolerance(TPA, RoadColor, MMx1, MMCy + 15, MMx2 - 20, MMy2, 4);
if Length(TPA) <= 0 then
Exit;
SortTPAFrom(TPA, Point(MMCx, MMCy));
for t := 0 to 4 do
begin
i := Length(TPA) - Random(2);
try
if rs_OnMiniMap(TPA[i].x, TPA[i].y) then
BC := 1;
except
Continue;
end;
if BC = 1 then
Break;
end;
if (t = 4) or (BC < 1) then
begin
MSI_Debug('Failed to find road on minimap - Walk_WC_VE_Bank2');
Exit;
end;
Result := Point(TPA[i].x, TPA[i].y);
end;
//road
WALK_WC_VE_BANK_3:
begin
RoadColor := MSI_AutoColor(srl_VarrockRoadColor, COLOR_ROAD_VARROCK);
TPA := MSI_CreateWalkTPA(MMx1, MMcy, RoadColor, 3, 3, 8);
if Length(TPA) <= 0 then
Exit;
SortTPAFrom(TPA, point(MMx1-10, MMcy));
for i := 0 to High(TPA) do
begin
if not RS_onMinimap(TPA[i].x, TPA[i].y) then Continue;
Result := Point(TPA[i].x, TPA[i].y);
Exit;
end;
end;
//final
WALK_WC_VE_BANK_4:
begin
for i := 0 to 2 do
begin
BC := MSI_AutoColorMM(COLOR_BANKER);
FindColorsTolerance(TPA, BC, MMx1, MMCy, MMx2, MMy2, 5);
if Length(TPA) > 5 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to find bankers on MiniMap- final.');
Exit;
end;
end;
aTPA := TPAToATPAEx(TPA, 25, 5);
SortATPASize(aTPA, True);
i := Length(aTPA[0]);
t := RandomRange(0, i);
Result := Point(aTPA[0][t].x, aTPA[0][t].y - RandomRange(3, 7));
end;
end;
finally
MSI_CloseHeader('MSI_WC_VEPoints');
end;
end;
{******************************************************************************}
{ function MSI_WC_DBPoints(Index: Integer): TPoint; }
{ By: The MSI Team }
{ Date: 09 July 2010 }
{ Description: Returns a point on the minimap depending on the specified }
{ location by 'index' }
{******************************************************************************}
function MSI_WC_DBPoints(Index: Integer): TPoint;
begin
Result := Point(-1, -1);
case Index of
WALK_WC_DB_WILLOWS_1:
begin
Result.x := RandomRange(595, 613);
Result.y := RandomRange(113, 130);
end;
//MouseBox(595, 113, 613, 130, 1);
WALK_WC_DB_WILLOWS_BANK_1:
begin
Result.x := RandomRange(645, 656);
Result.y := RandomRange(44, 53);
end;
//MouseBox(645, 44, 656, 53, 1);
else
MSI_SubDebug('MSI_WC_DBPoints: Invalid walk point!');
end;
end;
//////////// MY CHANGES HERE ///////////////////////////
function MSI_MN_VWPoints(Index: Integer): TPoint;
var
i, Tol: Integer;
aTPA: t2DPointArray;
TPA: tPointArray;
p: tPoint;
RockColor, DirtRoadColor, Rock: Integer;
t: LongInt;
begin
try MSI_AddHeader('MSI_MN_VWPoints');
Result := Point(-1, -1);
case index of
//road
WALK_MN_VW_1:
begin
RoadColor := MyFindColor('road');
Tol := 5;
for i := 0 to 2 do
begin
FindColorsTolerance(TPA, RoadColor, MMx1, MMY1, MMCX, MMY2, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 1.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMCX, MMY1));
i := (High(TPA) - RandomRange(1, 3));
Result := Point(TPA[i].x + 15, TPA[i].y + 2);
end;
//dirt road
WALK_MN_VW_2:
begin
Tol := 5;
for i := 0 to 2 do
begin
DirtRoadColor := MyFindColor('dirtroad');
FindColorsTolerance(TPA, DirtRoadColor, MMCx - 15, MMCY, MMx2, MMy2, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 2.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMx2, MMCy));
i := ((High(TPA)/2) + RandomRange(15, 20));
Result := Point(TPA[i].x - 40, TPA[i].y + 20);
end;
//dirt road
WALK_MN_VW_3:
begin
Tol := 5;
for i := 0 to 2 do
begin
DirtRoadColor := MyFindColor('dirtroad');
FindColorsTolerance(TPA, DirtRoadColor, MMCx, MMCY, MMx2, MMy2, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 3.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMx2, MMcy));
i := (High(TPA) - RandomRange(5, 10));
Result := Point(TPA[i].x - 14 , TPA[i].y - 5);
end;
//dirt road
WALK_MN_VW_4:
begin
Tol := 5;
for i := 0 to 2 do
begin
DirtRoadColor := MyFindColor('dirtroad');
FindColorsTolerance(TPA, DirtRoadColor, MMCX, MMCY + 30, MMX2, MMY2, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 4.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMCX, MMCY + 32));
i := (High(TPA) - RandomRange(2, 4));
Result := Point(TPA[i].x - 40, TPA[i].y + 20);
end;
//mine rocks
WALK_MN_VW_5:
begin
Tol := 5;
for i := 0 to 2 do
begin
Rock := MyFindColor('mmrock');
FindColorsTolerance(TPA, Rock, MMX1, MMCY, MMX2, MMY2, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 5.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMCX, MMCY));
i := (High(TPA) - RandomRange(2, 6));
Result := Point(TPA[i].x + 3, TPA[i].y - 6);
end;
WALK_MN_VW_BANK_1:
begin
Rock := MyFindColor('mmrock');
Tol := 5;
for i := 0 to 2 do
begin
FindColorsTolerance(TPA, Rock, MMCX, MMY1, MMX2, MMCY, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 1.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMCX, MMCY));
i := (High(TPA) - RandomRange(1, 2));
Result := Point(TPA[i].x + 2, TPA[i].y + 2);
end;
//dirt road
WALK_MN_VW_BANK_2:
begin
Tol := 5;
for i := 0 to 2 do
begin
DirtRoadColor := MyFindColor('dirtroad');
FindColorsTolerance(TPA, DirtRoadColor, MMCX, MMY1, MMX2, MMCY, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 2.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMX2, MMCY));
i := (High(TPA) - RandomRange(1, 2));
Result := Point(TPA[i].x - 40, TPA[i].y + 5);
end;
//dirt road
WALK_MN_VW_BANK_3:
begin
Tol := 5;
for i := 0 to 2 do
begin
DirtRoadColor := MyFindColor('dirtroad');
FindColorsTolerance(TPA, DirtRoadColor, MMCX, MMY1, MMX2, MMCY, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 3.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMCX, MMCY));
i := (High(TPA) - RandomRange(1, 2));
Result := Point(TPA[i].x - 55 , TPA[i].y + 5);
end;
//dirt road
WALK_MN_VW_BANK_4:
begin
Tol := 5;
for i := 0 to 2 do
begin
DirtRoadColor := MyFindColor('dirtroad');
FindColorsTolerance(TPA, DirtRoadColor, MMCX, MMY1, MMX2, MMCY, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 4.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMCX, MMCY));
i := (High(TPA) - RandomRange(1, 3));
Result := Point(TPA[i].x - 15, TPA[i].y + 5);
end;
//mine rocks
WALK_MN_VW_BANK_5:
begin
Tol := 5;
for i := 0 to 2 do
begin
Rock := MyFindColor('road');
FindColorsTolerance(TPA, Rock, MMCX, MMY1, MMX2, MMCY, Tol);
if Length(TPA) > 10 then
Break;
if i = 2 then
begin
MSI_Debug('Failed to locate road - 5.');
Exit;
end;
Tol := i * 2;
end;
SortTPAFrom(TPA, Point(MMX2, MMCY));
i := (High(TPA) - RandomRange(1, 2));
Result := Point(TPA[i].x + 25, TPA[i].y - 14);
end;
end;
finally
MSI_CloseHeader('MSI_MN_VWPoints');
end;
end;
//////////// MY CHANGES HERE ///////////////////////////
{******************************************************************************}
{ function MSI_CreateWalkIndex(index: Integer): TPoint; }
{ By: The MSI Team }
{ Date: 10 June 2010 }
{ Description: Returns a point on the minimap depending on the specified }
{ location by 'index' }
{******************************************************************************}
function MSI_CreateWalkIndex(index: Integer): TPoint;
begin
case index of
WALK_WC_VE_TREE_1..WALK_WC_VE_OAKS_2:
Result := MSI_WC_VEPoints(index);
WALK_WC_DB_WILLOWS_1, WALK_WC_DB_WILLOWS_BANK_1:
Result := MSI_WC_DBPoints(index);
//////////// MY CHANGES HERE ///////////////////////////
WALK_MN_VW_1..WALK_MN_VW_BANK_5: //so all walking happens
Result := MSI_MN_VWPoints(index);
//////////// MY CHANGES HERE ///////////////////////////
end;
end;
{******************************************************************************}
{ function MSI_WalkToColorIndex(index: Integer): Boolean; }
{ By: Coh3n }
{ Date: 10 June 2010 }
{ Description: Walked to a point specified by 'index' on the minimap }
{******************************************************************************}
function MSI_WalkToColorIndex(index: Integer): Boolean;
var
p: TPoint;
begin
p := MSI_CreateWalkIndex(index);
if (p.x = -1) then
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;
{******************************************************************************}
{ 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;
var
WalkLoop, Loop:Integer;
MiddleOfTPA: TPoint;
TPA : TPointArray;
begin
try
MSI_AddHeader('MSI_CreateWalkFailsafe');
if not MSI_WalkToColorIndex(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.
//////////// MY CHANGES HERE ///////////////////////////
//failsafe for my color walking
WALK_MN_VW_1:
repeat
if FindColorsPie(TPA, AutoColor(srl_VarrockRoadColor), 15, 200, 260, 5, 80, mmx1, mmy1, mmcx, mmy2, mmcx, mmcy) then //dungeon symbol color
begin
MSI_Debug('Walking to Mine Part 1 Complete');
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x , MiddleOfTPA.y , 5, 5, true);
Flag;
end;
inc(Loop);
until((FindColorsPie(TPA, 12632256, 5, 200, 280, 5, 80, mmx1, mmy1, mmcx, mmcy, mmcx, mmcy))or (Loop > 3));
//walkign step 2
WALK_MN_VW_2:
if FindColorsPie(TPA, AutoColor(srl_LightDirtRoadColor), 15, 100, 180, 50, 80, mmcx, mmcy, mmx2, mmy2, mmcx, mmcy) then //dungeon symbol color
begin
MSI_Debug('Walking to Mine Part 2 Complete');
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x - 45 , MiddleOfTPA.y + 10, 5, 5, true);
Flag;
end else
begin
MSI_Debug('Walking to Mine Part 2 Failed');
Exit;
end;
WALK_MN_VW_3:
//walkign step 3
if FindColorsPie(TPA, AutoColor(srl_LightDirtRoadColor), 15, 120, 180, 50, 80, mmcx, mmcy, mmx2, mmy2, mmcx, mmcy) then //dungeon symbol color
begin
MSI_Debug('Walking to Mine Part 3 Complete');
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x - 40 , MiddleOfTPA.y + 18, 5, 5, true);
Flag;
end else
begin
MSI_Debug('Walking to Mine Part 3 Failed');
Exit;
end;
WALK_MN_VW_4:
//walkign step 4
if FindColorsPie(TPA, AutoColor(srl_LightDirtRoadColor), 15, 120, 180, 50, 80, mmcx, mmcy, mmx2, mmy2, mmcx, mmcy) then //dungeon symbol color
begin
MSI_Debug('Walking to Mine Part 4 Complete');
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x - 20 , MiddleOfTPA.y + 8, 5, 5, true);
Flag;
end else
begin
MSI_Debug('Walking to Mine Part 4 Failed');
Exit;
end;
//last step
WALK_MN_VW_5:
if FindColorsPie(TPA, AutoColor(srl_MineRockColor), 15, 140, 220, 10, 60, mmx1, mmcy, mmx2, mmy2, mmcx, mmcy) then //dungeon symbol color
begin
MSI_Debug('Walking to Mine Part 5 Complete');
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x , MiddleOfTPA.y , 5, 5, true);
Flag;
end else
begin
MSI_Debug('Walking Failed step 5');
Exit;
end;
//bank walk
WALK_MN_VW_BANK_1:
if FindColorsPie(TPA, MyFindColor('mmrock'), 15, 0, 360, 0, 80, mmcx, mmy1, mmx2, mmcy, mmcx, mmcy) then //dungeon symbol color
begin
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x , MiddleOfTPA.y - 12, 5, 5, true);
Flag;
MSI_Debug('Walking to Mine Part 1 Complete');
end else
begin
MSI_Debug('Walking to Mine Part 1 Failed');
Exit;
end;
//walkign step 2
WALK_MN_VW_BANK_2:
if FindColorsPie(TPA, MyFindColor('dirtroad'), 15, 0, 60, 30, 70, mmcx, mmy1, mmx2, mmcy, mmcx, mmcy) then //dungeon symbol color
begin
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x - 55 , MiddleOfTPA.y - 10, 5, 5, true);
Flag;
MSI_Debug('Walking to Mine Part 2 Complete');
end else
begin
MSI_Debug('Walking to Mine Part 2 Failed');
Exit;
end;
WALK_MN_VW_BANK_3:
//walkign step 3
if FindColorsPie(TPA, MyFindColor('dirtroad'), 15, 0, 80, 30, 80, mmcx, mmy1, mmx2, mmcy, mmcx, mmcy) then //dungeon symbol color
begin
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x - 50 , MiddleOfTPA.y - 25, 5, 5, true);
Flag;
MSI_Debug('Walking to Mine Part 3 Complete');
end else
begin
MSI_Debug('Walking to Mine Part 3 Failed');
Exit;
end;
WALK_MN_VW_BANK_4:
//walkign step 4
if FindColorsPie(TPA, MyFindColor('dirtroad'), 15, 0, 80, 40, 80, mmcx, mmy1, mmx2, mmcy, mmcx, mmcy) then //dungeon symbol color
begin
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x - 10 , MiddleOfTPA.y - 20, 5, 5, true);
Flag;
MSI_Debug('Walking to Mine Part 4 Complete');
end else
begin
MSI_Debug('Walking to Mine Part 4 Failed');
Exit;
end;
//last step
WALK_MN_VW_BANK_5:
if FindColorsPie(TPA, MyFindColor('road'), 15, 0, 60, 10, 80, mmcx, mmy1, mmx2, mmcy, mmcx, mmcy) then //dungeon symbol color
begin
MiddleOfTPA:= MiddleTPA(TPA);
Mouse(MiddleOfTPA.x , MiddleOfTPA.y -22, 5, 5, true);
Flag;
MSI_Debug('Walking to Mine Complete');
end else
begin
MSI_Debug('Walking Failed step 5');
Exit;
end;
//////////// MY CHANGES 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]];
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
ProgressReportArray[CurrentPlayer].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;
Scripts.Simba
{==============================================================================\
| MSI Group Scripting Include |
| Scripts.scar |
|==============================================================================|
| For all the routines related to specific scripts |
| |
| * function MSI_LoadScript(): Boolean; * by The MSI Team |
| * procedure MSI_LoadAllScripts; * by Coh3n |
\_____________________________________________________________________________}
{******************************************************************************}
{ function MSI_LoadScript(whichScript: Integer): Boolean; }
{ By: The MSI Team }
{ Date: 17 August 2010 }
{ Description: Loads whichScript information. This should only be called in }
{ MSI_LoadAllScripts }
{******************************************************************************}
function MSI_LoadScript(whichScript: Integer): Boolean;
begin
case whichScript of
{ WOODCUTTERS ================================ ]
[============================================= }
SCRIPT_VE_TREES:
with MSI_Scripts[whichScript] do
begin
Name := 'Varrock East Trees';
Constant := SCRIPT_VE_TREES;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_NORMAL];
Items := [[LOGS_NORMAL]];
BankType := Bank;
WhichBank := MSI_BANK_VE;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_VE_BANK;
EndLoc := LOC_VE_TREES;
Reflection := [
Point(3253, 3421), Point(3265, 3428),
Point(3275, 3429), Point(3280, 3439),
Point(3276, 3450)
];
ColorTo := [
WALK_WC_VE_TREE_1, WALK_WC_VE_TREE_2,
WALK_WC_VE_TREE_3, WALK_WC_VE_TREE_4
];
ColorFrom := [
WALK_WC_VE_BANK_1, WALK_WC_VE_BANK_2,
WALK_WC_VE_BANK_3, WALK_WC_VE_BANK_4
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_VE_OAKS:
with MSI_Scripts[whichScript] do
begin
Name := 'Varrock East Oaks';
Constant := SCRIPT_VE_OAKS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_OAK];
Items := [[LOGS_OAK]];
BankType := Bank;
WhichBank := MSI_BANK_VE;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_VE_BANK;
EndLoc := LOC_VE_OAKS;
Reflection := [
Point(3253, 3420), Point(3266, 3429),
Point(3279, 3428)
];
ColorTo := [
WALK_WC_VE_OAKS_1, WALK_WC_VE_OAKS_2
];
ColorFrom := [
WALK_WC_VE_BANK_3, WALK_WC_VE_BANK_4
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_POWER_CHOP:
with MSI_Scripts[whichScript] do
begin
Name := 'Powerchopper';
Constant := SCRIPT_POWER_CHOP;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [
TREE_NORMAL, TREE_OAK, TREE_WILLOW, TREE_MAPLE,
TREE_YEW, TREE_MAGIC
];
Items := [
[LOGS_NORMAL], [LOGS_OAK], [LOGS_WILLOW],
[LOGS_MAPLE], [LOGS_YEW], [LOGS_MAGIC]
];
BankType := NoBank;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
end;
SCRIPT_GE_YEWS:
with MSI_Scripts[whichScript] do
begin
Name := 'Grand Exchange Yews';
Constant := SCRIPT_GE_YEWS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_YEW];
Items := [[LOGS_YEW]];
BankType := Bank;
WhichBank := MSI_BANK_GE;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_GE_BANK;
EndLoc := LOC_GE_YEWS;
Reflection := [
Point(3169, 3490), Point(3183, 3489),
Point(3193, 3489), Point(3197, 3499),
Point(3208, 3503)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_DB_TREES:
with MSI_Scripts[whichScript] do
begin
Name := 'Draynor Normals';
Constant := SCRIPT_DB_TREES;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_NORMAL];
Items := [[LOGS_NORMAL]];
BankType := Bank;
WhichBank := MSI_BANK_DB;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_DB_BANK;
EndLoc := LOC_DB_TREES;
Reflection := [
Point(3092, 3240), Point(3084, 3248),
Point(3080, 3263), Point(3081, 3268)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_DB_OAKS:
With MSI_Scripts[WhichScript] do
begin
Name := 'Draynor Oaks';
Constant := SCRIPT_DB_OAKS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_OAK];
Items := [[LOGS_OAK]];
BankType := Bank;
WhichBank := MSI_BANK_DB;
CompassAng := 'w';
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_DB_BANK;
EndLoc := LOC_DB_OAKS;
Reflection := [
Point(3092, 3244), Point(3101, 3244)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_DB_WILLOWS:
with MSI_Scripts[whichScript] do
begin
Name := 'Draynor Willows';
Constant := SCRIPT_DB_WILLOWS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_WILLOW];
Items := [[LOGS_WILLOW]];
BankType := Bank;
WhichBank := MSI_BANK_DB;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_DB_BANK;
EndLoc := LOC_DB_WILLOWS;
Reflection := [
Point(3092, 3245), Point(3087, 3234)
];
ColorTo := [
WALK_WC_DB_WILLOWS_1
];
ColorFrom := [
WALK_WC_DB_WILLOWS_BANK_1
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_RM_YEWS:
with MSI_Scripts[whichScript] do
begin
Name := 'Rimmington Yews';
Constant := SCRIPT_RM_YEWS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_YEW];
Items := [[LOGS_YEW]];
BankType := Bank;
WhichBank := MSI_BANK_FE;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_FE_BANK;
EndLoc := LOC_RM_YEWS;
Reflection := [
Point(3012, 3354), Point(3007, 3348),
Point(3008, 3334), Point(3008, 3323),
Point(3008, 3309), Point(3008, 3295),
Point(3003, 3285), Point(2991, 3279),
Point(2980, 3272), Point(2975, 3260),
Point(2965, 3252), Point(2956, 3241),
Point(2945, 3232), Point(2937, 3230)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_PS_WILLOWS:
with MSI_Scripts[whichScript] do
begin
Name := 'Port Sarim Willows';
Constant := SCRIPT_PS_WILLOWS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_WILLOW];
Items := [[LOGS_WILLOW]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_PS_WILLOWS;
Reflection := [
Point(3047, 3236), Point(3052, 3248),
Point(3060, 3253)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_PS_YEWS:
with MSI_Scripts[whichScript] do
begin
Name := 'Port Sarim Yews';
Constant := SCRIPT_PS_YEWS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_YEW];
Items := [[LOGS_YEW]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_PS_YEWS;
Reflection := [
Point(3046, 3235), Point(3042, 3245),
Point(3041, 3254), Point(3041, 3263),
Point(3044, 3269), Point(3053, 3270)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_SV_MAGICS:
with MSI_Scripts[whichScript] do
begin
Name := 'Seers Village Magics';
Constant := SCRIPT_SV_MAGICS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_MAGIC];
Items := [[LOGS_MAGIC]];
BankType := Bank;
WhichBank := MSI_BANK_SV;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_SV_BANK;
EndLoc := LOC_SV_MAGICS;
Reflection := [
Point(2726, 3492), Point(2725, 3489),
Point(2722, 3474), Point(2722, 3458),
Point(2720, 3443), Point(2720, 3431),
Point(2720, 3415), Point(2715, 3402),
Point(2702, 3398)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_SV_MAPLES:
with MSI_Scripts[whichScript] do
begin
Name := 'Seers Village Maples';
Constant := SCRIPT_SV_MAPLES;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_MAPLE];
Items := [[LOGS_MAPLE]];
BankType := Bank;
WhichBank := MSI_BANK_SV;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_SV_BANK;
EndLoc := LOC_SV_MAPLES;
Reflection := [
Point(2726, 3492),
Point(2724, 3502)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_SV_YEWS:
with MSI_Scripts[whichScript] do
begin
Name := 'Seers Village Yews';
Constant := SCRIPT_SV_YEWS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_YEW];
Items := [[LOGS_YEW]];
BankType := Bank;
WhichBank := MSI_BANK_SV;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_SV_BANK;
EndLoc := LOC_SV_YEWS;
Reflection := [
Point(2725, 3493), Point(2725, 3485),
Point(2725, 3477), Point(2725, 3468),
Point(2720, 3443), Point(2720, 3431),
Point(2719, 3463), Point(2714, 3464)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_EV_YEWS:
with MSI_Scripts[whichScript] do
begin
Name := 'Edgeville yews';
Constant := SCRIPT_EV_YEWS;
SkillName := 'Woodcutting';
SkillConstant := SKILL_WOODCUTTING;
Objects := [TREE_YEW];
Items := [[LOGS_YEW]];
BankType := Bank;
WhichBank := MSI_BANK_EV;
CompassAng := -1;
AutoObjects := @MSI_ChopInvFull;
PlayerSetup := @MSI_SetupWoodcutting;
with PathInfo do
begin
StartLoc := LOC_EV_BANK;
EndLoc := LOC_EV_YEWS;
Reflection := [
Point(3093, 3492), Point(3093, 3478),
Point(3087, 3472)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
{ MINERS ===================================== ]
[============================================= }
SCRIPT_POWER_MINER:
with MSI_Scripts[whichScript] do
begin
Name := 'Powerminer';
Constant := SCRIPT_POWER_MINER;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [
ROCK_CLAY, ROCK_COPPER, ROCK_TIN, ROCK_IRON, ROCK_SILVER,
ROCK_COAL, ROCK_GOLD, ROCK_MITHRIL, ROCK_ADAMANTITE
];
Items := [
[ORE_CLAY], [ORE_COPPER], [ORE_TIN], [ORE_IRON],
[ORE_SILVER], [ORE_COAL], [ORE_GOLD], [ORE_MITHRIL],
[ORE_ADAMANTITE]
];
BankType := NoBank;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
end;
SCRIPT_VE_MINER:
with MSI_Scripts[whichScript] do
begin
Name := 'Varrock East Miner';
Constant := SCRIPT_VE_MINER;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_TIN, ROCK_COPPER, ROCK_IRON];
Items := [[ORE_TIN], [ORE_COPPER], [ORE_IRON]];
BankType := Bank;
WhichBank := MSI_BANK_VE;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_VE_BANK;
EndLoc := LOC_VE_MINE;
Reflection := [
Point(3254, 3421), Point(3265, 3429),
Point(3279, 3429), Point(3288, 3418),
Point(3292, 3406), Point(3292, 3393),
Point(3294, 3381), Point(3288, 3368)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_LSW_MINER:
with MSI_Scripts[whichScript] do
begin
Name := 'Lumby Swamp West Miner';
Constant := SCRIPT_LSW_MINER;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_COAL, ROCK_MITHRIL, ROCK_ADAMANTITE];
Items := [[ORE_COAL], [ORE_MITHRIL], [ORE_ADAMANTITE]];
BankType := Bank;
WhichBank := MSI_BANK_DB;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_DB_BANK;
EndLoc := LOC_LSW_MINE;
Reflection := [
Point(3092, 3242), Point(3101, 3234),
Point(3108, 3225), Point(3115, 3217),
Point(3124, 3211), Point(3132, 3205),
Point(3138, 3197), Point(3140, 3186),
Point(3141, 3175), Point(3144, 3165),
Point(3148, 3155), Point(3148, 3147)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_VW_MINER:
with MSI_Scripts[whichScript] do
begin
Name := 'Varrock West Miner';
Constant := SCRIPT_VE_MINER;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_TIN, ROCK_CLAY, ROCK_IRON, ROCK_SILVER];
Items := [[ORE_TIN], [ORE_CLAY], [ORE_IRON], [ORE_SILVER]];
BankType := Bank;
WhichBank := MSI_BANK_VW;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_VW_BANK;
EndLoc := LOC_VW_MINE;
Reflection := [
Point(3187, 3437), Point(3183, 3429),
Point(3174, 3427), Point(3171, 3418),
Point(3173, 3408), Point(3170, 3397),
Point(3173, 3387), Point(3174, 3377),
Point(3171, 3367), Point(3176, 3361),
Point(3181, 3367)
];
//////////// MY CHANGES HERE ///////////////////////////
//my color walking
ColorTo := [
WALK_MN_VW_1, WALK_MN_VW_2,
WALK_MN_VW_3, WALK_MN_VW_4,
WALK_MN_VW_5
];
//need to make bank walking still
ColorFrom := [
WALK_MN_VW_BANK_1, WALK_MN_VW_BANK_2,
WALK_MN_VW_BANK_3, WALK_MN_VW_BANK_4,
WALK_MN_VW_BANK_5
];
//////////// MY CHANGES HERE ///////////////////////////
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_BBV_MINER:
with MSI_Scripts[whichScript] do
begin
Name := 'Barbarian Village Miner';
Constant := SCRIPT_BBV_MINER;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_TIN, ROCK_COAL];
Items := [[ORE_TIN], [ORE_COAL]];
BankType := Bank;
WhichBank := MSI_BANK_EV;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_EV_BANK;
EndLoc := LOC_BBV_MINE;
Reflection := [
Point(3093, 3493), Point(3085, 3486),
Point(3081, 3478), Point(3082, 3467),
Point(3088, 3458), Point(3087, 3448),
Point(3085, 3437), Point(3086, 3427),
Point(3079, 3423)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_RM_CLAY:
with MSI_Scripts[whichScript] do
begin
Name := 'Rimmington Clay Miner';
Constant := SCRIPT_RM_CLAY;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_CLAY];
Items := [[ORE_CLAY]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_RM_CLAY;
Reflection := [
Point(3047, 3234), Point(3033, 3234),
Point(3022, 3233), Point(3011, 3230),
Point(3000, 3232), Point(2993, 3230),
Point(2986, 3236)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_RM_TIN:
with MSI_Scripts[whichScript] do
begin
Name := 'Rimmington Tin Miner';
Constant := SCRIPT_RM_TIN;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_TIN];
Items := [[ORE_TIN]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_RM_TIN;
Reflection := [
Point(3047, 3234), Point(3033, 3234),
Point(3022, 3233), Point(3011, 3230),
Point(3000, 3232), Point(2993, 3230),
Point(2986, 3236)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_RM_COPPER:
with MSI_Scripts[whichScript] do
begin
Name := 'Rimmington Copper Miner';
Constant := SCRIPT_RM_COPPER;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_COPPER];
Items := [[ORE_COPPER]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_RM_COPPER;
Reflection := [
Point(3046, 3234), Point(3033, 3234),
Point(3020, 3230), Point(3007, 3231),
Point(2997, 3230), Point(2986, 3231),
Point(2981, 3241), Point(2979, 3245)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_RM_IRON_1:
with MSI_Scripts[whichScript] do
begin
Name := 'Rimmington Iron Miner 1';
Constant := SCRIPT_RM_IRON_1;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_IRON];
Items := [[ORE_IRON]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_RM_IRON_1;
Reflection := [
Point(3047, 3234), Point(3033, 3234),
Point(3021, 3233), Point(3008, 3231),
Point(2996, 3231), Point(2983, 3233)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_RM_IRON_2:
with MSI_Scripts[whichScript] do
begin
Name := 'Rimmington Iron Miner 2';
Constant := SCRIPT_RM_IRON_2;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_IRON];
Items := [[ORE_IRON]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_RM_IRON_2;
Reflection := [
Point(3047, 3234), Point(3033, 3234),
Point(3021, 3233), Point(3008, 3231),
Point(2996, 3231), Point(2983, 3230),
Point(2974, 3235), Point(2971, 3239)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_RM_GOLD:
with MSI_Scripts[whichScript] do
begin
Name := 'Rimmington Gold Miner';
Constant := SCRIPT_RM_GOLD;
SkillName := 'Mining';
SkillConstant := SKILL_MINING;
Objects := [ROCK_GOLD];
Items := [[ORE_GOLD]];
BankType := DBox;
WhichBank := DBOX_PS;
CompassAng := -1;
AutoObjects := @MSI_MineInvFull;
PlayerSetup := @MSI_SetupMining;
with PathInfo do
begin
StartLoc := LOC_PS_DBOX;
EndLoc := LOC_RM_GOLD;
Reflection := [
Point(3047, 3234), Point(3033, 3234),
Point(3021, 3233), Point(3008, 3231),
Point(2996, 3231), Point(2983, 3230),
Point(2977, 3233)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
{ FISHERS ==================================== ]
[============================================= }
SCRIPT_POWER_FISHER:
with MSI_Scripts[whichScript] do
begin
Name := 'Powerfisher';
Constant := SCRIPT_POWER_FISHER;
SkillName := 'Fishing';
SkillConstant := SKILL_FISHING;
Objects := [
FISHSPOT_NET, FISHSPOT_BAIT, FISHSPOT_LURE,
FISHSPOT_CAGE, FISHSPOT_HARPOON
];
Items := [
[FISH_RAW_SHRIMP, FISH_RAW_ANCHOVIE],
[FISH_RAW_SARDINE, FISH_RAW_HERRING, FISH_RAW_PIKE],
[FISH_RAW_TROUT, FISH_RAW_SALMON], [FISH_RAW_LOBSTER],
[FISH_RAW_TUNA, FISH_RAW_SWORDFISH]
];
BankType := NoBank;
CompassAng := -1;
AutoObjects := @MSI_FishInvFull;
PlayerSetup := @MSI_SetupFishing;
end;
SCRIPT_DB_FISHER:
with MSI_Scripts[whichScript] do
begin
Name := 'Draynor Village Fisher';
Constant := SCRIPT_DB_FISHER;
SkillName := 'Fishing';
SkillConstant := SKILL_FISHING;
Objects := [
FISHSPOT_NET, FISHSPOT_BAIT
];
Items := [
[FISH_RAW_SHRIMP, FISH_RAW_ANCHOVIE],
[FISH_RAW_SARDINE, FISH_RAW_HERRING, FISH_RAW_PIKE]
];
BankType := Bank;
WhichBank := MSI_BANK_DB;
CompassAng := 'N';
AutoObjects := @MSI_FishInvFull;
PlayerSetup := @MSI_SetupFishing;
with PathInfo do
begin
StartLoc := LOC_DB_BANK;
EndLoc := LOC_DB_FISH;
Reflection := [
Point(3093, 3242), Point(3087, 3234),
Point(3087, 3228)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
SCRIPT_BBV_FISHER:
with MSI_Scripts[whichScript] do
begin
Name := 'Barbarian Village Fisher';
Constant := SCRIPT_BBV_FISHER;
SkillName := 'Fishing';
SkillConstant := SKILL_FISHING;
Objects := [
FISHSPOT_LURE, FISHSPOT_BAIT
];
Items := [
[FISH_RAW_TROUT, FISH_RAW_SALMON],
[FISH_RAW_SARDINE, FISH_RAW_HERRING, FISH_RAW_PIKE]
];
BankType := Bank;
WhichBank := MSI_BANK_EV;
CompassAng := 'N';
AutoObjects := @MSI_FishInvFull;
PlayerSetup := @MSI_SetupFishing;
with PathInfo do
begin
StartLoc := LOC_EV_BANK;
EndLoc := LOC_BBV_FISH;
Reflection := [
Point(3094, 3489), Point(3099, 3485),
Point(3100, 3474), Point(3098, 3464),
Point(3096, 3449), Point(3103, 3435),
Point(3107, 3433)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
{ COOKERS ==================================== ]
[============================================= }
SCRIPT_VE_COOKER:
with MSI_Scripts[whichScript] do
begin
Name := 'Varrock East Cooker';
Constant := SCRIPT_VE_COOKER;
SkillName := 'Cooker';
SkillConstant := SKILL_COOKING;
Objects := [COOKSPOT_RANGE];
Items := [
[MSI_LoadFoodRange]
];
BankType := Bank;
WhichBank := MSI_BANK_VE;
CompassAng := 'S';
AutoObjects := @MSI_CookFullInv;
with PathInfo do
begin
StartLoc := LOC_VE_BANK;
EndLoc := LOC_VE_MINE;
Reflection := [
Point(0, 0)
];
// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;
end;
Result := (MSI_Scripts[whichScript].Name <> '');
end;
{******************************************************************************}
{ procedure MSI_LoadAllScripts; }
{ By: Coh3n }
{ Date: 28 July 2010 }
{ Description: Loads all the scripts into MSI_Scripts array; should only be }
{ called once in SetupMSI }
{******************************************************************************}
procedure MSI_LoadAllScripts;
var
i: Integer;
begin
for i := 0 to High(MSI_Scripts) do
MSI_LoadScript(i);
end;
Globals.Simba
{==============================================================================\
| MSI Group Scripting Include |
| Globals.scar |
|==============================================================================|
| Used to store all necessary global types, consts and vars |
| |
\_____________________________________________________________________________}
(**
* Abbreviations:
* - FS: Fishing Spot
* - GS: General Store
* - GE: Grand Exchange
* - VE: Varrock East
* - VW: Varrock West
* - FW: Falador West
* - FE: Falador East
* - CG: Castle Guards
* - DW: Dark Wizards
* - SO: Stronghold Of *
* - AK: Al Kharid
* - SW: Spinning Wheel
* - LB: Lumby
* - EV: EdgeVille
* - BV: Barbarian Village
* - DB: Draynor Bank
* - RM: Rimmington
* - PS: Port Sarim
* - SV: Seers Village
*)
{==============================================================================\
| Constants |
\==============================================================================}
(**
* All of MSI's suppoted script constants; used in player setup
*)
const
// Woodcutting
SCRIPT_POWER_CHOP = 10;
SCRIPT_VE_TREES = 11;
SCRIPT_VE_OAKS = 12;
SCRIPT_GE_YEWS = 13;
SCRIPT_DB_WILLOWS = 14;
SCRIPT_DB_TREES = 15;
SCRIPT_DB_OAKS = 16;
SCRIPT_RM_YEWS = 17;
SCRIPT_PS_WILLOWS = 18;
SCRIPT_PS_YEWS = 19;
SCRIPT_SV_MAGICS = 20;
SCRIPT_SV_MAPLES = 21;
SCRIPT_SV_YEWS = 22;
SCRIPT_EV_YEWS = 23;
// Mining
SCRIPT_POWER_MINER = 30;
SCRIPT_VE_MINER = 31;
SCRIPT_VW_MINER = 32;
SCRIPT_LSW_MINER = 33;
SCRIPT_BBV_MINER = 34;
SCRIPT_RM_CLAY = 35;
SCRIPT_RM_TIN = 36;
SCRIPT_RM_COPPER = 37;
SCRIPT_RM_IRON_1 = 38;
SCRIPT_RM_IRON_2 = 39;
SCRIPT_RM_GOLD = 40;
// Fishing
SCRIPT_POWER_FISHER = 50;
SCRIPT_DB_FISHER = 51;
SCRIPT_BBV_FISHER = 52;
// Cooking
SCRIPT_VE_COOKER = 70;
SCRIPT_ARRAY_LENGTH = 70; // Change to the highest script constant
(**
* The constants that don't fit into any other category
*)
const
ANTI_BAN_CHANCE = 10; // The chance (in %) of performing antiban
BANK_SYMBOL_ACCURACY = 0.45; // The symbol accuracy of the bank
TOLERANCE_FLAG = 15; // The amount of pixels from the flag to player
PATH_PLAYER = IncludePath + 'MSI\Player.txt'; // Path for the player remote file
PATH_REPORT = IncludePath + 'MSI\MSI Progress Reports\'; // Path for progress report
PATH_DEBUG = IncludePath + 'MSI\MSI Logs\'; // Path for debug
(**
* Represents the stats system's custom variable array indexes
*)
const
STATS_LINK = 'http://scriptmanager.freehostia.com/submit.php';
STATS_LOGINS = 1;
STATS_BANKS = 2;
STATS_LOADS = 3;
STATS_RANDOMS = 4;
STATS_LEVELS = 5;
STATS_EXP = 6;
STATS_LOGS = 7;
STATS_ORES = 8;
STATS_FISH = 9;
STATS_COOKS = 10;
STATS_BURNS = 11;
(**
* Represents all the possible player locations; used for the indexes in
* the MSI_Location global array
*)
const
// Undefined
LOC_POWER_SKILL = 0;
LOC_LOST = 1;
// Varrock
// East
LOC_VE_TREES = 10;
LOC_VE_OAKS = 11;
LOC_VE_BANK = 12;
LOC_VE_MINE = 13;
LOC_VE_RANGES = 14;
// West
LOC_VW_BANK = 15;
LOC_VW_MINE = 16;
// Grand Exchange
LOC_GE_BANK = 20;
LOC_GE_YEWS = 21;
// Draynor
LOC_DB_BANK = 30;
LOC_DB_WILLOWS = 31;
LOC_DB_TREES = 32;
LOC_DB_OAKS = 33;
LOC_DB_FISH = 34;
// Rimmington
LOC_RM_YEWS = 40;
LOC_RM_CLAY = 41;
LOC_RM_TIN = 42;
LOC_RM_COPPER = 43;
LOC_RM_IRON_1 = 44;
LOC_RM_IRON_2 = 45;
LOC_RM_GOLD = 46;
// Falador
LOC_FE_BANK = 50;
// Port Sarim
LOC_PS_WILLOWS = 60;
LOC_PS_YEWS = 61;
LOC_PS_DBOX = 62;
// Lumbridge
LOC_LSW_MINE = 70;
LOC_LSE_MINE = 71;
// Edgeville
LOC_EV_BANK = 80;
LOC_EV_YEWS = 81;
// Barbarian Village
LOC_BBV_MINE = 90;
LOC_BBV_FISH = 91;
// Seers Village
LOC_SV_MAGICS = 100;
LOC_SV_BANK = 101;
LOC_SV_MAPLES = 102;
LOC_SV_YEWS = 103;
LOC_ARRAY_LENGTH = 101; // Change to the highest location constant
(**
* Color constants used in MSI's custom autocoloring functions
*)
const
COLOR_ROAD_GENERAL = 6579821;
COLOR_ROAD_VARROCK = 8686729;
COLOR_ROAD_FALLY = 7831173;
COLOR_ROAD_LUMBY = 8225677;
COLOR_ROAD_DIRT = 1853272;
COLOR_BANKER = 1179390;
COLOR_WATER = 10850700;
COLOR_ROCK = 5789528;
COLOR_TREE = 1532978;
COLOR_SAND = 0;
(**
* 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_TREE_4 = 3;
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_VE_BANK_4 = 9;
WALK_WC_DB_WILLOWS_1 = 10;
WALK_WC_DB_WILLOWS_BANK_1 = 11;
(** //////////// MY CHANGES HERE ///////////////////////////
* My color walking for Varrock West Mine
*)
WALK_MN_VW_1 = 12;
WALK_MN_VW_2 = 13;
WALK_MN_VW_3 = 14;
WALK_MN_VW_4 = 15;
WALK_MN_VW_5 = 16;
WALK_MN_VW_BANK_1 = 17;
WALK_MN_VW_BANK_2 = 18;
WALK_MN_VW_BANK_3 = 19;
WALK_MN_VW_BANK_4 = 20;
WALK_MN_VW_BANK_5 = 21;
(**
* All the different indexes for MSI_WalkInfo global variable; each index is
* used in MSI_WalkTPA by 3Garrett3 in Walking_Color.simba
*)
const
WALK_VE_MINE_1 = 10;
WALK_VE_MINE_2 = 11;
WALK_ARRAY_LENGTH = 21; // Change to the highest walk constant
//////////// MY CHANGES HERE ///////////////////////////
(**
* Constants used for MSI_WalkTPA for splitting and sorting methods
*)
const
SPLIT_TPA_TO_ATPA = 0;
SPLIT_TPA_TO_ATPA_EX = 1;
SPLIT_SPLIT_TPA = 2;
SPLIT_SPLIT_TPA_EX = 3;
SORT_ATPA_FROM = 0;
SORT_FIRST_LARGE = 1;
SORT_FIRST_SMALL = 2;
(**
* All the different color minimap areas used for relocating
*)
const
AREA_GE_YEWS_1 = 10;
AREA_GE_YEWS_2 = 11;
AREA_RM_YEWS_1 = 20;
AREA_RM_YEWS_2 = 21;
AREA_EV_YEWS_1 = 30;
AREA_EV_YEWS_2 = 31;
AREA_ARRAY_LENGTH = 31; // Change to the highest area constant
(**
* Constants used for (D)DTMs in ItemInfo.scar; each point constant corresponds
* to the TPointArray returned in MSI_GetDTMPoints();
*)
const
DTM_TOLERANCE = 15;
DTM_POINT_1 = 0;
DTM_POINT_2 = 1;
DTM_POINT_3 = 2;
DTM_POINT_4 = 3;
DTM_POINT_5 = 4;
(**
* Represents the required level to use the different tools
*)
const
// Hatchets and pickaxes
REQ_BRONZE = 1;
REQ_IRON = 1;
REQ_STEEL = 6;
REQ_MITHRIL = 21;
REQ_ADAMANT = 31;
REQ_RUNE = 41;
REQ_DRAGON = 61;
REQ_MAX_LEVEL = 99;
(**
* All the different items used throughout the MSI scripts
*)
const
PICKAXE_BRONZE = 10;
PICKAXE_IRON = 11;
PICKAXE_STEEL = 12;
PICKAXE_MITHRIL = 13;
PICKAXE_ADAMANT = 14;
PICKAXE_RUNE = 15;
PICKAXE_DRAGON = 16;
HATCHET_BRONZE = 20;
HATCHET_IRON = 21;
HATCHET_STEEL = 22;
HATCHET_MITHRIL = 23;
HATCHET_ADAMANT = 24;
HATCHET_RUNE = 25;
HATCHET_DRAGON = 26;
LOGS_NORMAL = 30;
LOGS_OAK = 31;
LOGS_WILLOW = 32;
LOGS_MAPLE = 33;
LOGS_YEW = 34;
LOGS_MAGIC = 35;
ORE_CLAY = 40;
ORE_COPPER = 41;
ORE_TIN = 42;
ORE_IRON = 43;
ORE_SILVER = 44;
ORE_COAL = 45;
ORE_GOLD = 46;
ORE_MITHRIL = 47;
ORE_ADAMANTITE = 48;
ORE_RUNITE = 49;
FISH_SMALLNET = 60;
FISH_CRAYPOT = 61;
FISH_ROD_BAIT = 62;
FISH_BAIT = 63;
FISH_ROD_FLY = 64;
FISH_HARPOON = 65;
FISH_CAGE = 66;
FISH_RAW_SHRIMP = 70;
FISH_RAW_CRAYFISH = 71;
FISH_RAW_SARDINE = 72;
FISH_RAW_HERRING = 73;
FISH_RAW_ANCHOVIE = 74;
FISH_RAW_TROUT = 75;
FISH_RAW_PIKE = 76;
FISH_RAW_SALMON = 77;
FISH_RAW_TUNA = 78;
FISH_RAW_LOBSTER = 79;
FISH_RAW_SWORDFISH = 80;
FISH_COOKED_SHRIMP = 100;
FISH_COOKED_CRAYFISH = 101;
FISH_COOKED_SARDINE = 102;
FISH_COOKED_HERRING = 103;
FISH_COOKED_ANCHOVIE = 104;
FISH_COOKED_TROUT = 105;
FISH_COOKED_PIKE = 106;
FISH_COOKED_SALMON = 107;
FISH_COOKED_TUNA = 108;
FISH_COOKED_LOBSTER = 109;
FISH_COOKED_SWORDFISH = 110;
GEM_SAPPHIRE = 120;
GEM_EMERALD = 121;
GEM_RUBY = 122;
GEM_DIAMOND = 123;
MISC_BIRD_NEST = 130;
MISC_FEATHER = 131;
STAFF_AIR = 150;
STAFF_WATER = 151;
STAFF_EARTH = 152;
STAFF_FIRE = 153;
ITEM_ARRAY_LENGTH = 153; // Change to the highest item constant
(**
* All the different objects used throughout the MSI scripts
*)
const
TREE_NORMAL = 10;
TREE_OAK = 11;
TREE_WILLOW = 12;
TREE_MAPLE = 13;
TREE_YEW = 14;
TREE_MAGIC = 15;
ROCK_CLAY = 20;
ROCK_TIN = 21;
ROCK_COPPER = 22;
ROCK_IRON = 23;
ROCK_SILVER = 24;
ROCK_COAL = 25;
ROCK_GOLD = 26;
ROCK_MITHRIL = 27;
ROCK_ADAMANTITE = 28;
ROCK_RUNITE = 29;
MSI_BANK_VE = 30; // Includes the 'MSI_' because there are bank constants in SRL's Bank.scar
MSI_BANK_VW = 31;
MSI_BANK_DB = 32;
MSI_BANK_GE = 33;
MSI_BANK_FE = 34;
MSI_BANK_EV = 35;
MSI_BANK_SV = 36;
DBOX_PS = 40;
FISHSPOT_NET = 50;
FISHSPOT_BAIT = 51;
FISHSPOT_LURE = 52;
FISHSPOT_CAGE = 53;
FISHSPOT_HARPOON = 54;
COOKSPOT_FIRE = 60;
COOKSPOT_RANGE = 61;
OBJ_BIRD_NEST = 70;
BIRD_NEST_CBMESSAGE = 'nest falls out of';
OBJ_ARRAY_LENGTH = 70; // Change to the highest object constant
(**
* Constants representing all the different spells
*)
const
SPELL_WIND_STRIKE = 0;
SPELL_WIND_BOLT = 1;
SPELL_WIND_BLAST = 2;
SPELL_WIND_WAVE = 3;
SPELL_WATER_STRIKE = 4;
SPELL_WATER_BOLT = 5;
SPELL_WATER_BLAST = 6;
SPELL_WATER_WAVE = 7;
SPELL_EARTH_STRIKE = 8;
SPELL_EARTH_BOLT = 9;
SPELL_EARTH_BLAST = 10;
SPELL_EARTH_WAVE = 11;
SPELL_FIRE_STRIKE = 12;
SPELL_FIRE_BOLT = 13;
SPELL_FIRE_BLAST = 14;
SPELL_FIRE_WAVE = 15;
SPELL_STATE_CONFUSE = 16;
SPELL_STATE_WEAKE = 17;
SPELL_STATE_CURSE = 18;
SPELL_STATE_BIND = 19;
SPELL_TELE_HOME = 20;
SPELL_TELE_VARROCK = 21;
SPELL_TELE_LUMBY = 22;
SPELL_TELE_FALLY = 23;
SPELL_ALCH_LOW = 24;
SPELL_ALCH_HIGH = 25;
SPELL_TELEGRAB = 26;
SPELL_SUPERHEAT = 27;
(**
* Used in MSI_AddToProggy in Debug.scar to determine what to add to the
* progress report
*)
const
PROG_ADD_EXP = 0;
PROG_ADD_ITEMS = 1;
PROG_ADD_LOADS = 2;
(**
* Used for any array indexes in DeclarePlayers
*)
const
L_BREAK = 0;
L_TOTAL = 1;
L_COUNT = 2;
{==============================================================================\
| Types |
\==============================================================================}
(**
* The type that holds all the attributes of any main screen objects used
* throughout MSI scripts
*)
type
TMSObject = record
X, Y : Integer;
Name : string;
UpText : string;
Option : string;
Exp : Extended;
Colors : TIntegerArray;
FindAllColors : Boolean; // Result False if not ALL colors are found
Tol : Integer;
Hue : Extended;
Sat : Extended;
W, H : Integer;
Accuracy : Integer; // Min pixels to be found
ExcludeSelf : Boolean; // Exclude pixels in a box, the box might need revamping / making it dynamic
RightClickOnly : Boolean;
Tries : Integer;
Anim : Boolean; // Result False if not animating
WaitToMove : Boolean; // When ClickLeft, wait till we have stopped moving?
BadColors : TIntegerArray;
BadColorTolerance: Integer;
AssociatedItems : TVariantArray;
end;
TMSObjectArray = array of TMSObject;
(**
* Stores all the attributes of each item used in MSI scripts
*)
type
TItem = record
Name : string;
UpText : TStringArray;
InvSlot : Integer;
Stackable: Boolean;
Colors : TIntegerArray;
Tol : Integer;
DTM : Integer;
end;
TItemArray = array of TItem;
(**
* Stores all the attributes of each recipe.
*)
type
TRecipe = record
Name : string;
Ingredients : TIntegerArray;
MemberOnly : Boolean;
Level : Integer;
Place : Integer;
XPGain : Extended;
end;
TRecipeArray = array of TRecipe;
(**
* Used in the banking functions to determine the type of bank
*)
type
TBank = (Bank, DBox, NoBank);
(**
* Stores all the different path information. Used in the TScript type
*)
type
TPath = record
StartLoc : Integer;
EndLoc : Integer;
Reflection : TPointArray;
ColorTo : TIntegerArray;
ColorFrom : TIntegerArray;
ObstaclePoints: TPointArray;
Obstacles : TIntegerArray;
DoObstacles : array of function(Obstacle: Integer): Boolean;
end;
(**
* Stores all the necessary script information for ease of adding new scripts
*)
type
TScript = record
// All relative script information
Name : string;
Constant : Integer;
Runtime : Integer;
SkillName : string;
SkillConstant: Integer; // The skill constants are in Players.scar (SRL)
Objects : TVariantArray; // The default objects to be autoed;
Items : array of TVariantArray;
BankType : TBank;
WhichBank : Integer;
CompassAng : Variant; // Ideal compass angle to auto at (-1 to leave as is)
AutoObjects : function: Boolean;
PlayerSetup : function: Boolean;
PathInfo : TPath;
// Used for progress reports; keeps track of player information
PlayerSkillLevel : Integer;
PlayerGainedExp : Integer;
PlayerLoads : Integer;
PlayerItemAmounts: array of TIntegerArray;
end;
TScriptArray = array of TScript;
(**
* Stores the necessary information for a player's progress report
*)
type
TProggy = record
PlayerName : string;
PlayerStatus: Boolean;
FalseReason : string;
PlayerLoc : Integer;
PlayerTime : Integer;
LoadsDone : Integer;
ScriptInfo : TScriptArray;
end;
TProggyArray = array of TProggy;
(**
* MSI's custom player record; used to setup each player. TUser can be found in
* SRL (Players.scar)
*)
type
TPlayerInfo = record
Name : string;
Pass : string;
Nick : string;
Pin : string;
Active : Boolean;
Member : Boolean;
Location : Integer;
Scripts : TIntegerArray;
Objects : array of TVariantArray;
Priority : array of TVariantArray;
DontDrop : TIntegerArray;
Loads : array[0..(L_COUNT - 1)] of Integer;
Items : array of array of TVariantArray;
ItemNames : array of array of TStringArray;
Experiences: array of array of TExtendedArray;
end;
TPlayerInfoArray = array of TPlayerInfo;
(**
* A record that stores all the properties of the different MSI player
* locations. Used in the MSI relocater
*)
type
TLocation = record
Name : string;
Constant : Integer;
AtBank : Boolean;
RelocatePoints: TPointArray; // Reflection tiles
RelocateAreas : TIntegerArray; // Area constants
RelocateDist : Integer; // Min distance (in pixels) for the player to be from the relocation point
end;
(**
* A record that stores all the color properties for relocating to certain
* locations. Used in the MSI relocater
*)
type
TMMColorArea = record
Name : string;
Symbol : string;
DTM : Integer;
W, H : Integer;
Colors : TIntegerArray;
Tolerances : TIntegerArray;
Counts : TIntegerArray;
Bounds : TBox;
end;
TMMColorAreaArray = array of TMMColorArea;
(**
* A record that stores all the color properties for individual points for
* walking paths
*)
type
TWalkInfo = record
Name : string;
Color : Integer;
Tolerance : Integer;
SplitMethod : Integer; // See the split method constants
SortMethod : Integer; // See the sort method constants
Filter : Boolean; // Use FilterPointsPie?
CTS2 : Boolean; // Use ColorToleranceSpeed 2?
HueMod : Extended;
SatMod : Extended;
StartRadial : Integer;
EndRadial : Integer;
MinRadius : Integer;
MaxRadius : Integer;
SortPoint : TPoint; // Point to sort from (for SortTPAFrom only)
SplitDist : Integer; // For TPAToATPA/SplitTPA only
W, H : Integer; // For TPAToATPAEx/SplitTPAEx only
end;
TWalkInfoArray = array of TWalkInfo;
{==============================================================================\
| Variables |
\==============================================================================}
(**
* Miscellaneous variables used throughout the include
*)
var
ProgressReportArray: TProggyArray;
CurrentScript : Integer;
ReflectionBroken : Boolean;
MSIRev : string;
ScriptStart : string;
NextAntiban : Integer;
(**
* Arrays that store all the necessary "go-to" information for MSI
*)
var
MSI_Players : TPlayerInfoArray;
MSI_Items : array[0..ITEM_ARRAY_LENGTH] of TItem;
MSI_Objects : array[0..OBJ_ARRAY_LENGTH] of TMSObject;
MSI_Locations : array[0..LOC_ARRAY_LENGTH] of TLocation;
MSI_Scripts : array[0..SCRIPT_ARRAY_LENGTH] of TScript;
MSI_ColorAreas: array[0..AREA_ARRAY_LENGTH] of TMMColorArea;
MSI_WalkInfo : array[0..WALK_ARRAY_LENGTH] of TWalkInfo;
(**
* The global variables used throughout the stats system (Stats.scar)
*)
var
Stats_UserID : string;
Stats_Password : string;
Stats_ScriptID : string;
Stats_LastTime : Integer;
Stats_CustomVars: array [1..20] of Integer;