Pascal Code:
Program new;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
Const
Debug = True;
Power = True;
WORLD = 16;
MEMBERS = false;
SIGNED = true;
Var Pin,Loc:String;
Banked,AntiBann,Dropped,Walked:Integer;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
End;
//To add multiplayer is really easy. Simply have more Players and use
//NextPlayer(True|False); (depending on if you want the player to be
//active or not.
//Example..
with Players[1] do //Notice it's Players[1] rather than Players[0]. ;)
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Active := True;
end;
//You can add as many as you want, really (there is a cap, but it'd be
//silly to have that many anyway. Usually it's around 1-4 players per
//script.
End;
Procedure DebugText(Text:String);
Begin
If Not Debug then Exit;
writeln(Text);
//I think it looks nicer as..
{
if(Debug)then
Writeln(Text);
}
//But it doesn't really matter. :p
End;
Procedure AntiBan;
Begin
FindNormalRandoms;//I'd have this in an antirandoms procedure too
Inc(AntiBann);
Case 10000 Of
0: RandomRClick;
2: PickUpMouse;
4: RandomMovement;
5: BoredHuman;
6: ExamineInv;
End;
End;
Procedure MyWait(Time:Integer);
Var I :integer;
Begin
MarkTime(I);
Repeat
AntiBan;
Wait(10+Random(70));
Until(TimeFromMark(I) >= Time)
End;
Function Fishing:Boolean;
Var NPCs : TNPCArray;
I,x,y : Integer;
FishSpot : TPoint;
Begin
If Not LoggedIn Then Exit;
If Not Loc = 'FishingSpot' Then Exit;//Loc should be Players[CurrentPlayer].Loc or something.
result := false;
NPCs := GetNPCsBy('Fishing spot')
If high(NPCs) > -1 Then // Should be -1, because a high of 0 means that one NPC was found, -1 means nothing was found
Begin
For i:= 0 To high(NPCs) Do
Begin
If (NPCs[i].Name = 'Fishing spot') Then
Begin
DebugText('Found Fishing spot');
If TileOnMS (NPCs[i].Tile, 0) Then
Begin
FishSpot := TileToMS(NPCs[i].Tile,5); //Height of five?
MMouse(FishSpot.x,FishSpot.y,3,3);
If R_IsUpText('Fishing spot') Then
Begin
GetMousePos(x,y);
If Not Random(15) = 5 Then
Begin
Mouse(x,y,0,0,true);
End Else
Begin
Mouse(x,y,0,0,False);
R_ChooseOption('ttac'); //ttac? Wouldn't it be 'ish' or something? :p
End;
Result := True;
Exit;
End else Begin
DebugText('Did not find fishspot uptext!');
Wait(750);//Add randomness even if it's not necessary. Get in the habbit.
End;
end else DebugText('Spot #'+inttostr(i)+' not on mainscreen [dont worry too much about this msg]');
End;
End;
End; DebugText('Warning, array has nothing in it');
End;
{Function CheckForRod:Boolean; Not Working not sure why
Var Waste:TInvenItem;
Begin
Result := False
If Not R_ItemIDExists(Waste,309) Then //Your IDs could be wrong?
If Not R_ItemIDExists(Waste,314) Then
Begin
DebugText('Problem No rod and/or feathers');
TerminateScript;
End Else
DebugText('Got Rod and feathers');
End;
}
Function LoadPath(Part,Where:Integer): TTileArray; //1 fishing spot to bank //2 fish spot to bank
Begin //I'd use constants for these.
Case Where Of //Also try using RandomizeTile();.
1: Case Part Of
0 : Result := [Point(3864, 2801), Point(3858, 2814), Point(3852, 2824),
Point(3846, 2831), Point(3843, 2842), Point(3848, 2854),
Point(3855, 2857)];
1 : Result := [Point(3862, 2800), Point(3853, 2807), Point(3849, 2815),
Point(3850, 2826), Point(3839, 2834), Point(3836, 2845),
Point(3834, 2856), Point(3836, 2869), Point(3847, 2860),
Point(3854, 2858)];
2 : Result := [Point(3862, 2800), Point(3858, 2812), Point(3857, 2821),
Point(3850, 2831), Point(3842, 2844), Point(3846, 2855),
Point(3854, 2857)];
End;
2 : Case Part Of
0 : Result := [Point(3848, 2855), Point(3843, 2847), Point(3841, 2835),
Point(3848, 2826), Point(3851, 2816), Point(3854, 2806),
Point(3860, 2802), Point(3866, 2795)];
1 : Result := [Point(3848, 2856), Point(3844, 2846), Point(3842, 2838),
Point(3846, 2828), Point(3847, 2816), Point(3850, 2804),
Point(3855, 2794), Point(3865, 2795)];
2 : Result := [Point(3848, 2852), Point(3845, 2847), Point(3846, 2836),
Point(3849, 2825), Point(3855, 2817), Point(3861, 2809),
Point(3864, 2797)];
End;
End;
End;
Function Walk(WhereTo:String):Boolean;
Begin
If Not LoggedIn Then Exit;
Inc(Walked);
If (WhereTo = 'Bank') Then
Begin
LoadPath(1,Random(3));
Loc := 'Bank' //Players[CurrentPlayer].Loc := 'Bank';
Exit;
End;
If (WhereTo = 'FishingSpot') Then
Begin
LoadPath(2,Random(3));
Loc := 'FishingSpot' //Players[CurrentPlayer].Loc := 'Bank';
Exit;
End;
writeln('walking failed stopping');
TerminateScript;
End;
Function WhenInvFull:Boolean;
Var Trout,Salmon,Stop:Boolean;
Begin
If Not LoggedIn Then Exit;
If Not InvFull Then Exit;
If Power Then
Begin
Salmon := False
Trout := False
Stop := False
Repeat
If Not R_ClickItemID(335,False,'Drop') Then
Trout := True;
Wait(500+Random(500));
If Not R_ClickItemID(331,False,'Drop') Then
Salmon := True;
Wait(500+Random(500));
If Trout And Salmon Then
Begin
Stop := True;
Inc(Dropped);
End;
Until(Stop);
End Else Begin //Banking
If Not Loc = 'Bank' Then
Walk('Bank');
R_OpenBankBooth('eb');
If R_PinScreen Then
InPin(Pin);
If R_BankScreen Then
Begin
R_DepositAllID(335);
Wait(250+Random(250));
R_DepositAllID(331);
Inc(Banked);
End Else
writeln('Problem Banking');
End;
End;
Procedure StartUp;
Begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
SetUpReflectionEx(true);
DeclarePlayers;
LoginPlayer;
Wait(1500+Random(1500));
//CheckForRod;
End;
Procedure Proggy; //Proggies shouldn't take two and a half seconds to show. :p
Begin
writeln('/////---Thanks for using the Trolls Fisher---\\\\');
Wait(500);
writeln('//// ---You banked '+IntToStr(Banked)+' times---\\\\');
wait(500);
writeln('////---You walked '+IntToStr(Walked)+' times---\\\\');
Wait(500);
writeln('////---You used AntiBan '+IntToStr(AntiBann)+' times---\\\\');
wait(500);
writeln('////-------------------------------------------\\\\');
wait(500);
End;
Function FindSpot:Boolean; //If at the right area but need more searching for example looking for a spot when in the right area
Begin
End;
Function WeAreFishing:Boolean;
Begin
{Result := false
If GetAnimation = 623 Then
Result := True}
Result := GetAnimation = 623;
End;
Procedure MainLoop;
Var I:Integer;
Begin
Repeat
If Loc = 'FishingSpot' Then
If Not InvFull Then
If Not WeAreFishing Then
Begin
I := 0
Repeat
If Not Fishing Then
Begin
DebugText('Problem In mainLoop looking for spot retrying');
Inc(I);
End Else Begin
I := 0
DebugText('Found fishing spot, resetting I in mainloop');
End;
While WeAreFishing Do
MyWait(RandomRange(200,1000));
If I = 10 Or 20 Or 30 Or 40 Then
FindSpot;
If I >= 50 Then
Begin
writeln('problem has happen stopping');
TerminateScript;
End;
Until(InvFull)
End;
WhenInvFull;
Until(False);
End;
Begin
End.