Simba Code:
{$include_once GLX/GLXCore.Simba}
{$include_once GLX/Misc/Map.Simba}
{$include_once GLX/Misc/Smart.Simba}
{$include_once GLX/Misc/Graphics.Simba}
{$include_once GLX/Mouse.Simba}
{$include_once GLX/Login.Simba}
{$include_once GLX/Text.Simba}
{$include_once GLX/Bank.Simba}
{$include_once GLX/Inventory.Simba}
const
MyID = 648933015; //ID of your player.
var
T: TSmart;
Function FindFishingSpot: TPoint;
var
TPA: TPointArray;
I, X1, Y1, X2, Y2: Integer;
FishingSpots: glModelArray;
Begin
FishingSpots := glGetModels(2648051121);
Insert(glGetModels(203893359), FishingSpots);
Insert(glGetModels(2948843458), FishingSpots);
SetLength(TPA, Length(FishingSpots));
For I := 0 To High(FishingSpots) Do
Begin
TPA[I] := Point(FishingSpots[I].X, FishingSpots[I].Y);
End;
GLXViewPort(X1, Y1, X2, Y2);
SortTPAFrom(TPA, Point((X2 - X1) div 2, (Y2 - Y1) div 2));
If (Length(TPA) > 0) then
Result := TPA[0]
else
Result := Point(-1, -1);
End;
Function HasFeathersBait: Boolean;
Begin
Result := (Length(glGetTextures(80835, 2302754, 5)) > 0) or (Length(glGetTextures(36720, 460033, 5)) > 0);
End;
Function GetFishBoxes(Area: TBox): TBoxArray;
var
I, J: Integer;
Textures: glTextureArray;
Begin
Textures := glGetTextures(Area);
SetLength(Result, Length(Textures));
For I := 0 To High(Textures) do
Begin
If ((Textures[I].ID = 49470) and SimilarColors(Textures[I].ColourID, 1118479, 5))
or ((Textures[I].ID = 45900) and SimilarColors(Textures[I].ColourID, 724234, 5))
or ((Textures[I].ID = 62220) and SimilarColors(Textures[I].ColourID, 1249296, 5)) then
begin
Result[J] := Textures[I].Bounds;
Inc(J);
end;
End;
SetLength(Result, J);
End;
Procedure DropAll;
var
I: Integer;
Fish: TBoxArray;
Begin
While(True) Do
Begin
Fish := GetFishBoxes(GL_InvBounds);
If (Length(Fish) < 1) Then Exit;
For I := 0 To High(Fish) Do
Begin
MouseBox(Fish[I], MOUSE_RIGHT);
GL_ChooseOptionMulti(['Drop', 'rop', 'Dro']);
End;
End;
End;
Procedure MarkTime(var T: Integer);
Begin
T := GetSystemTime;
End;
Function TimeFromMark(T: Integer): Integer;
Begin
Result := GetSystemTime - T;
End;
function WaitFindMe(ID: Cardinal; WaitPerLoop, MaxTime: Integer): Boolean;
var
T: Integer;
begin
T := GetSystemTime + MaxTime;
while (GetSystemTime < T) do
begin
if (Length(glGetModels(ID)) > 0) then
begin
Result := True;
Exit;
end;
Wait(WaitPerLoop);
end;
end;
function WaitNotFindMe(ID: Cardinal; WaitPerLoop, MaxTime: Integer): Boolean;
var
T: Integer;
begin
T := GetSystemTime + MaxTime;
while (GetSystemTime < T) do
begin
if (Length(glGetModels(ID)) < 1) then
begin
Result := True;
Exit;
end;
Wait(WaitPerLoop);
end;
end;
Procedure MainLoop;
var
P: TPoint;
MeBox, AnimBox: TBox;
X1, Y1, X2, Y2: Integer;
Begin
GLXViewPort(X1, Y1, X2, Y2);
MeBox := IntToBox(((X2 - X1) div 2) - 30, ((Y2 - Y1) div 2) - 30, ((X2 - X1) div 2) + 30, ((Y2 - Y1) div 2) + 30);
AnimBox := IntToBox(MeBox.X1 + 10, MeBox.Y1 + 10, MeBox.X2 - 10, MeBox.Y2 - 10);
While(True) Do
Begin
If (Not GL_LoggedIn) Then Exit;
If (GL_InvFull) Then DropAll;
If (Not HasFeathersBait) Then Exit;
If WaitFindMe(MyID, 50, 1500) Then
Begin
P := FindFishingSpot;
writeln('Finding Fishing Spot: ' + ToStr(P));
If ((P.X > 0 and P.Y > 0)) Then
Begin
Mouse(P, 5, 5, MOUSE_RIGHT);
If (GL_ChooseOptionMulti(['Use-rod Fishing spot', 'Use-rod', 'rod Fishing spot'])) Then
WaitNotFindMe(MyID, 50, 2500);
End;
End;
End;
End;
begin
ClearDebug;
T.Create(1350, 650, '', ['OpenGL32.dll']);
GLXMapHooks(T.CurrentClient);
glDebug(GL_MODE_Models, 0, 0, 0, T.Width, T.Height);
T.GetGraphics().Clear;
//writeln(glGetModels(IntToBox(702, 306, 755, 356)));
DropAll;
MainLoop;
TerminateScript();
end.