Gu3st...
2009-12-26 08:15:13
So… much… unneeded.. code…
Mining.scar
WoodCutting.scar
Fishing.scar
Mining.scar
var
Ore, PickAxe: Integer; // Random Handlers.
hc1, hc2, hc3, hc4, hc5: Integer; // Pickaxe colors.
NoPick, Wielding, EquipPick: Boolean; // Random Handler & Wielding.
//const GasColor = 8166047; //Reference color of gas.
var
arRockRecords: array of TAutoColorInfo;
const
rimmington_Clay = 0;
rimmington_Copper = 1;
rimmington_Tin = 2;
rimmington_Iron = 3;
rimmington_Gold = 4;
old_Clay = 5;
old_Copper = 6;
old_Tin = 7;
old_Iron = 8;
old_Coal = 9;
old_Mithril = 10;
old_Adamant = 11;
varrock_Clay = rimmington_Clay;
varrock_Copper = 12;
varrock_Tin = rimmington_Tin;
varrock_Iron = rimmington_Iron;
varrock_Silver = 13;
lumbridge_Copper = varrock_Copper;
lumbridge_Tin = rimmington_Tin;
lumbridge_Coal = 14;
lumbridge_Mithril = 15;
lumbridge_Adamant = 16;
falador_Clay = 17;
falador_Copper = varrock_Copper;
falador_Tin = rimmington_Tin;
falador_Iron = rimmington_Iron;
falador_Coal = 18;
falador_Mithril = lumbridge_Mithril;
falador_Adamant = lumbridge_Adamant;
{*******************************************************************************
function FindPickHeadColor: Boolean;
By: WT-Fakawi fixed by NaumanAkhlaQ
Description: Finds PickHead colors. Returns hc1, 2, 3, 4 & 5 for PickHead
finding of False when No Pick is in either GameTab(tab_Inv) or GameTab(5).
Sets Global variable NoPick.
*******************************************************************************}
function FindPickHeadColor: Boolean;
var
Pick, ix, iy: Integer;
curTab: Byte;
begin
Result := False;
if (not LoggedIn) then exit;
Pick := DTMFromString('78DA63FCC2C4C0F09C910115302291409A899' +
'981E1310135FF8830870368CE4B026A78816A5EE3570300F6B206' +
'B0');
NoPick := True;
curTab := GetCurrentTab;
GameTab(tab_Inv);
if (FindDTM(Pick, ix, iy, MIX1, MIY1, MIX2, MIY2)) then
begin
NoPick := False;
Wielding := False;
EquipPick := False;
end else
begin
GameTab(tab_Equip);
if (FindDTM(Pick, ix, iy, MIX1, MIY1, MIX2, MIY2)) then
begin
NoPick := False;
Wielding := True;
EquipPick := False;
end;
end;
if (not NoPick) then
begin
Wait(100 + Random(100));
MMouse(ix, iy, 0, 0);
Hc1 := GetColor(ix + 1, iy);
Hc2 := GetColor(ix + 2, iy - 1);
Hc3 := GetColor(ix + 6, iy - 1);
Hc4 := GetColor(ix + 12, iy + 1);
Hc5 := GetColor(ix + 16, iy);
srl_Warn('FindPickHeadColor', 'PickColors = [' + IntToStr(hc1) + ', ' + IntToStr(hc2) + ', '
+ IntToStr(hc3) + ', ' + IntToStr(hc4) + ', ' + IntToStr(hc5)+'];', warn_Debug);
Result := True;
end;
FreeDTM(Pick);
GameTab(curTab);
end;
{*******************************************************************************
Function CheckOre(OreX, OreY, RefColor, Tol: Integer): Integer;
By: Wizzup? and n3ss3s
Description: Checks the certain ore. Returns how many colors match.
*******************************************************************************}
function CheckOre(OreX, OreY, RefColor, Tol: Integer): Integer;
var
I: Integer;
begin
OreX := Max(OreX - 3, 0);
OreY := Max(OreY - 3, 0);
for I := 0 to 35 do
if SimilarColors(GetColor(OreX + (I mod 6), OreY + (I div 6)), RefColor, Tol) then
Inc(Result);
end;
{*******************************************************************************
function OreColorCount(OreX, OreY, RefColor, Tol, MinCount: LongInt): Boolean;
By: Wizzup?
Description: Checks the certain ore, uses CheckOre.
If Count >= MinCount, the result is true.
*******************************************************************************}
function OreColorCount(OreX, OreY, RefColor, tol, MinCount: LongInt): Boolean;
begin
Result := CheckOre(OreX, OreY, RefColor, tol) >= MinCount;
end;
{*******************************************************************************
function FindAllRocksRecord(var RockObjs: TPointArray; RockIndex: Integer; QuickSorting, RGBXYZCheck: Boolean): Boolean;
By: Sumilion
Description: Finds the rocks using SRL's Rock Records and returns the found objects in a TPA
*******************************************************************************}
function FindAllRocksRecord(var RockObjs: TPointArray; RockIndex: Integer; QuickSorting, RGBXYZCheck: Boolean): Boolean;
begin
try
Result := FindAllObjsRecord(RockObjs, arRockRecords[RockIndex], MSX1, MSY1, MSX2, MSY2, QuickSorting, RGBXYZCheck);
except
Writeln('RockIndex ''' + IntToStr(RockIndex) + ''' does not exist.');
end;
end;
{*******************************************************************************
function FindObjRockEx(var cx, cy: Integer; RockIndex: Integer; QuickSorting, RGBXYZCheck: Boolean): Boolean;
By: Sumilion
Description: Finds the rocks using SRL's Rock Records
*******************************************************************************}
function FindObjRockEx(var cx, cy: Integer; RockIndex: Integer; QuickSorting, RGBXYZCheck: Boolean): Boolean;
begin
try
Result := FindObjRecordEx(cx, cy, arRockRecords[RockIndex], MSX1, MSY1, MSX2, MSY2, QuickSorting, RGBXYZCheck);
except
Writeln('RockIndex ''' + IntToStr(RockIndex) + ''' does not exist.');
end;
end;
{*******************************************************************************
function FindObjRock(var cx, cy: Integer; RockIndex: Integer): Boolean;
By: Sumilion
Description: Finds the rocks using SRL's Rock Records
*******************************************************************************}
function FindObjRock(var cx, cy: Integer; RockIndex: Integer): Boolean;
begin
Result := FindObjRockEx(cx, cy, RockIndex, False, True);
end;
{*******************************************************************************
procedure LoadRockRecords;
By: Sumilion
Description: Loads the records for FindObjRock
*******************************************************************************}
procedure LoadRockRecords;
begin
SetLength(arRockRecords, 19);
with arRockRecords[rimmington_Clay] do
begin
Name := 'Clay';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 5017780;
HueMod := 0.02;
SatMod := 0.75;
LumTol := 19;
MinR := 101; MaxR := 215;
MinG := 86; MaxG := 187;
MinB := 58; MaxB := 138;
MinX := 9.66; MaxX := 49.83;
MinY := 9.94; MaxY := 51.24;
MinZ := 5.53; MaxZ := 30.94;
end;
with arRockRecords[rimmington_Copper] do
begin
Name := 'Copper';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 4225488;
HueMod := 0.02;
SatMod := 0.84;
LumTol := 18;
MinR := 133; MaxR := 237;
MinG := 82; MaxG := 169;
MinB := 47; MaxB := 127;
MinX := 13.44; MaxX := 52.38;
MinY := 11.45; MaxY := 47.37;
MinZ := 4.28; MaxZ := 26.13;
end;
with arRockRecords[rimmington_Tin] do
begin
Name := 'Tin';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 8027016;
HueMod := 0.07;
SatMod := 0.12;
LumTol := 18;
MinR := 87; MaxR := 181;
MinG := 81; MaxG := 169;
MinB := 80; MaxB := 169;
MinX := 8.51; MaxX := 39.91;
MinY := 8.68; MaxY := 40.56;
MinZ := 8.99; MaxZ := 42.78;
end;
with arRockRecords[rimmington_Iron] do
begin
Name := 'Iron';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 2371405;
HueMod := 0.07;
SatMod := 0.17;
LumTol := 8;
MinR := 51; MaxR := 103;
MinG := 31; MaxG := 64;
MinB := 23; MaxB := 48;
MinX := 2.08; MaxX := 7.79;
MinY := 1.81; MaxY := 6.61;
MinZ := 1.09; MaxZ := 3.57;
end;
with arRockRecords[rimmington_Gold] do
begin
Name := 'Gold';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 1093081;
HueMod := 0.02;
SatMod := 0.61;
LumTol := 17;
MinR := 129; MaxR := 252;
MinG := 105; MaxG := 210;
MinB := 16; MaxB := 68;
MinX := 14.44; MaxX := 63.62;
MinY := 15.08; MaxY := 66.54;
MinZ := 2.66; MaxZ := 14.82;
end;
with arRockRecords[old_Clay] do
begin
Name := 'Clay';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 4356501;
HueMod := 0.02;
SatMod := 0.26;
LumTol := 11;
MinR := 109; MaxR := 185;
MinG := 89; MaxG := 152;
MinB := 50; MaxB := 86;
MinX := 10.46; MaxX := 32.92;
MinY := 10.63; MaxY := 33.44;
MinZ := 4.52; MaxZ := 13.52;
end;
with arRockRecords[old_Copper] do
begin
Name := 'Copper';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 3692666;
HueMod := 0.03;
SatMod := 0.05;
LumTol := 10;
MinR := 89; MaxR := 155;
MinG := 64; MaxG := 112;
MinB := 40; MaxB := 72;
MinX := 6.49; MaxX := 20.17;
MinY := 6.09; MaxY := 18.72;
MinZ := 2.91; MaxZ := 8.53;
end;
with arRockRecords[old_Tin] do
begin
Name := 'Tin';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 6645102;
HueMod := 0.11;
SatMod := 0.05;
LumTol := 16;
MinR := 67; MaxR := 152;
MinG := 62; MaxG := 141;
MinB := 62; MaxB := 141;
MinX := 5.04; MaxX := 26.89;
MinY := 5.12; MaxY := 27.25;
MinZ := 5.41; MaxZ := 28.66;
end;
with arRockRecords[old_Iron] do
begin
Name := 'Iron';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 1844798;
HueMod := 0.06;
SatMod := 0.18;
LumTol := 11;
MinR := 27; MaxR := 96;
MinG := 17; MaxG := 59;
MinB := 12; MaxB := 45;
MinX := 0.72; MaxX := 6.86;
MinY := 0.66; MaxY := 5.80;
MinZ := 0.44; MaxZ := 3.24;
end;
with arRockRecords[old_Coal] do
begin
Name := 'Coal';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 1977645;
HueMod := 0.13;
SatMod := 0.14;
LumTol := 8;
MinR := 22; MaxR := 68;
MinG := 22; MaxG := 67;
MinB := 14; MaxB := 46;
MinX := 0.73; MaxX := 4.76;
MinY := 0.81; MaxY := 5.30;
MinZ := 0.55; MaxZ := 3.27;
end;
with arRockRecords[old_Mithril] do
begin
Name := 'Mithril';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 5256758;
HueMod := 0.04;
SatMod := 0.06;
LumTol := 19;
MinR := 16; MaxR := 92;
MinG := 16; MaxG := 92;
MinB := 24; MaxB := 135;
MinX := 0.56; MaxX := 12.61;
MinY := 0.55; MaxY := 11.68;
MinZ := 0.94; MaxZ := 24.50;
end;
with arRockRecords[old_Adamant] do
begin
Name := 'Adamant';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 4609861;
HueMod := 0.08;
SatMod := 0.05;
LumTol := 12;
MinR := 43; MaxR := 95;
MinG := 55; MaxG := 120;
MinB := 43; MaxB := 96;
MinX := 2.89; MaxX := 13.30;
MinY := 3.53; MaxY := 16.42;
MinZ := 2.89; MaxZ := 13.31;
end;
with arRockRecords[varrock_Copper] do
begin
Name := 'Copper';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 3890303;
HueMod := 0.03;
SatMod := 0.10;
LumTol := 11;
MinR := 88; MaxR := 165;
MinG := 64; MaxG := 120;
MinB := 41; MaxB := 78;
MinX := 6.41; MaxX := 23.27;
MinY := 6.05; MaxY := 21.64;
MinZ := 3.00; MaxZ := 9.99;
end;
with arRockRecords[varrock_Silver] do
begin
Name := 'Silver';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 7442074;
HueMod := 0.03;
SatMod := 0.26;
LumTol := 21;
MinR := 90; MaxR := 201;
MinG := 84; MaxG := 192;
MinB := 71; MaxB := 172;
MinX := 8.71; MaxX := 49.82;
MinY := 9.17; MaxY := 52.50;
MinZ := 7.42; MaxZ := 46.04;
end;
with arRockRecords[lumbridge_Coal] do
begin
Name := 'Coal';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 2372661;
HueMod := 0.15;
SatMod := 0.09;
LumTol := 7;
MinR := 31; MaxR := 74;
MinG := 31; MaxG := 74;
MinB := 21; MaxB := 51;
MinX := 1.24; MaxX := 5.73;
MinY := 1.38; MaxY := 6.43;
MinZ := 0.94; MaxZ := 3.97;
end;
with arRockRecords[lumbridge_Mithril] do
begin
Name := 'Mithril';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 6702662;
HueMod := 0.06;
SatMod := 0.07;
LumTol := 12;
MinR := 44; MaxR := 95;
MinG := 44; MaxG := 96;
MinB := 65; MaxB := 140;
MinX := 2.98; MaxX := 13.39;
MinY := 2.81; MaxY := 12.45;
MinZ := 5.52; MaxZ := 26.13;
end;
with arRockRecords[lumbridge_Adamant] do
begin
Name := 'Adamant';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 5531988;
HueMod := 0.10;
SatMod := 0.06;
LumTol := 10;
MinR := 62; MaxR := 105;
MinG := 78; MaxG := 132;
MinB := 62; MaxB := 106;
MinX := 5.72; MaxX := 16.39;
MinY := 6.99; MaxY := 20.22;
MinZ := 5.73; MaxZ := 16.42;
end;
with arRockRecords[falador_Clay] do
begin
Name := 'Coal';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 4557999;
HueMod := 0.02;
SatMod := 0.65;
LumTol := 12;
MinR := 126; MaxR := 205;
MinG := 104; MaxG := 169;
MinB := 59; MaxB := 98;
MinX := 14.60; MaxX := 41.08;
MinY := 14.92; MaxY := 41.73;
MinZ := 6.37; MaxZ := 17.21;
end;
with arRockRecords[falador_Coal] do
begin
Name := 'Coal';
UpText := 'Mine';
MaxDist := 13;
MinCount := 5;
Color := 2307124;
HueMod := 0.10;
SatMod := 0.17;
LumTol := 9;
MinR := 25; MaxR := 79;
MinG := 25; MaxG := 79;
MinB := 16; MaxB := 54;
MinX := 0.88; MaxX := 6.53;
MinY := 0.98; MaxY := 7.35;
MinZ := 0.66; MaxZ := 4.46;
end;
end;
{*******************************************************************************
procedure LoadMiningBitmaps;
By: Stupid3ooo
Description: Declares Mining Bitmap.
*******************************************************************************}
procedure LoadMiningBitmaps;
begin
PickAxe :=BitmapFromString(30, 14, 'z78DA3330A03E70C3010C' +
'0625C0EF36FAB8DC8D2C407F37D32E36A96B267D521DB56C19A8D' +
'C41B9FBDDA80406732C0F8F544A7C0C0E6CBA25AF641BD8B211BF' +
'AB28C94DB47039ADC307D3FDB42B2107674D34185A1400863DFCA' +
'8');
Ore := BitmapFromString(8, 11,
'564D42564D42564D42564D42564D42564D42000001000001564D42' +
'564D42564D42544A3B544A3B0000013D312254442F564D42564D42' +
'564D42564D420000012D2518443827584731564D42544A3B544A3B' +
'564D42000001201B124034257A6346564D42544A3B4D4438564D42' +
'000001483B297D6547806748564D42564D42544A3B564D42000001' +
'7D6547806748000001564D42564D42544A3B544A3B544A3B000001' +
'000001302020000001000001000001000001000001544A3B302020' +
'3020202D2518382D1E403425483B2951412D000001544A3B544A3B' +
'5847315C4A345E4D366552395E4D360000013020200000015C4A34' +
'5E4D3665523968543B655239000001302020000001');
end;
{*******************************************************************************
procedure SetupMining;
By: WT-Fakawi
Description: Loads Mining bitmap into memory.
*******************************************************************************}
procedure SetupMining;
begin
LoadMiningBitmaps;
LoadRockRecords;
end;WoodCutting.scar
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- Woodcutting routines --//
//-----------------------------------------------------------------//
// * function FindAxe: Boolean; // * by Sumilion, edited by Rasta Magician and EvilChicken!
// * function FindBirdsNest: Boolean; // * by Liquid and Starblaster100
// * procedure SetupWoodcutting; // * SRL
{*******************************************************************************
function FindAxe: Boolean;
By: Sumilion, edited by Rasta Magician and EvilChicken!
Description: Finds if there is an axe present. Axe can be wielded or unwielded.
Results name of found axe as uncapitalized string.
*******************************************************************************}
function FindAxe: string;
var
Ix, Iy: Integer;
I, InvAxe, WieldAxe, FoundAxe: Byte;
begin
Result := '';
if not LoggedIn then exit;
srl_LoadBitmaps([47, 48, 49, 50, 51, 52, 53, 54, 110]);
I := 0;
repeat
case GetCurrentTab of
tab_Equip: begin
for WieldAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54-WieldAxe + Integer(WieldAxe = 8) * 64),Ix, Iy, clBlack, 566, 285, 606, 327, 10) then
Break;
if I = 0 then
if not GameTab(tab_Inv) then exit;
Inc(I);
end;
tab_Inv: begin
for InvAxe := 0 to 8 do
if FindTransparentBitmapTolerance(srl_GetBitmap(54 - InvAxe + Integer(InvAxe = 8) * 64), Ix, Iy, clBlack, MIX1, MIY1, MIX2, MIY2, 10) then
Break;
if I = 0 then
if not GameTab(tab_Equip) then exit;
Inc(I);
end;
else
if not GameTab(tab_Equip) then exit;
end;
until I = 2;
if (InvAxe = 9) and (WieldAxe = 9) then
begin
Writeln('No axe was found.');
srl_FreeBitmaps;
Exit;
end;
FoundAxe := Min(WieldAxe, InvAxe);
case FoundAxe of
0: Result := 'dragon';
1: Result := 'rune';
2: Result := 'addy';
3: Result := 'mith';
4: Result := 'black';
5: Result := 'steel';
6: Result := 'iron';
7: Result := 'bronze';
8: Result := 'adze';
end;
WriteLn('Using ' + Capitalize(Result) + ' axe.');
srl_FreeBitmaps;
end;
{*******************************************************************************
function FindBirdsNest: Boolean;
By: Liquid and Starblaster100
Description: If a birds nest is found, it will pick it up
*******************************************************************************}
function FindBirdsNest: Boolean;
var
tries, x, y: Integer;
s: string;
begin
if (not (GetLastChatText(s))) then
LastChatter(s);
if (Pos(s, 'A bird') <> 0) then
begin
repeat
if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
begin
KeyDown(VK_LEFT);
Wait(700 + Random(500));
KeyUp(VK_LEFT);
Wait(400 + Random(300));
end;
if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
begin
x := 648;
y := 83;
tries := tries + 1;
FindColorSpiral(x, y, 241, 570, 5, 725, 155);
Mouse(x + 3, y + 3, 2, 2, True);
Flag;
Wait(200 + Random(100));
end;
if (FindObj(x, y, 'Take Bird', 3952984, 10)) or
(FindObj(x, y, 'Take Bird', 1713706, 10)) or
(FindObj(x, y, 'Take Bird', 1581604, 10)) then
begin
WriteLn('Birds Nest Found');
Wait(450 + Random(400));
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Flag;
Result := True;
Wait(500 + Random(300));
if (Screenshots) then
SaveScreenshot('Birds Nest - SRL - ' + IntToStr(GetTimeRunning) + '.bmp');
tries := tries + 100;
// Birdsnest := Birdsnest + 1;
Mouse(583, 226, 2, 2, False);
Wait(100 + Random(100));
ChooseOption('Examine');
Exit;
end;
until (FindObj(x, y, 'Take Bird', 3952984, 10)) or
(FindObj(x, y, 'Take Bird', 1713706, 10)) or
(FindObj(x, y, 'Take Bird', 1581604, 10)) or (tries > 5)
end;
end;
{*******************************************************************************
procedure SetupWoodcutting;
By: SRL
Description: Declares Global Bitmaps.
*******************************************************************************}
procedure SetupWoodcutting;
begin
end;
Fishing.scar
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- Fishing routines --//
//-----------------------------------------------------------------//
// * function FindFishingEquipmentColor(Equipment: string): Integer; // * by Dankness, rewritten by Wizzup? and edit by NaumanAkhlaQ
// * function FindFishSpotsTPA(var VTPA:TPointArray): Boolean; // * by Rasta Magician, fixed by Marpis
// * Function FindFishSpot(var xx, yy: integer; which: string): Boolean; // * By Rasta Magician
// * procedure SetupFishing; // * By SRL
{*******************************************************************************
Function FindFishingEquipmentColor(Equipment: String): Integer;
By: Dankness, rewritten by Wizzup? and edit by NaumanAkhlaQ
Description: Finds Net, Lobster Cage, Fishing Rod, Fly Fishing Rod or Harpoon color.
*******************************************************************************}
function FindFishingEquipmentColor(Equipment: string): Integer;
var
iX, iY: Integer;
Arr: TStringArray;
begin
Result := -1;
Arr := ['smallnet', 'fishingrod', 'flyfishingrod', 'cage', 'harpoon'];
if InStrArrEx(LowerCase(Equipment), Arr, iX) then
begin
if FindTransparentBitmapTolerance(srl_GetBitmap(iX + 42), iX, iY, clBlack, MIX1, MIY1, MIX2, MIY2, 25) then
begin
Result := GetColor(iX, iY);
srl_Warn('FindFishingEquipmentColor', 'Equipment found at ' + IntToStr(iX) +
', ' + IntToStr(iY) + '. Found color: ' + IntToStr(Result) + '.', warn_Debug);
end;
end else
srl_Warn('FindFishingEquipmentColor', '"' + Equipment + '" is an invalid equpment name!', warn_AllVersions);
end;
{*******************************************************************************
function FindFishSpotsTPA(var VTPA:TPointArray): Boolean;
By: Rasta Magician, fixed by Marpis
Description: Finds all possible Fish Spots and stores them in the given TPA
Returns true if found at least one, false if none
*******************************************************************************}
function FindFishSpotsTPA(var VTPA:TPointArray): Boolean;
var
TPA, tempTPA: TPointArray;
ATPA: T2DPointArray;
i, tmpCTS, VTPASize, T: Integer;
TP: TPoint;
begin
Result := False;
if (not LoggedIn) then exit;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 0.27);
T := GetSystemTime + 700;
repeat
FindColorsSpiralTolerance(MSCX, MSCY, tempTPA, 11117214, MSX1, MSY1, MSX2, MSY2, 3);
TPA := CombineTPA(tempTPA, TPA);
until(GetSystemTime > T);
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (Length(TPA) < 1) then exit;
VTPASize := 1;
SetLength(VTPA, 1);
ATPA := SplitTPA(TPA, 10);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
for i := 0 to High(ATPA) do
begin
TP := MiddleTPA(ATPA[i]);
VTPA[VTPASize - 1] := TP;
Inc(VTPASize);
SetLength(VTPA, VTPASize);
end;
Result := (VTPASize > 1);
end;
{*******************************************************************************
Function FindFishSpot(var xx, yy: integer; which: string): Boolean;
By: Rasta Magician
Description: Finds a fishing spot, according to your needs.
Stores (x, y) coordinates to the given variables.
which:
'harpoon' -> Harpoon fishing
'cage', 'lobster' -> Cage Fishing
'fly', 'flyfish' -> Fly Fishing
'rod', 'bait' -> Bait Fishing
'net' -> Net Fishing
*******************************************************************************}
Function FindFishSpot(var X, Y: Integer; Which: string): Boolean;
var
TPA: TPointArray;
s: string;
i: integer;
begin
if (not FindFishSpotsTPA(TPA)) then exit;
case lowercase(which) of
'harpoon': S := 'arpoon Fis';
'cage', 'lobster': S := 'age Fis';
'fly', 'flyfish': S := 'ure Fis';
'rod', 'bait': S := 'ait Fis';
'net': S := 'et Fis';
end;
for i := 0 to High(TPA) do
begin
MMouse(TPA[i].x, TPA[i].y, 5, 5);
if WaitUpText(S, 375) then
begin
GetMousePos(X, Y);
Wait(Random(100));
Result := True;
Exit;
end else
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
if WaitOptionEx(S, 'all', Nothing, 375) then
begin
ChooseOption('ancel');
Result := True;
Exit;
end;
ChooseOption('ancel');
end;
end;
end;
{*******************************************************************************
procedure SetupSRLFishing;
By:
Description: Loads Fishing Bitmaps into memory.
*******************************************************************************}
procedure SetupFishing;
begin
srl_LoadBitmapRange(41, 45);
end;