From: masterBB
[00:10:19] Fish Spot was found, but was not on MS after attempts to relocate
[00:10:26] Script failed at: WalkToDock
3Garrett3's Fisherer 0.5 Progress Report
*********************************************
Ran for: 2 Minutes and 30 Seconds
Fished : 24 Total Fish
Fished : 17 Tuna
Fished : 7 Swords
*********************************************
0: upah | 24 Fish | 0 Loads | 0 Levels | 0 Experience|
1: | 0 Fish | 0 Loads | 0 Levels | 0 Experience|
2: | 0 Fish | 0 Loads | 0 Levels | 0 Experience|
Successfully executed.
Don't look at the swordies/tuna thing… I picked up some tunas to test the walking and such, so I could go AFK… but it failed when it came back, standing at the right spot…
*********************************************
0: upah | 24 Fish | 1 Loads | 0 Levels | 2160 Experience|
1: | 0 Fish | 0 Loads | 0 Levels | 0 Experience|
2: | 0 Fish | 0 Loads | 0 Levels | 0 Experience|
[00:24:50] Fish Spot was found, but was not on MS after attempts to relocate
[00:24:50] Emergency Logout to recalibrate Fishing spot
Welcome to Runescape.
Supah******
143.857694864273
True
[00:25:18] Fish Spot was found, but was not on MS after attempts to relocate
[00:25:18] Fishing Spot not found
[00:25:18] Script failed at: FishingMain
Twice in a row?
But it worked 11 hours for me last night and 5 today, manual stops both times…
I don't understand..
Make sure you have the newest reflection and newest SRL.
Here is the newest version, I've only added sleeping, so I'm not going to attach it. The proggy will show the same version as before:
Program KARAMJAFisher;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include reflection/reflection.simba}
Const
AntiRandomz = 'C'; // 'R' or 'C' for reflection or colour antirandoms
Rest = True; // Rest or not, it will only rest when one player is active.
Debugg = True; // Debug?
RestingFor = 25 * 60 * 1000; // Just change the first number to change minutes
RestEvery = 90 * 60 * 1000; // Just change the first number to change minutes
Sleeping = False; // Do you want to sleep? Only needed for long runs
SleepingFor = 3 * 60 * 60 * 1000; // Change the first number to change hours
SleepEvery = 2 * 60 * 60 * 1000; // Change the first number to change hours
AntiBanzor = 85; // The percentage that it wont do antiban. Ie for 85, the script will do antiban 15% of the time.
Smart_World = 152; // The world that you wish you play on.
Members = False;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 1;
With Players[0] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 5; // How many loads to do, plus random 3.
Strings[0] := 'Harpoon'; // Net, Bait, Harpoon, Cage, Highest
Pin := '';
End;
With Players[1] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 5; // How many loads to do, plus random 3.
Strings[0] := 'Cage'; // Net, Bait, Harpoon, Cage, Highest
Pin := '';
End;
With Players[2] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 5; // How many loads to do, plus random 3.
Strings[0] := 'Bait'; // Net, Bait, Harpoon, Cage, Highest
Pin := '';
End;
End;
{DON'T TOUCH ANYTHING BELOW THIS!}
Const
ShrimpID = 317;
AnchovieID = 321;
SardineID = 327;
HerringID = 345;
TunaID = 359;
SwordsID = 371;
LobstersID = 377;
Version = '0.5';
Var
Shrimp, Anchovie, Sardines, Herring, Tuna, Swords, Lobsters, FishT, SorT, FishSpot: Integer; // Fish Related
Sleeped, SleepT, Sleeper, RAmount, BRTime, RTTime, StartLev, StartEx, LoadsDone: Integer; // Proggy Related
GearArray: TIntegerArray;
Path: Array Of TTileArray;
FishOption, ToFish: String;
Function TehTime: String;
Var
Hour, Mins, Sec, MSec: Word;
Begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Result := (Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2));
End;
Procedure Debug(Txt: String);
Begin
If Debugg Then
Writeln('[' + TehTime + '] ' + Txt);
End;
Procedure ScriptSettings;
Var
i: Integer;
Begin
GearArray := [-1, 995, 303, 307, 313, 311, 301, 360, 372, 378]; // Null, Coins, net, rod, bait, harpoon, lobby pot, noted tuna, swords, lobster
Case lowercase(ToFish) Of
'net':
Begin
FishSpot := 323;
FishOption := 'Net';
SorT := 0; // 0 is sell, 1 is trade;
SetLength(Path, 3);
For i := 0 To 2 Do
SetLength(Path[i], 5);
Path[0] := [Tile(2906, 3149), Tile(2915, 3155), Tile(2920, 3164),
Tile(2922, 3169), Tile(2924, 3176)]; // The beginning is the shop
Path[1] := [Tile(2906, 3149), Tile(2914, 3152), Tile(2920, 3160),
Tile(2923, 3167), Tile(2924, 3176)];
Path[2] := [Tile(2906, 3149), Tile(2915, 3156), Tile(2917, 3164),
Tile(2920, 3170), Tile(2924, 3176)];
End;
'bait':
Begin
FishSpot := 323;
FishOption := 'Bait';
SorT := 0; // 0 is sell, 1 is trade;
SetLength(Path, 3);
For i := 0 To 2 Do
SetLength(Path[i], 5);
Path[0] := [Tile(2906, 3149), Tile(2915, 3155), Tile(2920, 3164),
Tile(2922, 3169), Tile(2924, 3176)]; // The beginning is the shop
Path[1] := [Tile(2906, 3149), Tile(2914, 3152), Tile(2920, 3160),
Tile(2923, 3167), Tile(2924, 3176)];
Path[2] := [Tile(2906, 3149), Tile(2915, 3156), Tile(2917, 3164),
Tile(2920, 3170), Tile(2924, 3176)];
End;
'harpoon':
Begin
SorT := 1; // 0 is sell, 1 is trade;
FishSpot := 324;
FishOption := 'Harpoon';
SetLength(Path, 3);
For i := 0 To 2 Do
SetLength(Path[i], 8);
Path[0] := [Tile(2851, 3141), Tile(2861, 3147), Tile(2872, 3150),
Tile(2881, 3156), Tile(2890, 3162), Tile(2899, 3169),
Tile(2911, 3171), Tile(2925, 3176)]; // Beginning is Stiles
Path[1] := [Tile(2851, 3141), Tile(2861, 3146), Tile(2873, 3147),
Tile(2886, 3147), Tile(2893, 3155), Tile(2899, 3165),
Tile(2912, 3171), Tile(2925, 3176)];
Path[2] := [Tile(2851, 3141), Tile(2860, 3147), Tile(2873, 3151),
Tile(2879, 3158), Tile(2890, 3165), Tile(2900, 3171),
Tile(2912, 3172), Tile(2925, 3176)];
End;
'cage':
Begin
SorT := 1; // 0 is sell, 1 is trade;
FishSpot := 324;
FishOption := 'Cage';
SetLength(Path, 3);
For i := 0 To 2 Do
SetLength(Path[i], 8);
Path[0] := [Tile(2851, 3142), Tile(2861, 3147), Tile(2872, 3150),
Tile(2881, 3156), Tile(2890, 3162), Tile(2899, 3169),
Tile(2911, 3171), Tile(2924, 3176)]; // Beginning is Stiles
Path[1] := [Tile(2851, 3141), Tile(2861, 3146), Tile(2873, 3147),
Tile(2886, 3147), Tile(2893, 3155), Tile(2899, 3165),
Tile(2912, 3171), Tile(2924, 3175)];
Path[2] := [Tile(2851, 3141), Tile(2860, 3147), Tile(2873, 3151),
Tile(2879, 3158), Tile(2890, 3165), Tile(2900, 3171),
Tile(2912, 3172), Tile(2925, 3176)];
End;
End;
End;
Function Randomz: Boolean;
Begin
If Not LoggedIn Then Exit;
Case Lowercase(AntiRandomz) Of
'c':
Begin
Result := FindNormalRandoms;
If Not Result Then Result := R_FindRandoms;
FindNormalRandoms;
End;
'r':
Begin
Result := R_FindRandoms;
If Not Result Then Result := FindNormalRandoms;
R_FindRandoms;
End;
End;
End;
Function AntiBanz: Boolean;
Begin
If Not LoggedIn Then Exit;
If (RandomRange(0, 100) > AntiBanzor) Then
Begin
Randomz;
Case Random(10) Of
0, 2:
Begin
GameTab(21 + Random(17));
Wait(RandomRange(1000, 2000));
End;
1, 3, 5, 8:
Begin
Case Random(2) Of
0: SendArrowSilentWait(1, RandomRange(1500, 3000));
1: SendArrowSilentWait(3, RandomRange(1500, 3000));
End;
Wait(RandomRange(500, 1800));
End;
4, 6:
SleepAndMoveMouse(RandomRange(1250, 1750));
7:
PickupMouse;
9:
RandomMovement;
End;
GameTab(tab_Inv);
SetAngle(True);
Wait(100 + Random(50));
Randomz;
Result := True;
End;
End;
Function GetNPCsAtX(t: TTile): TNPCArray;
Var
i, h, c: Integer;
Index, TheNPCNode, TheNPC, TheNPCDef, TheBytes: Integer;
tmp_tile: TTile;
Begin
h := SmartGetFieldInt(0, hook_static_NPCCount) - 1;
SetLength(Result, h + 1);
For i := 0 To h Do
Try
Index := SmartGetFieldArrayInt(0, hook_static_NPCIndexArray, i);
TheNPCNode := SmartGetFieldArrayObject(0, hook_static_NPCNodes, i);
TheNPC := SmartGetFieldObject(TheNPCNode, hook_npcnode_GetNPC);
tmp_tile := Tile(
SmartGetFieldInt(0, hook_static_BaseX) +
SmartGetFieldInt(TheNPC, hook_animable_PixelX) / 512,
SmartGetFieldInt(0, hook_static_BaseY) +
SmartGetFieldInt(TheNPC, hook_animable_PixelY) / 512);
If (tmp_tile = t) Then
Begin
TheNPCDef := SmartGetFieldObject(TheNPC, hook_npc_NPCDef);
TheBytes := SmartGetFieldObject(TheNPCDef, hook_npcdef_GetName);
Result[c].Index := Index;
Result[c].ID := SmartGetFieldInt(TheNPCDef, hook_npcdef_GetID);
Result[c].Name := GetJavaString(TheBytes, 255);
Result[c].Actions := GetNPCActionArray(TheNPCDef);
Result[c].Tile.X := (SmartGetFieldInt(0, hook_static_BaseX) + (SmartGetFieldInt(TheNPC, hook_animable_PixelX) / 512));
Result[c].Tile.Y := (SmartGetFieldInt(0, hook_static_BaseY) + (SmartGetFieldInt(TheNPC, hook_animable_PixelY) / 512));
Result[c].Moving := (SmartGetFieldInt(TheNPC, hook_character_Motion) > 0);
Result[c].Animation := SmartGetFieldInt(TheNPC, hook_character_Animation);
Result[c].Height := iabs(SmartGetFieldInt(TheNPC, hook_character_GetHeight));
Result[c].HPRatio := SmartGetFieldInt(TheNPC, hook_character_HPRatio) * 100 / $FF;
Result[c].Fighting := (SmartGetFieldInt(TheNPC, hook_character_LoopCycleStatus) >
SmartGetFieldInt(0, hook_static_LoopCycle));
Result[c].Orientation := (SmartGetFieldInt(TheNPC, hook_character_Orientation) * 45) / 2048;
Result[c].Level := SmartGetFieldInt(TheNPCDef, hook_npcdef_GetLevel);
Result[c].Interacting := SmartGetFieldInt(TheNPC, hook_character_GetInteracting);
Inc(c);
End;
Finally
SmartFreeObject(TheNPCNode);
SmartFreeObject(TheNPC);
End;
SetLength(Result, c);
End;
Function GetNPCsOnTile(Tile: TPoint): TNPCArray;
Var
i, h, resCounter: Integer;
NPCs: TNPCArray;
Begin
NPCs := GetNPCs;
SetLength(Result, Length(NPCs));
h := High(NPCs);
For i := h Downto 0 Do
Begin
If (Not NPCs[i].Tile.X = Tile.X) Or (Not NPCs[i].Tile.Y = Tile.y) Then
Continue;
Result[resCounter] := NPCs[i];
Inc(resCounter);
End;
SetLength(Result, resCounter);
End;
function GetClosestNPC(var Obj: TNPC; TheVar: Variant): Boolean;
var
Objs, ObjsSort: array of TNPC;
begin
if not loggedin then exit;
try
begin
Objs := GetNPCsBy(TheVar);
ObjsSort := SortNPCs(Objs);
Obj := ObjsSort[0];
Result := True;
end;
except
Result := False;
end;
end;
Function CreateTileArray(Startx, Starty : Integer) : Array of Array of TTile;
var
i, j : Integer;
begin
SetLength(Result, 7);
For i := 0 to 6 do
SetLength(Result[i], 7);
For j := 0 To 6 Do
For i := 0 To 6 Do
Result[j][i] := Point(i + Startx, j + Starty);
end;
Function FindSpotTryOne(var Fishing: TNPC) : Boolean;
begin
Result := FindNPC(FishSpot, Fishing);
end;
Function FindSpotTryTwo(var Fishing: TNPC) : Boolean;
var
Fishs, FishsS : array of TNPC;
i : Integer;
begin
Fishing := NULL_NPC
Fishs := GetNPCs;
FishsS := SortNPCs(Fishs);
for i := 0 to High(FishS) do
if (FishsS[i].ID = FishSpot) then
begin
Fishing := FishsS[i];
Result := True;
Break;
end;
end;
Function FindSpotTryThree(var Fishing: TNPC) : Boolean;
var
i, h : Integer;
Potentials: Array Of TNPC;
begin
Potentials := GetNPCs;
h := High(Potentials);
For i := 0 To h Do
If (Potentials[i].Index = FishSpot) Then
Begin
Result := True;
Fishing := Potentials[i];
Break;
End;
end;
Function FindSpotTryFour(var Fishing: TNPC) : Boolean;
var
FishTiles: Array Of Array Of TTile;
i, j, h : Integer;
Potentials: Array Of TNPC;
Begin
SetLength(FishTiles, Length(CreateTileArray(2921, 3176)));
for i := 0 to High(FishTiles) do
SetLength(FishTiles[i], 7);
FishTiles := CreateTileArray(2921, 3176);
For j := 0 To 6 Do
For i := 0 To 6 Do
Begin
Potentials := getNPCsAtX(FishTiles[j][i]);
If Not Length(Potentials) = 0 Then
Begin
For h := 0 To High(Potentials) Do
If Potentials[h].Index = FishSpot Then
Begin
Result := True;
Fishing := Potentials[h];
Exit;
End;
End;
End;
end;
Function FindSpotTryFive(var Fishing: TNPC) : Boolean;
var
FishTiles: Array Of Array Of TTile;
i, j, h : Integer;
Potentials: Array Of TNPC;
Begin
SetLength(FishTiles, Length(CreateTileArray(2921, 3176)));
for i := 0 to High(FishTiles) do
SetLength(FishTiles[i], 7);
FishTiles := CreateTileArray(2921, 3176);
For j := 0 To 6 Do
For i := 0 To 6 Do
Begin
Potentials := GetNPCsOnTile(FishTiles[j][i]);
If Not Length(Potentials) = 0 Then
Begin
For h := 0 To High(Potentials) Do
If Potentials[h].Index = FishSpot Then
Begin
Result := True;
Fishing := Potentials[h];
Exit;
End;
End;
End;
end;
Function FindSpotTrySix(var Fishing: TNPC) : Boolean;
var
Fishs, FishsS : array of TNPC;
i : Integer;
begin
Fishing := NULL_NPC
Fishs := GetNPCsBy(FishSpot);
FishsS := SortNPCs(Fishs);
for i := 0 to High(FishS) do
if TileOnMS(FishsS[i].Tile, FishsS[i].Height) then
begin
Fishing := FishsS[i];
Result := True;
Break;
end;
end;
Function FindSpotTrySeven(var Fishing: TNPC) : Boolean;
begin
Fishing := Null_NPC;
Result := True;
If Not GetClosestNPC(Fishing, FishSpot) Then
Fishing := GetNPC(FishSpot);
If (Fishing = Null_NPC) then
Result := False;
end;
Function FindSpot(var Fishing: TNPC) : Boolean;
var
i : Integer;
begin
for i := 0 to 6 do
begin
case i of
0:
Result := FindSpotTryOne(Fishing);
1:
Result := FindSpotTryTwo(Fishing);
2:
Result := FindSpotTryThree(Fishing);
3:
Result := FindSpotTryFour(Fishing);
4:
Result := FindSpotTryFive(Fishing);
5:
Result := FindSpotTrySix(Fishing);
6:
Result := FindSpotTrySeven(Fishing);
end;
if Result then
begin
if i > 0 then
Debug('FishingSpotTry steps up to # ' + ToStr(i) + ' failed, but # ' + ToStr(i+1) + ' worked');
Break;
end;
end;
if (Result = False) then
Debug('Did not find fishing spot in 6 tries');
end;
Procedure RelocateToDock;
var
Dist : Integer;
begin
Dist := DistanceFrom(Tile(2925, 3176));
if (Dist > 2) then
WalkToTile(Tile(2924, 3180), 1, 0);
if (Random(2) = 1) then
SendArrowSilentWait(1, RandomRange(1500, 3000))
else
SendArrowSilentWait(3, RandomRange(1500, 3000));
R_MakeCompass(0);
end;
function FindFishSpot(var Fish: TNPC): Boolean;
var
FishMS: TPoint;
Timer : Integer;
begin
if not LoggedIn then Exit;
if not FindSpot(Fish) then
begin
RelocateToDock;
if not FindSpot(Fish) then
begin
Debug('Fishing Spot not found');
Result := False;
Exit;
end;
end;
if TileOnMS(Fish.Tile, Fish.Height) then
begin
FishMS := TileToMS(Fish.Tile, Fish.Height);
Mouse(FishMS.x, FishMS.y, 2, 2, False);
Wait(RandomRange(250, 750));
R_ChooseOption(FishOption);
R_Flag;
MarkTime(Timer);
while (TimeFromMark(Timer) < 10000) do
begin
Wait(RandomRange(750, 1250));
if (GetAnimation > 0) then break;
end;
Result := True;
Exit;
end else
if TileOnMS(Fish.Tile, 0) then
begin
FishMS := TileToMS(Fish.Tile, Fish.Height);
Mouse(FishMS.x, FishMS.y, 2, 2, False);
Wait(RandomRange(250, 750));
R_ChooseOption(FishOption);
R_Flag;
MarkTime(Timer);
while (TimeFromMark(Timer) < 10000) do
begin
Wait(RandomRange(750, 1250));
if (GetAnimation > 0) then break;
end;
Result := True;
Exit;
end;
Debug('Fish Spot was found, but was not on MS after attempts to relocate');
Result := False;
end;
Function FindIt : Boolean;
var
Fish: TNPC;
begin
if Randomz then
begin
Result := True;
Exit;
end;
Result := FindFishSpot(Fish);
if not Result then
Begin
Debug('Emergency Logout to recalibrate Fishing spot');
Logout;
Wait(RandomRange(5000,10000));
LoginPlayer;
if Randomz then
begin
Result := True;
Exit;
end;
RelocateToDock;
Result := FindFishSpot(Fish);
if not Result then
Begin
Debug('Fishing Spot not found');
Result := False;
Exit;
End;
end;
if Randomz then
begin
Result := True;
Exit;
end;
end;
Procedure WaitForIt;
var
FishingTime: Integer;
begin
MarkTime(FishingTime);
repeat
if not LoggedIn then break;
if not AntiBanz then
if Randomz then break;
Wait(RandomRange(1000, 2000));
if not (GetAnimation > 0) then
begin
Wait(RandomRange(500, 1000));
if not (GetAnimation > 0) then break;
end;
until (TimeFromMark(FishingTime) >= 60000);
end;
function Fishing: Boolean;
begin
if not LoggedIn then Exit;
Result := FindIt;
If not Result then Exit;
WaitForIt;
SetAngle(True);
end;
Function SpotFinder(Spot: Integer): Boolean;
Var
Objectum: TNPC;
Begin
Randomz;
Case Spot Of
0: // Dock
Begin
Result := FindFishSpot(Objectum);
If Result Then Exit;
Objectum := GetNPC(FishSpot);
Result := TileOnMS(Objectum.Tile, Objectum.Height);
If Result Then Exit;
If TileOnMM(Objectum.Tile) Then WalkToTile(Objectum.Tile, 1, 0);
Result := TileOnMS(Objectum.Tile, Objectum.Height);
If Result Then Exit;
Result := FindNPC(FishSpot, Objectum);
If Result Then
Begin
If Not TileOnMS(Objectum.Tile, Objectum.Height) Then
WalkToTile(Tile(2925, 3179), 1, 0);
Result := TileOnMS(Objectum.Tile, Objectum.Height);
End;
End;
1: //Shop
Begin
Objectum := GetNPC('Shop');
Result := TileOnMS(Objectum.Tile, Objectum.Height);
If Result Then Exit;
If TileOnMM(Objectum.Tile) Then WalkToTile(Objectum.Tile, 1, 0);
Result := TileOnMS(Objectum.Tile, Objectum.Height);
End;
2: // Stiles
Begin
Objectum := GetNPC('Stiles');
Result := TileOnMS(Objectum.Tile, Objectum.Height);
If Result Then Exit;
If TileOnMM(Objectum.Tile) Then WalkToTile(Objectum.Tile, 1, 0);
Result := TileOnMS(Objectum.Tile, Objectum.Height);
End;
End;
End;
Function AnyStep(Path: TTileArray; dir: Integer): Integer;
Var
i, h: Integer;
Begin
h := High(Path);
Case Dir Of
0: //Start looking at the end of it (Dock)
Begin
For i := h Downto 0 Do
Begin
If TileOnMM(Path[i]) Then
Begin
Result := i;
Exit;
End;
End;
End;
1: //Start at the beginning (Shop or Stiles)
Begin
For i := 0 To h Do
Begin
If TileOnMM(Path[i]) Then
Begin
Result := i;
Exit;
End;
End;
End;
End;
End;
Function WalkStep(Fails: Integer; Step: TTile; FinalStep: Boolean): Boolean;
Var
i, Dist: Integer;
Begin
If Not LoggedIn Then Exit;
i := 0;
For i := 0 To Fails Do
Begin
If Not LoggedIn Then break;
Case FinalStep Of
true:
Begin
WalkToTile(Step, 1, 1);
Wait(RandomRange(200, 400));
Dist := DistanceFrom(Step);
Result := (Dist < 4);
If Not Result Then inc(i);
If Result Then Break;
End;
false:
Begin
WalkToTile(Step, 2, 1);
Wait(RandomRange(200, 400));
Dist := DistanceFrom(Step);
Result := (Dist < 5);
If Not Result Then inc(i);
If Result Then Break;
End;
End;
End;
End;
Function NewWalk(Dir: Integer): Boolean;
Var
i, j, Start, Ending, Dist: Integer;
Begin
If Not LoggedIn Then Exit;
Randomz;
Case Dir Of
0:
Begin
SetRun(True);
Debug('Walking To Dock');
For j := 0 To 2 Do // 3 Paths
Begin
Start := AnyStep(Path[j], 0);
Ending := (High(Path[j]) - 1);
For i := Start To Ending Do
Begin
Result := WalkStep(2, Path[j][i], False); // If it makes it the whole way, one step away from last
If Not Result Then Break; // Breaks out and checks if it's close enough to walk to last step
End;
Result := WalkStep(2, Path[j][High(Path[j])], True);
If Result Then Break; // Doesn't move to next path
End;
Wait(RandomRange(250, 600));
Dist := DistanceFrom(Path[0][High(Path[0])]);
Debug('Distance to Dock := ' + ToStr(Dist));
Result := SpotFinder(0);
End;
1:
Begin
SetRun(False);
Debug('Walking To Shop/Trade');
For j := 0 To 2 Do
Begin
Start := AnyStep(Path[j], 1);
Ending := 1;
For i := Start Downto Ending Do
Begin
Result := WalkStep(2, Path[j][i], False);
If Not Result Then Break;
End;
Result := WalkStep(2, Path[j][0], True);
If Result Then Break;
End;
Wait(RandomRange(250, 600));
Dist := DistanceFrom(Path[0][0]);
Debug('Distance to Shop/Trade := ' + ToStr(Dist));
Result := SpotFinder(SorT + 1);
End;
End;
End;
Procedure DataCollecter;
Var
Me: TMe;
TempLev, TempEx, DifLev, DifEx: Integer;
Begin
If Not LoggedIn Then Exit;
Me := GetMe;
TempLev := GetSkillLevel(Skill_Fishing);
TempEx := GetXP(Skill_Fishing);
If (TempLev < 1) Then TempLev := GetSkillLevel(Skill_Fishing);
If (TempEx < 1) Then TempEx := GetXP(Skill_Fishing);
DifLev := TempLev - StartLev;
DifEx := TempEx - StartEx;
Inc(LoadsDone);
Inc(Players[CurrentPlayer].Integers[2]);
IncEx(Players[CurrentPlayer].Integers[3], DifLev);
IncEx(Players[CurrentPlayer].Integers[4], DifEx);
Debug('StartLev : ' + ToStr(StartLev) + ' StartXP : ' + ToStr(StartEx) + ' TempLev : ' + ToStr(TempLev) + ' TempXP : ' + ToStr(TempEx));
StartLev := TempLev;
StartEx := TempEx;
GameTab(tab_Inv);
End;
Procedure FishCount;
Var
DontCount: TIntegerArray;
i, j, Temp: Integer;
Begin
If Not LoggedIn Then Exit;
SetLength(DontCount, Length(GearArray));
DontCount := GearArray;
For i := 1 To 7 Do
Begin
Temp := 0;
For j := 1 To 28 Do
Begin
If Not (InIntArray(DontCount, GetItemIDAt(j))) Then
Begin
Case i Of
1:
Begin
Debug('FishCount : Looking for Sardines');
Temp := R_CountItemID(SardineID);
Debug('Found : ' + ToStr(Temp));
Sardines := Sardines + Temp;
IncEx(FishT, Temp);
IncEx(Players[CurrentPlayer].Integers[1], Temp);
Temp := 0;
SetLength(DontCount, (Length(DontCount) + 1));
DontCount[Length(DontCount) - 1] := SardineID;
End;
2:
Begin
Debug('FishCount : Looking for Herring');
Temp := R_CountItemID(HerringID);
Debug('Found : ' + ToStr(Temp));
Herring := Herring + Temp;
IncEx(FishT, Temp);
IncEx(Players[CurrentPlayer].Integers[1], Temp);
Temp := 0;
SetLength(DontCount, (Length(DontCount) + 1));
DontCount[Length(DontCount) - 1] := HerringID;
End;
3:
Begin
Debug('FishCount : Looking for Tuna');
Temp := R_CountItemID(TunaID);
Debug('Found : ' + ToStr(Temp));
Tuna := Tuna + Temp;
IncEx(FishT, Temp);
IncEx(Players[CurrentPlayer].Integers[1], Temp);
Temp := 0;
SetLength(DontCount, (Length(DontCount) + 1));
DontCount[Length(DontCount) - 1] := TunaID;
End;
4:
Begin
Debug('FishCount : Looking for Swords');
Temp := R_CountItemID(SwordsID);
Debug('Found : ' + ToStr(Temp));
Swords := Swords + Temp;
IncEx(FishT, Temp);
IncEx(Players[CurrentPlayer].Integers[1], Temp);
Temp := 0;
SetLength(DontCount, (Length(DontCount) + 1));
DontCount[Length(DontCount) - 1] := SwordsID;
End;
5:
Begin
Debug('FishCount : Looking for Lobster');
Temp := R_CountItemID(LobstersID);
Debug('Found : ' + ToStr(Temp));
Lobsters := Lobsters + Temp;
IncEx(FishT, Temp);
IncEx(Players[CurrentPlayer].Integers[1], Temp);
Temp := 0;
SetLength(DontCount, (Length(DontCount) + 1));
DontCount[Length(DontCount) - 1] := LobstersID;
End;
6:
Begin
Debug('FishCount : Looking for Shrimp');
Temp := R_CountItemID(ShrimpID);
Debug('Found : ' + ToStr(Temp));
Shrimp := Shrimp + Temp;
IncEx(FishT, Temp);
IncEx(Players[CurrentPlayer].Integers[1], Temp);
Temp := 0;
SetLength(DontCount, (Length(DontCount) + 1));
DontCount[Length(DontCount) - 1] := ShrimpID;
End;
7:
Begin
Debug('FishCount : Looking for Anchovies');
Temp := R_CountItemID(AnchovieID);
Debug('Found : ' + ToStr(Temp));
Anchovie := Anchovie + Temp;
IncEx(FishT, Temp);
IncEx(Players[CurrentPlayer].Integers[1], Temp);
Temp := 0;
SetLength(DontCount, (Length(DontCount) + 1));
DontCount[Length(DontCount) - 1] := AnchovieID;
End;
End;
Break;
End;
End;
End;
End;
Function LocateKeeper(var Keep : TNPC) : Boolean;
begin
Result := GetClosestNPC(Keep, 'Shop');
if Not Result then
Result := FindNPC('Shop', Keep);
end;
Function TradeKeeper(MS : TPoint) : Boolean;
begin
Mouse(MS.x, MS.y, 2, 2, False);
Wait(RandomRange(250, 750));
Result := R_ChooseOption('Trade');
end;
Function FindShopKeep: Boolean;
Var
Shop: TNPC;
ShopMS: TPoint;
Begin
If Not LoggedIn Then Exit;
Debug('FishCount');
FishCount;
R_Flag;
if Not LocateKeeper(Shop) then Exit;
If TileOnMS(Shop.Tile, Shop.Height) Then
Begin
Debug('Finding MS coords');
ShopMS := TileToMS(Shop.Tile, Shop.Height);
Result := TradeKeeper(ShopMS);
R_Flag;
if Not Result Then
begin
if LocateKeeper(Shop) then
begin
ShopMS := TileToMS(Shop.Tile, Shop.Height);
Result := TradeKeeper(ShopMS);
R_Flag;
end;
end;
End;
if (Result = False) then
Debug('Shop Keeper was not found');
End;
Procedure SellAllBut(ids: TIntegerArray; amount: Integer);
Var
h: Integer;
Begin
If Not LoggedIn Then Exit;
h := 0;
Debug('Starting selling');
For h := 1 To 28 Do
Begin
If ExistsItem(h) Then
If Not (InIntArray(IDs, GetItemIDAt(h))) Then
Begin
Debug('Item is not gear in slot #' + ToStr(h) + ', selling ' + GetItemNameAt(h));
Case Amount Of
1:
R_ClickItem(h, true, '');
5:
R_ClickItem(h, False, 'Sell 5');
10:
R_ClickItem(h, False, 'Sell 10');
50:
R_ClickItem(h, False, 'Sell 50');
End;
Wait(RandomRange(750, 1500));
End;
End;
End;
Function InvCountBut(IDs: TIntegerArray): Integer;
Var
i: Integer;
Begin
Result := 0;
For i := 1 To 28 Do
If Not (InIntArray(IDs, GetItemIDAt(i))) Then
Inc(Result);
End;
Function SellingStuffz: Boolean;
Begin
If Not LoggedIn Then Exit;
If Not (FindShopKeep) Then exit;
If Not ShopScreen Then
If Not (FindShopKeep) Then exit;
SellAllBut(GearArray, 50);
Result := (InvCountBut(GearArray) <= 1);
End;
Function FindStiles: Boolean;
Var
Stiles: TNPC;
StilesMS: TPoint;
Begin
If Not LoggedIn Then Exit;
FishCount;
Debug('Finding Stiles');
If Not GetClosestNPC(Stiles, 'Stiles') Then
Stiles := GetNPC('Stiles');
If Not TileOnMS(Stiles.Tile, Stiles.Height) Then
WalkToTile(Stiles.Tile, 1, 0);
If TileOnMS(Stiles.Tile, Stiles.Height) Then
Begin
R_Flag;
Debug('Finding MS coords');
StilesMS := TileToMS(Stiles.Tile, Stiles.Height);
Mouse(StilesMS.x, StilesMS.y, 2, 2, False);
Wait(RandomRange(250, 750));
If Not R_ChooseOption('Exchange') Then
Begin
If Not GetClosestNPC(Stiles, 'Stiles') Then
Stiles := GetNPC('Stiles');
StilesMS := TileToMS(Stiles.Tile, Stiles.Height);
Mouse(StilesMS.x, StilesMS.y, 2, 2, False);
Wait(RandomRange(250, 750));
Result := R_ChooseOption('Exchange');
R_Flag;
Exit;
End Else
Begin
R_Flag;
Result := True;
Exit;
End;
End;
Result := False;
Debug('Stiles wasn''t found');
End;
Function AfterFishes: Boolean;
Begin
If Not LoggedIn Then Exit;
Case SorT Of
0:
Result := SellingStuffz;
1:
Result := FindStiles;
End;
End;
Procedure Proggy;
Var
i: Integer;
Begin
//ClearDebug;
Writeln(' ');
Writeln('3Garrett3''s Fisherer ' + Version + ' Progress Report');
Writeln('*********************************************');
Writeln('Ran for: ' + TimeRunning);
If (FishT > 0) Then
Writeln('Fished : ' + ToStr(FishT) + ' Total Fish');
If (Shrimp > 0) Then
Writeln('Fished : ' + ToStr(Shrimp) + ' Shrimps');
If (Anchovie > 0) Then
Writeln('Fished : ' + ToStr(Anchovie) + ' Anchovies');
If (Sardines > 0) Then
Writeln('Fished : ' + ToStr(Sardines) + ' Sardines');
If (Herring > 0) Then
Writeln('Fished : ' + ToStr(Herring) + ' Herring');
If (Tuna > 0) Then
Writeln('Fished : ' + ToStr(Tuna) + ' Tuna');
If (Swords > 0) Then
Writeln('Fished : ' + ToStr(Swords) + ' Swords');
If (Lobsters > 0) Then
Writeln('Fished : ' + ToStr(Lobsters) + ' Lobsters');
If (RAmount > 0) Then
Begin
Writeln('Rested: ' + IntToStr(RAmount) + ' Times');
Writeln('Rested for: ' + MsToTime(RTTime, 0));
End;
If (Sleeped > 0) Then
Begin
Writeln('Slept: ' + IntToStr(Sleeped) + ' Times');
Writeln('Slept for: ' + MsToTime(SleepT, 0));
End;
Writeln('*********************************************');
For i := 0 To HowManyPlayers - 1 Do
Begin
Writeln(ToStr(i) + ': ' + Players[i].Nick + ' | ' + Players[i].Active + ' | ' + ToStr(Players[i].Integers[1]) + ' Fish | ' + ToStr(Players[i].Integers[2]) + ' Loads | ' + ToStr(Players[i].Integers[3]) + ' Levels | ' + ToStr(Players[i].Integers[4]) + ' Experience|');
End;
End;
Function Decider: Boolean;
Var
Net, Rod, Cage, Harpoon: Boolean;
NetI, RodI, CageI, HarpoonI: TInvItem;
Levelerer: Integer;
Begin
If Not (Lowercase(Players[CurrentPlayer].Strings[0]) = 'highest') Then
Begin
ToFish := Lowercase(Players[CurrentPlayer].Strings[0]);
Result := True;
Exit;
End;
Net := R_ItemIDExists(NetI, 303);
Rod := R_ItemIDExists(RodI, 307);
If Rod Then Rod := R_ItemIDExists(RodI, 313); // Need bait too.
Cage := R_ItemIDExists(CageI, 301);
Harpoon := R_ItemIDExists(HarpoonI, 311);
Levelerer := StartLev;
If Cage Then
Begin
If Levelerer >= 40 Then
Begin
ToFish := 'Cage';
Result := True;
Debug('Fishing for Lobster');
Exit;
End;
End;
If Harpoon Then
Begin
If Levelerer >= 35 Then
Begin
ToFish := 'Harpoon';
Result := True;
Debug('Fishing for Tuna');
Exit;
End;
End;
Begin
If Levelerer >= 5 Then
Begin
ToFish := 'Bait';
Result := True;
Debug('Fishing for Sardines/Herring');
Exit;
End;
End;
If Net Then
Begin
ToFish := 'Net';
Result := True;
Debug('Fishing for Shrimp');
Exit;
End;
Result := False;
Writeln('Decider couldnt find the correct gear/level combination');
End;
Function GearCheck(Skill : String) : Boolean;
var
NetI, RodI, BaitI, CageI, HarpoonI: TInvItem;
begin
Case Lowercase(Skill) of
'net' :
Result := R_ItemIDExists(NetI, 303);
'bait':
Result := R_ItemIDExists(RodI, 307) and R_ItemIDExists(BaitI, 313);
'cage':
Result := R_ItemIDExists(CageI, 301);
'harpoon':
Result := R_ItemIDExists(HarpoonI, 311);
end;
If not Result then Debug('GearCheck failed, logging out');
end;
Procedure Failure(When : String);
begin
Debug('Script failed at: ' + When);
SaveScreenshot(ScriptPath + 'Fail(' + When + ').bmp');
Logout;
end;
Procedure SetupPlayer;
Begin
Wait(2000);
MarkTime(BRTime);
SetAngle(true);
R_MakeCompass('n');
SetRun(True);
StartLev := GetSkillLevel(Skill_Fishing);
StartEx := GetXP(Skill_Fishing);
If (StartLev < 1) Then StartLev := GetSkillLevel(Skill_Fishing);
If (StartEx < 1) Then StartEx := GetXP(Skill_Fishing);
Debug('StartLev : ' + ToStr(StartLev) + ' StartXP : ' + ToStr(StartEx));
GameTab(Tab_Inv);
LoadsDone := 0;
If Not Decider Then Failure('Decider');
If Not GearCheck(ToFish) Then Failure('GearCheckSetup');
If Not LoggedIn Then Exit;
ScriptSettings;
End;
Procedure Rester;
Var
RL, RH, R: Integer;
Begin
If Not LoggedIn Then Exit;
if Sleeping then
begin
if (TimeFromMark(Sleeper) >= SleepEvery) then
begin
RL := SleepingFor - ((SleepingFor / 100) * 10);
RH := SleepingFor + ((SleepingFor / 100) * 10);
R := RandomRange(RL, RH);
Debug('Sleeping For : ' + IntToStr(Round(R / 1000 / 60 / 60)) + ' hours');
Logout;
Wait(R);
Inc(Sleeped);
IncEx(SleepT, R);
BRTime := 0;
MarkTime(BRTime);
MarkTime(Sleeper);
LoginPlayer;
end;
end;
If (PlayersActive > 1) Then
Begin
If (LoadsDone >= (Players[CurrentPlayer].Integers[0] + Random(4))) Then
Begin
Writeln('Changing players instead of resting');
NextPlayer(True);
SetupPlayer;
End;
Exit;
End;
If Not Rest Then Exit;
If Not (TimeFromMark(BRTime) >= RestEvery) Then Exit;
Writeln('Player Resting');
RL := RestingFor - ((RestingFor / 100) * 20);
RH := RestingFor + ((RestingFor / 100) * 30);
R := RandomRange(RL, RH);
Debug('Resting For : ' + IntToStr(Round(R / 1000 / 60)) + ' minutes');
Logout;
Wait(R);
Inc(RAmount);
IncEx(RTTime, R);
BRTime := 0;
MarkTime(BRTime);
LoginPlayer;
End;
Procedure ScriptSetup;
Begin
ClearDebug;
Smart_Server := Smart_World;
Smart_Members := Members;
Smart_Signed := True;
Smart_SuperDetail := False;
ActivateClient;
SetupSRL;
SetupReflectionEx(true);
DeclarePlayers;
MarkTime(Sleeper);
End;
Begin
ScriptSetup;
LoginPlayer;
Wait(1500);
Repeat
SetupPlayer;
Repeat
If Not LoggedIn Then Break;
Repeat
If Not LoggedIn Then Break;
If Not GearCheck(ToFish) Then Failure('GearCheckMain');
If Not Fishing Then Failure('FishingMain');
Until (InvFull);
If Not LoggedIn Then Break;
R_MakeCompass(0);
If Not NewWalk(1) Then Failure('WalkToStore');
If Not AfterFishes Then Failure('AfterFishing');
If Not NewWalk(0) Then Failure('WalkToDock');
DataCollecter;
Rester;
Proggy;
Until (Not LoggedIn);
Players[CurrentPlayer].Active := False;
If AllPlayersInactive Then
TerminateScript;
NextPlayer(False);
Until (AllPlayersInactive)
End.
Just copy and paste that over your existing script and then it should be the same version that ran 11 hours for me..