SRL Archive - MSI Archives

Draynor Fishing Color Walking


Camaro'

2010-09-28 22:48:25

Walking_Color.Simba



{******************************************************************************}
{ function MSI_FISH_DBPoints(Index: Integer): TPoint; }
{ By: The MSI Team }
{ Date: September 28th 2010 }
{ Description: Returns a point on the minimap depending on the specified }
{ location by 'index' }
{******************************************************************************}
function MSI_FISH_DBPoints(Index: Integer): TPoint;
var
TPA: tPointArray;
Auto, x, y, I: Integer;
begin
Result := Point(-1, -1);

case Index of
WALK_DB_FISH_1:
begin

Auto := MSI_AutoColorMM(COLOR_TREE);//Finds the closest color to the tree (mm)
TPA := MSI_CreateWalkTPA(x, y, Auto, 4, 4, 7);//TPA of that color
if Length(TPA) <> 0 then //If the tpa found something
begin
SortTPAFrom(TPA, Point(616, 157));//Sorts the tpa from somewhere near the bottom (south) of the minimap
for i := 0 to High(TPA) do//loop through all the points
begin
if not RS_onMinimap(TPA[i].x, TPA[i].y) then Continue;//Check if its on mm
Result := Point(TPA[i].x - 15, TPA[i].y);//We have our point
Exit;
end;
end;
end;
WALK_DB_FISH_BANK_1:
begin

Auto := MSI_AutoColorMM(COLOR_DB_BANK_FLOOR);//Finds the closest color to the bank floor (mm)
TPA := MSI_CreateWalkTPA(x, y, Auto, 9, 9, 8);//TPA of that color
if Length(TPA) <> 0 then //If the tpa found something
begin
SortTPAFrom(TPA, Point(MMCx, MMCy));//Sorts the tpa from closest to me
InvertTPA(TPA);//reverses it so that the furthest points are looped first
for i := 0 to High(TPA) do//loop through all the points
begin
if not RS_onMinimap(TPA[i].x, TPA[i].y) then Continue;//Check if its on mm
Result := Point(TPA[i].x - 9, TPA[i].y + 15);//We have our point
Exit;
end;
end;
end;
end;
end;


{******************************************************************************}
{ 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);
WALK_DB_FISH_1, WALK_DB_FISH_BANK_1:
Result := MSI_FISH_DBPoints(index);
end;
end;

________________________________________________


Scripts.Simba



SCRIPT_DB_FISHER:
with MSI_Scripts[whichScript] do
begin
Name := 'Draynor Village Fisher';
Constant := SCRIPT_DB_FISHER;
Tools := [TOOL_FISH];
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;

with PathInfo do
begin
StartLoc := LOC_DB_BANK;
EndLoc := LOC_DB_FISH;

Reflection := [
Point(3093, 3242), Point(3087, 3234),
Point(3087, 3228)
];

ColorTo := [
WALK_DB_FISH_1
];

ColorFrom := [
WALK_DB_FISH_BANK_1
];


// ObstaclePoints := [];
// Obstacles := [];
// DoObstacles := [];
end;
end;

________________________________________________


Globals.simba



COLOR_DB_BANK_FLOOR= 4077633;


WALK_DB_FISH_1 = 12;
WALK_DB_FISH_BANK_1 = 13;

NCDS

2010-09-28 23:02:17

I'll commit this in the morning if no one else has. After I test of course ;)

Nice job, and thank you.

Camaro'

2010-09-29 06:26:02

Well , you can add it but I suggest waiting until I perfect Walk to bank.

If you look at the progress report thread, look at the guy who went fishing.

Wizzup?

2010-09-29 09:49:20

Nice, I remember doing something like this two years ago, lots of fun. :)

Camaro'

2010-09-29 20:29:53

From: Wizzup?
Nice, I remember doing something like this two years ago, lots of fun. :)


What, draynor walking?


I haven't gotten around to completely perfecting GetInBank, all I was planning on doing was making an ATPA, and looping through the ATPA and checking each TPAS Bound Length and Width, and if the Length is > 10 and Width > 8 or so, then that is the bank.

Thank heavenguard for this idea :)

NCDS

2010-09-29 22:08:44

[QUOTE=Camaro';740020]What, draynor walking?


I haven't gotten around to completely perfecting GetInBank, all I was planning on doing was making an ATPA, and looping through the ATPA and checking each TPAS Bound Length and Width, and if the Length is > 10 and Width > 8 or so, then that is the bank.

Thank heavenguard for this idea :)

Why not make an ATPA of the bankers on the mini map, then add RandomRange(2, 5) pixels or something the the middle tpa of the ATPA and click there. That way you will have walked right to the bankers :)

That's similar to what I did with the VE walking, and that worked quite well for me.

Coh3n

2010-09-29 22:32:54

Nice work Camaro.

Glad someone's doing some color walking. :)

Camaro'

2010-09-30 07:20:33

From: NCDS
Why not make an ATPA of the bankers on the mini map, then add RandomRange(2, 5) pixels or something the the middle tpa of the ATPA and click there. That way you will have walked right to the bankers :)

That's similar to what I did with the VE walking, and that worked quite well for me.


I did that for varrock east color banking too, but Ill try that later today.

Coh3n

2010-10-03 21:34:51

How's this going Camaro?

I've also moved this to the fishing section.

Camaro'

2010-12-10 17:00:44

Rewriting this, cause I think I had a bug way back then.

Edit: Nevermind