Troll
2010-10-24 15:55:34
Well ive been wirting this for a couple of hours today and its a lure fisher. I know its far from done, as it dose not even have a loop. Im posting it so people can coment on it surgest stuff to add and improve it. Also im not sure how to add muti player and what fail safes to add.
Thanks for anyhelp.
P.S. Yay first script ive ever posted here which i have remember to take my user and pass out
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;
End;
Procedure DebugText(Text:String);
Begin
If Not Debug then Exit;
writeln(Text);
End;
Procedure AntiBan;
Begin
FindNormalRandoms;
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;
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);
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');
End;
Result := True;
Exit;
End else Begin
DebugText('Did not find fishspot uptext!');
Wait(750);
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
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
Case Where Of
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'
Exit;
End;
If (WhereTo = 'FishingSpot') Then
Begin
LoadPath(2,Random(3));
Loc := 'FishingSpot'
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;
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
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.
Thanks for anyhelp.
P.S. Yay first script ive ever posted here which i have remember to take my user and pass out