Naike
2010-10-05 10:36:27
- Fishes on all spots
- Drops the fish
- If no fish spots are found, it'll look for the old ones
- Multiplayer
Written to be based on SRL/Reflection functions, so it'll will hardly ever break.
Have all the items needed to fish in the first two inventory spaces.
program PowerFisher;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
const
{---SMART Setup Constants---}
WORLD = 32;
MEMBERS = false;
SIGNED = true;
{---------------------------}
{
Have the rod/cage/harpoon in first inventory space.
If having bait/feathers have them in secound inventory space.
}
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Strings[0] := 'Lure'; {Cage, Harpoon, Net, Bait}
end;
var
FishingSpot: TTileArray;
DArr: TIntegerArray;
Procedure AntiBan;
var
a: Boolean;
begin
If Not LoggedIn then
Exit;
a := True;
Case Random(400)of
0..5: SleepAndMoveMouse(1000+Random(4000));
12: GameTab(RandomRange(tab_Combat, tab_Notes));
13..16: GameTab(tab_Inv);
17..35: MakeCompass(Random(361));
51..70: SetRun(True);
else a := False;
end;
If a then
DebugLn('Antiban..');
end;
Procedure AddToFishArr(Tile: TTile);
var
L: Integer;
begin
L := GetArrayLength(FishingSpot);
SetArrayLength(FishingSpot, L+1);
FishingSpot[L] := Tile;
end;
Function FindFishingSpot: Boolean;
var
NPCs: TNPCArray;
I: Integer;
begin
If Not LoggedIn then
Exit;
NPCs := SortNPCs(GetNPCsBy('Fishing spot'));
If (GetArrayLength(NPCs) < 1)then
Exit;
For I:=0 to High(NPCs)do
begin
If (Not InStrArr(Players[CurrentPlayer].Strings[0], NPCs[I].Actions, False))then
Continue;
If Not TileOnMS(NPCs[I].Tile, 0)then
begin
If FindNormalRandoms then
begin
Result := FindFishingSpot;
Exit;
end;
If Not WalkToTile(NPCs[I].Tile, 2, 0)then
Logout;
Exit;
end;
NPCs[I].Pixel := TileToMS(NPCs[I].Tile, 0);
MMouse(NPCs[I].Pixel.X, NPCs[I].Pixel.Y, 7, 7);
GetMousePos(NPCs[I].Pixel.X, NPCs[I].Pixel.Y);
Result := WaitUpText(Players[CurrentPlayer].Strings[0] + ' F', 150+Random(50));
Mouse(NPCs[I].Pixel.X, NPCs[I].Pixel.Y, 0, 0, Result);
If Result then
Break
else
begin
Result := WaitUpText(Players[CurrentPlayer].Strings[0], 150+Random(50));
If Result then
Break;
end;
end;
Flag;
Wait(700+Random(500));
If Result then
AddToFishArr(NPCs[I].Tile);
end;
Function isFishing: boolean;
begin
Result := (Not (GetAnimation = -1));
end;
Procedure WaitWhileFish;
begin
Repeat
FindNormalRandoms;
Wait(200+Random(200));
AntiBan;
Until(Not IsFishing)or(Not LoggedIn)or(InvFull);
end;
Procedure Fish;
var
C: Integer;
begin
If Not LoggedIn then
Exit;
If Not FindFishingSpot then
begin
Repeat
Wait(1400+Random(1000));
If FindNormalRandoms then
Break;
If GetArrayLength(FishingSpot) > 0 then
begin
WalkToTile(FishingSpot[Random(GetArrayLength(FishingSpot))], 0, 0);
If FindFishingSpot then
Break;
end;
Inc(C);
Until(C > 10)or(isFishing)or(FindFishingSpot);
If (C > 10)then
begin
LogOut;
Exit;
end;
end;
WaitWhileFish;
end;
Procedure NewPlayer;
begin
SetAngle(True);
GameTab(tab_Inv);
If Not Players[CurrentPlayer].Booleans[10] then
Players[CurrentPlayer].Integers[1] := R_GetSkillExperience(10);
Case LowerCase(Players[CurrentPlayer].Strings[0]) of
'bait', 'lure': DArr := [1, 2];
'cage', 'harpoon', 'net': DArr := [1];
end;
end;
Procedure ProgressReport;
var
I: Integer;
begin
ClearDebug;
For I:=0 to HowManyPlayers-1 do
Writeln('#' + ToStr(I) + ' - ' + Players[I].Nick + ' - Active: ' + ToStr(Players[I].Active) + ' - Fish: ' + ToStr(Players[I].Integers[0]) + ' - Experience: ' + ToStr(R_GetSkillExperience(10) - Players[I].Integers[1]));
end;
begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
DeclarePlayers;
If Not LoggedIn then
LoginPlayer;
NewPlayer;
Repeat
If Not LoggedIn then
begin
NextPlayer(False);
NewPlayer;
end;
ProgressReport;
Fish;
If InvFull then
begin
Wait(500+Random(2000));
DropAllExcept(DArr);
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + 28 - GetArrayLength(DArr);
end;
Until(AllPlayersInactive);
end.written in an hour/two, bugs may occur.
Bigger releases will be found in the members section in the future.