Yo pvh:)
As promised, I fixed a bit up your code, there still are things that can be done better (efficienter), but I don't have the time.
I'm going to take a shower and then sit outside read a book or so, the weather is too good to sit inside the house:)
The script:
program BabarianFisher;
{.include SRL/SRL/Misc/Smart.Scar}
{.Include SRL\SRL.SCAR}
{=========================================================================]
[ BabarianFisher ]
[ ]
[ NAME : PvH's BabarianFisher ]
[ WRITER : PvH ]
[ CATEGORY : Fishing ]
[ DESCRIPTION : Fishes in babarian village and banks in edgeville ]
[ AUTOCOLOR : Yes ]
[ CONTACT : [email]pvh@live.nl[/email] ]
[=========================================================================}
/////////////////////////////////////////////////////////////////////
// HOW TO USE //
// 1.Setup your players in the most south bank booth in edge bank//
// 2. Fill in DeclarePlayers //
// 3. Fill in Const //
// 4. Set IdontLeech to false //
// 5.Post errors,bugs and proggies on my tread! //
/////////////////////////////////////////////////////////////////////
var
watcol: integer;//autocolor var
fishx, fishy: integer;
SleepTime:integer;
Trouts, Salmons, Pikes, FoundRods, Whirlpoolz, Lvlups, Loads,
Slepttimes:integer;//progres report vars
const
SRLStatsID = ''; // Your SRL Stats ID
SRLStatsPW = ''; // Your SRL Stats Password
SmartWorld = 13;//What world to load smart in
Signed = false; //False = unsigned True = signed
SleepBetweenPlayers = true;
IDontLeech = False;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| DeclarePlayers - Set up your players here ||
|| By: SRL ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
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]:= '0000' // Your bank pin
Players[0].Strings[1]:= 'lure' // lure or bait?
Players[0].Strings[2]:= 'bank' // drop or bank ?
Players[0].Loc := 'Bank'; // Bank or Fish
Players[0].integers[0]:= 10; // Loads to do
Players[0].integers[1]:= 3; // Minutes to sleep, random minutes will be added
{ Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active:=True;
Players[1].Strings[0]:= '0000' // Your bank pin
Players[1].Strings[1]:= 'lure' // lure or bait?
Players[1].Strings[2]:= 'drop' // drop or bank ?
Players[1].Loc := 'Bank'; // Bank or Fish
Players[1].integers[0]:= 10; // Loads to do
Players[1].integers[1]:= 3; // Minutes to sleep, random minutes will be added
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Active:=True;
Players[2].Strings[0]:= '0000' // Your bank pin
Players[2].Strings[1]:= 'lure' // lure or bait?
Players[2].Strings[2]:= 'drop' // drop or bank ?
Players[2].Loc := 'Bank'; // Bank or Fish
Players[2].integers[0]:= 10; // Loads to do
Players[2].integers[1]:= 3; // Minutes to sleep, random minutes will be added
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active:=True;
Players[3].Strings[0]:= '0000' // Your bank pin
Players[3].Strings[1]:= 'lure' // lure or bait?
Players[3].Strings[2]:= 'drop' // drop or bank ?
Players[3].Loc := 'Bank'; // Bank or Fish
Players[3].integers[0]:= 10; // Loads to do
Players[3].integers[1]:= 3; // Minutes to sleep, random minutes will be added
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Active:=True;
Players[4].Strings[0]:= '0000' // Your bank pin
Players[4].Strings[1]:= 'lure' // lure or bait?
Players[4].Strings[2]:= 'drop' // drop or bank ?
Players[4].Loc := 'Bank'; // Bank or Fish
Players[4].integers[0]:= 10; // Loads to do
Players[4].integers[1]:= 3; //Minutes to sleep, random minutes will be added
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Active:=True;
Players[5].Strings[0]:= '0000' // Your bank pin
Players[5].Strings[1]:= 'lure' // lure or bait?
Players[5].Strings[2]:= 'drop' // drop or bank ?
Players[5].Loc := 'Bank'; // Bank or Fish
Players[5].integers[0]:= 10; // Loads to do
Players[5].integers[1]:= 3; // Minutes to sleep, random minutes will be added }
if HowManyPlayers < 2 then
begin
Writeln('You are using '+IntToStr(HowManyPlayers) + ' Player');
Writeln('Srl is multiplayer based, right? So I hope you setted up sleeping right;)');
end else Writeln('You are using '+IntToStr(HowManyPlayers) + ' Players');
End;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| DropAll2 - Drops all the fish ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure DropAll2;
var
i: Integer;
begin
if not LoggedIn then Exit;
Gametab(4);
Status('Dropping fish');
for i := 3 to 28 do
begin
if ExistsItem(i) Then
begin
MouseItem(i, false);
ChooseOption('rop');
Wait(500 + random(1000));
end;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| LoadDTM(Which: String) - Loads a DTM ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function LoadDTMPvH(Which: string): integer;
begin
case lowercase(Which) of
'trout':
result := DTMFromString('78DA8D92B90AC0201044D726B7A0B924104CC' +
'8FF837D7E2E19BB1CC5EC806F2D1ECC821A2F22B3BC72A62423A6' +
'C1B910637119E413F320A6033C717AC012271737C499808E388BA' +
'22B0225717685B3012D710EE53E8E380108C4C9EFB01227EF1B89' +
'53299C42D155FFFFD8D7B901954B0908');
'salmon':
result := DTMFromString('78DA8D925B0A8020104547825E46EF971541D' +
'0F65A417B6B6B75EDABFAE87AC1A3C8016718552922B5BC72ECDB' +
'7DA5B04E44E53864F2897A107B0524C46981803806D0C499019F3' +
'80BE03938AC9E158889330105713AA0278E9D85214E0A8CC40981' +
'813811D038BCC5FAD2FFF5D86F730148CD0870');
'flyrod':
result := DTMFromString('78DA8D925B0A802010454728A2CCDE1214825' +
'12B6915ED7F2375FDAB7EEE0C7846F07CCC433388C8229FB84E2B' +
'13B2C1B911A6C265955F9817911D3013A70346E2A4F796381EA88' +
'9936AB1C4497D97C40940419C1DC8887300397122E0140E9B4FDA' +
'9557CC272876B111A757380D1015FF87D4F30053400800');
'fishingrod':
result := DTMFromString('78DA8DD2C90E40301485E1DB4DCD629E35F15' +
'6ACBCFF5370EE0E0BA737F157E25B94329188F4F29AF3D8A5C16A' +
'705D18637133CA67CCA35803A42526411A620A2427A6F630BA979' +
'8187DEF909819B1C43824206642326206A424A6F3F8CEFA7C20A6' +
'42568FB3D888493D8CFE638E183D87E5DFDCE9180816');
'bait':
result := DTMFromString('78DA63E46360601067400187268A330400694' +
'620FE0F048C6C408634031A60442281340B909020A006648E1001' +
'353C408297801A4920C147408D1C117629000951026A40F22204D' +
'408638621BA1A0077630746');
'feather':
result := DTMFromString('78DA63E4676060106340018777ED647003D28' +
'C40FC1F081879800C510634C088440269901A79026AB881843201' +
'3520B7481150230C2464A9E01E5E20214C408D2090E023A046064' +
'8081250230924C409A81125C2EFFC44FA4B85801A69C27E0700CE' +
'A90927');
'edgebank':
result := DTMFromString('78DA6314626060506640018D8D150CFF81342' +
'310FF0702465920430C22C70857C588C2679400125204D4480209' +
'2522D468E1570300424907A0');
'pike':
result := DTMFromString('78DA8D914B0E80200C05CBC21811FF841045C' +
'FC841BCB33E5CA99BD7260C0426D016338A88974FE4333F5B06E3' +
'4298018B517E615EC43C018E380BD010C72BEE89404B9C04D4C43' +
'9804AE1F4C459819938E57C238E0576E2947C93C2616F95DE04E2' +
'38455DA53F56F1A791389DA2F6C073BE011C4E088F');
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| RotateCompass - Randomly changes the compass ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure RotateCompass;
begin
if not LoggedIn then Exit;
//Status('Performing Antiban');
case random(9) of
0: MakeCompass(IntToStr(Random(360)));
1: MakeCompass(IntToStr(Random(180)));
2: MakeCompass(IntToStr(90+random(270)));
3: MakeCompass('N');
4: MakeCompass('S');
5: MakeCompass('E');
6: MakeCompass('W');
7: Setangle(true);
8: Setangle(false);
end;
MakeCompass('N');
Setangle(true);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| DontGetbanned - Does Antiban and prevents logging out ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure DontGetBanned;
var
Dx, Dy, j:integer;
begin
if not LoggedIn then Exit;
//Status('Performing Antiban');
Gametab(4);
case Random(450) of
0:
begin
HoverSkill('fishing', False);
Gametab(4);
end;
2:
begin
HoverSkill('cooking', false);
Gametab(4);
end;
3:
begin
GameTab(1 + Random(12));
wait(800 + random(500));
GameTab(4)
end;
4: BoredHuman;
6: RotateCompass;
7:
begin
MMouse(randomrange(150, 300), randomrange(150, 300), 0, 0);
Wait(200 + random(100));
if (IsUpText('opti')) then
begin
GetMousePos(Dx, Dy);
Mouse(Dx, Dy, 0, 0, false);
Wait(200 + random(100));
ChooseOption('xamine');
end;
end;
8:
begin
HoverSkill('random', false);
GameTab(4);
end;
9:
begin
if (InvCount < 1) then Exit;
j := Random(27) + 1;
if (ExistsItem(j)) then
begin
MouseItem(j, false);
Wait(200 + random(100));
if ChooseOption('xamine')then
begin
Wait(1000+random(300));
Wait(1000 + Random(500));
end;
end;
end;
10:
begin
PickUpMouse;
Wait(500 + Random(500));
end;
12: SleepAndMoveMouse(5000 + Random(1000));
13: RandomRClick;
15: IdleTime(1000 + Random(1000), 500, 0.5);
end;
MakeCompass('n');
Gametab(4);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| CountFeathers - Counts the ammount of feathers ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure CountFeathers;
var
feather, FeatherAmmount: integer;
begin
if not LoggedIn then Exit;
Gametab(4);
writeln('Counting feathers..');
feather := LoadDTMPvH('feather');
FeatherAmmount := ItemAmount('inv', 'dtm', feather, [0]);
writeln('.. we got '+inttostr(FeatherAmmount)+ ' feathers left!');
if FeatherAmmount <= 25 then
begin
writeln('We have less then 26 feathers left on this account...switching players!');
logout;
players[currentplayer].active:=false;
Players[CurrentPlayer].Loc := 'Out of feathers';
end;
freedtm(feather);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| CountBait - Counts the ammount of Bait ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure CountBait;
var
bait, BaitAmmount: integer;
begin
if not LoggedIn then Exit;
Gametab(4);
writeln('Counting bait..');
bait := LoadDTMPvH('bait');
BaitAmmount := ItemAmount('inv', 'dtm', bait, [0]);
writeln('..we got '+inttostr(BaitAmmount)+ ' bait left!');
if BaitAmmount <= 25 then
begin
writeln('We have less then 26 bait left on this account...switching players!');
logout;
players[currentplayer].active:=false;
Players[CurrentPlayer].Loc := 'Out of bait';
end;
freedtm(bait);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| GotFlyRod - Results true if you got a flyrod ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function GotFlyRod:boolean;
var
flyrod, tempx, tempy: integer;
begin
if not LoggedIn then Exit;
Gametab(4);
//writeln('Checking for flyrod');
flyrod := LoadDTMPvH('flyrod');
Result:= FindDTM(flyrod,tempx,tempy,MIX1,MIY1,MIX2,MIY2);
freedtm(flyrod);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| GotRod - Results true if you got a rod ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function GotRod:boolean;
var
fishingrod, tempx, tempy: integer;
begin
if not LoggedIn then Exit;
Gametab(4);
//writeln('Checking for fishingrod');
fishingrod := LoadDTMPvH('fishingrod');
Result:= FindDTM(fishingrod,tempx,tempy,MIX1,MIY1,MIX2,MIY2);
freedtm(fishingrod);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| FindEdgeBank - Results true if edgeville bank is found ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function FindEdgeBank(var bx, by: integer):boolean;
var
edgebank: integer;
begin
if not LoggedIn then Exit;
Gametab(4);
//writeln('Checking for edgeville bank');
edgebank := LoadDTMPvH('edgebank');
Result:= DTMrotated(edgebank, bx ,by, mmx1, mmy1, mmx2, mmy2);
freedtm(edgebank);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| WalkToFish - Walks to the fishing place ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function WalkToFish:boolean;
var
I, fx, fy:integer;
begin
if not LoggedIn then Exit;
MakeCompass('N');
Setrun(false);//true?
Gametab(4);
writeln('Walking to fishing place');
watcol := findWaterColor;
if not(watcol > 0) then
begin
writeln('water col not found!');
logout;
players[currentplayer].active := false;
exit;
end;
repeat
Inc(I);
RadialWalk(watcol, 192, 123, RandomRange(55, 62), 2, 2);
FFlag(RandomRange(5, 10));
if FindSymbol(fx, fy, 'fishing spot') then Break;
until (I > 10)
if findsymbol(fx, fy, 'fishing spot') then
begin
wait(3000+random(2000));
mouse(fx,fy,4,4,true);
fflag(RandomRange(5, 10));
Result:=True;
Players[CurrentPlayer].Loc := 'Fish';
end else
begin
Players[CurrentPlayer].Loc := 'Lost';
writeln('We are lost for some odd reason, please make a picture and post it on my tread!');
logout;
players[currentplayer].active:=false;
exit;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| WalkToBank - Walks to edgeville bank ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function WalkToBank:boolean;
var
J:integer;
bx, by: integer;
begin
if not LoggedIn then exit;
Makecompass('N');
setrun(true);
Gametab(4);
writeln('Walking to bank');
repeat
Inc(J);
RadialWalk(findWaterColor, 318, 400, RandomRange(55 , 62),2,2);
wait(500+random(2000));
if J > 4 then
if FindEdgeBank(bx, by) then break;
until (J>12);
if FindEdgeBank(bx, by) then
begin
mouse(bx,by,4,4,true);
fflag(RandomRange(5, 10));
Result:=True;
Players[CurrentPlayer].Loc := 'Bank';
exit;
end else
begin
Players[CurrentPlayer].Loc := 'Lost';
writeln('We are lost for some odd reason, please make a picture and post it on my tread!');
logout;
players[currentplayer].active:=false;
exit;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| Bank - Banks stuff ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure Bank;
var
Tries, trout, salmon, pike:integer;
begin
if not LoggedIn then exit;
setrun(false);
Gametab(4);
writeln('Banking!');
repeat
OpenBankFast('eb');
Inc(Tries);
until ((BankScreen) or (Tries > 5) or (PinScreen));;
if PinScreen then InPin(Players[CurrentPlayer].Strings[0]);
if BankScreen then
begin
writeln('Found banking screen!');
trout := LoadDTMPvH('trout');
Trouts:=Trouts + ItemAmount('inv', 'dtm', trout, [0]);
ReportVars[1] := ReportVars[1] + ItemAmount('inv', 'dtm', trout, [0]);
freedtm(trout);
salmon := LoadDTMPvH('salmon');
Salmons:=Salmons + ItemAmount('inv', 'dtm', salmon, [0]);
ReportVars[2] := ReportVars[2] + ItemAmount('inv', 'dtm', salmon, [0]);
freedtm(salmon);
pike := LoadDTMPvH('pike');
Pikes:=Pikes + ItemAmount('inv', 'dtm', pike, [0]);
ReportVars[3] := ReportVars[3] + ItemAmount('inv', 'dtm', pike, [0]);
freedtm(pike);
FixBank;
Tries:=Tries xor Tries;
Deposit(3,28,true);
ReportVars[0] := ReportVars[0] + 1;
Inc(Banks);
Inc(Loads);
CloseBank;
end else
begin
Players[CurrentPlayer].Loc := 'Lost';
writeln('Failed to open the bank after 5 times... please report this bug with a picture!');
logout;
players[currentplayer].active:=false;
exit;
end;
srlrandomsreport;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| WhirlPoolPlace - Results true if a whirlpool is found ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function WhirlPoolPlace(ax,ay:integer):boolean;
var
WhirlPool:TPointArray;
CTS:integer;
begin
if not LoggedIn then exit;
Gametab(4);
//Status('Checking for whirlpool');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(WhirlPool,14473690,ax-20,ay-20,ax+20,ay+20,40);
if length(WhirlPool) > 230 then
begin
result:= true;
Inc(WhirlPoolz);
ReportVars[4] := ReportVars[4] + 1;
end;
ColorToleranceSpeed(CTS);
end;
{*****************************************************************************************************************]
function FindObject(var x,y:integer; uptext, objectname, option:string; Mouseway,color,tolerance:integer):boolean;
By: PvH
Description: Find the object with uptext, chooseoption, clicks and uses tpa
Use:
X,y as variables (integer declared in script)
Uptext: The uptext from the object as a string
Object: Name of the object as a string, used for writing in the debug
Option: Option to choose when rightclicking, still declare it if you don't use it ;)
Mouseway: 1 for leftclicking, 2 for rightclicking and 3 for moving the mouse over it
Color: The color of the object
Tolerance: The Tolerance in to search (10-20 recommend)
Example:
FindObject(x,y,'ishing','fishing spot' ,'ait', 2, 11708835, 3);
******************************************************************************************************************}
function FindObject(var x,y:integer; uptext, objectname, option:string; Mouseway,color,tolerance:integer):boolean;
var
ObjectTPA: T2DPointArray;
ObjectPoint: TPointArray;
Tries, I, cts, ObjectTime: integer;
begin
if not LoggedIn then exit;
Gametab(4);
wait(300+random(600));
marktime(ObjectTime);
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(ObjectPoint, color, msx1, msy1, msx2, msy2, tolerance);
ObjectTPA := TPAtoATPAEx(ObjectPoint, 20, 20);
SortATPAFromFirstPoint(ObjectTPA, Point(MSCX, MSCY));
For I:= 0 to High(ObjectTPA) do
begin
MiddleTPAEx(ObjectTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Inc(Tries);
if isuptext(uptext)then
begin
Writeln('Finding '+(objectname)+' took:' +inttostr(timefrommark(ObjectTime))+ ' ms!');
Tries:=Tries-Tries;
GetMousePos(x,y);
if Mouseway = 1 then
begin
mouse(x,y,0,0,true);
fflag(RandomRange(5, 10));
end;
if Mouseway = 2 then
begin
mouse(x,y,0,0,false);
wait(300+random(500));
Chooseoption(option);
fflag(RandomRange(5, 10));
end;
wait(700+random(1000));
result := true;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the object');
end;
end;
until((tries >5) or (timefrommark(ObjectTime) > (20000+random(10000))));
if not result then
begin
writeln('We couldn''t find the '+(objectname)+ '!');
exit;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| GetNewEquips - Gets new equips from bank ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure GetNewEquips;
var
Tries, trout, salmon, pike, rod:integer;
rx, ry: integer;
begin
if not LoggedIn then exit;
setrun(false);
Gametab(4);
writeln('Getting new equips from bank');
repeat
OpenBankFast('eb');
Inc(Tries);
until ((BankScreen) or (Tries > 5) or (PinScreen));;
if PinScreen then InPin(Players[CurrentPlayer].Strings[0]);
if BankScreen then
begin
writeln('Found banking screen!');
trout := LoadDTMPvH('trout');
Trouts:=Trouts + ItemAmount('inv', 'dtm', trout, [0]);
ReportVars[1] := ReportVars[1] + ItemAmount('inv', 'dtm', trout, [0]);
freedtm(trout);
salmon := LoadDTMPvH('salmon');
Salmons:=Salmons + ItemAmount('inv', 'dtm', salmon, [0]);
ReportVars[2] := ReportVars[2] + ItemAmount('inv', 'dtm', salmon, [0]);
freedtm(salmon);
pike := LoadDTMPvH('pike');
Pikes:=Pikes + ItemAmount('inv', 'dtm', pike, [0]);
ReportVars[3] := ReportVars[3] + ItemAmount('inv', 'dtm', pike, [0]);
freedtm(pike);
FixBank;
Tries:=Tries xor Tries;
Deposit(3,28,true);
ReportVars[0] := ReportVars[0] + 1;
Inc(Banks);
Inc(Loads);
if lowercase(players[currentplayer].Strings[1]) ='lure' then
rod := LoadDTMPvH('flyrod')
else
rod := LoadDTMPvH('fishingrod');
if findDTM(rod,rx,ry,MSX1, MSY1, MSX2, MSY2) then
begin
mouse(rx,ry,3,3,true);
writeln('We got a new rod:)');
wait(400+random(500));
closebank;
end else
begin
writeln('Aww, we are out of rods, switching players!');
CloseBank;
logout;
players[currentplayer].active:=false;
Players[CurrentPlayer].Loc := 'Out of equipment';
freedtm(rod);
exit;
end;
freedtm(rod);
end;
srlrandomsreport;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| FindLostEquipment - Results true if the lost equipment is found ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function FindLostEquipment: Boolean;
var
RodCol, cx, cy: integer;
RodName: string;
begin
if not LoggedIn then Exit;
Gametab(4);
//Status('Searching for the lost equips on the ground');
if GotFlyRod or GotRod then exit;
case lowercase(players[currentplayer].Strings[1]) of
'lure': begin
RodCol := 537155;
RodName := 'fly fishing rod';
end;
'bait': begin
RodCol := 1455934;
RodName := 'fishing rod';
end;
end;
MakeCompass('W');
if FindObject(cx, cy,'ishing', RodName, 'ake', 1, 537155, 15) then
begin
writeln('We found the lost rod!');
MakeCompass('N');
end else
begin
writeln('We lost the rod!');
MakeCompass('N');
WalkToBank;
GetNewEquips;
WalkToFish;
exit;
end;
Result := True;
Inc(FoundRods);
ReportVars[5] := ReportVars[5] + 1;
End;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| AreWeFishing - Results true if you are fishing ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function AreWeFishing(ax, ay: integer):boolean;
var
Fishrod:TPointArray;
CTS:Integer;
begin
if not LoggedIn then Exit;
Gametab(4);
//Status('Checking if we are fishing');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
//ay := ay - 15; ay
FindColorsTolerance(Fishrod,334631, ax-20, ay-35, ax+20, ay+20, 15);
Result := (Length(Fishrod) > 4);
ColorToleranceSpeed(CTS);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| FollowFishingSpot - Results true if we followed the fishing spot||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function FollowFishingSpot(var ax, ay: integer): Boolean;
var
FishSpot, FishPoint1, FishPoint2: TPointArray;
MiddleSpot: TPoint;
CTS: Integer;
begin
if not LoggedIn then Exit;
Gametab(4);
//Status('Following fishing spot');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(FishPoint1, 12104365, ax - 20, ay - 20, ax + 20, ay + 20, 40);
FindColorsTolerance(FishPoint2, 12828347, ax - 20, ay - 20, ax + 20, ay + 20, 40);
FishSpot := CombineTPA(FishPoint1, FishPoint2);
if Length(FishSpot) > 3 then
begin
Result := True;
MiddleSpot := MiddleTPA(FishSpot);
ax := MiddleSpot.x;
ay := MiddleSpot.y;
end else writeln('Omg, we couldn''t follow the fishing spot...');
ColorToleranceSpeed(CTS);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| FishThatThing - Results true if we clicked the fishing spot ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function FishThatThing:boolean;
var
text: string;
begin
if not LoggedIn then exit;
Gametab(4);
//Status('Clicking Fishingspot');
if lowercase(players[currentplayer].Strings[1]) ='lure' then
text := 'ure'
else
text := 'bait';
if FindObject(fishx, fishy, 'ishing', 'fishing spot' ,text, 3, 10787476, 3) then
begin
if not WhirlPoolPlace(fishx, fishy) then
begin
//writeln('Luring fish now:)');
Mouse(fishx, fishy, 0, 0, True);
fflag(RandomRange(0, 3));
wait(3000+random(2000));
Result:=True;
exit;
end;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| SwitchPlaces - Switches fishingplaces ||
|| By: PvH and this is modified from wizzup?'s function! ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function SwitchPlaces: Boolean; // Modified from wizzup?'s function, credits to him!
var
Symbolz: TPointArray;
Symbol, A: Integer;
begin
if not LoggedIn then Exit;
Gametab(4);
writeln('Switching places');
FindSymbols(Symbolz, 'fishing spot');
if Length(Symbolz) = 2 then
begin
Symbol := Max(Distance(MMCX, MMCY, Symbolz[0].X, Symbolz[0].Y),
Distance(MMCX, MMCY, Symbolz[1].X, Symbolz[1].Y));
if Symbol = Distance(MMCX, MMCY, Symbolz[0].X, Symbolz[0].Y) then
A := 0
else
A := 1;
Mouse(Symbolz[A].X, Symbolz[A].Y, 4, 4, True);
Wait(1000+random(2000));
FFlag(RandomRange(5, 10));
Wait(500+random(1000));
Result := True;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| HandleRandoms - Solves all possible randoms ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure HandleRandoms;
begin
if not LoggedIn then Exit;
Gametab(4);
//writeln('Searching for randoms');
FindNormalRandoms;
FindLostEquipment;
if findfight then
begin
WalkToBank;// wtf?!
WalkToFish;// wtf?!
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| AreWeLevelUp - Results true if we are a lvl-up ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function AreWeLevelUp: boolean;
begin
if not LoggedIn then Exit;
Gametab(4);
//writeln('Checking for levelup');
if ClickContinue(False,False) then
begin
if FindNPCChatText('lations', Nothing) then
begin
writeln('Yay, we got a new level!');
Lvlups:=Lvlups+1;
ReportVars[6] := ReportVars[6] + 1;
ClickContinue(True,True);
Result := True;
Exit;
end;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| FishUntilFull - Fishes ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
function FishUntilFull:boolean;
begin
if not LoggedIn then exit;
if not FishThatThing then exit;
Gametab(4);
Status('Fishing');
Result := True;
repeat
HandleRandoms;
if InvFull then break;
If WhirlPoolPlace(fishx, fishy) Then
Begin
Mouse(648, 84, 5, 5, True);
fflag(RandomRange(5, 10));
Writeln('Avoiding a whirlpool!');
Inc(Whirlpools);
Break;
End;
FindLostEquipment;
DontGetBanned;
if not FollowFishingSpot(fishx, fishy) then break;
if AreWeLevelUp then break;
HandleRandoms;
DontGetBanned;
if AreWeLevelUp then break;
if not AreWeFishing(fishx, fishy) then break;
HandleRandoms;
if not(GotFlyRod) or not(GotRod) then break;
If WhirlPoolPlace(fishx, fishy) Then
Begin
Mouse(648, 84, 5, 5, True);
fflag(RandomRange(5, 10));
Writeln('Avoiding a whirlpool!');
Inc(Whirlpools);
Break;
End;
if InvFull then break;
DontGetBanned;
HandleRandoms;
DontGetBanned;
until false
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| SetUpSmart - Sets up smart ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure SetUpSmart;
begin
Status('Setting up SMART!');
smartSetupex(SmartWorld, True, Signed, False);
wait(1000);
SetTargetDC(SmartGetDC);
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| SRLstats - Sets up the script ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure SRLstats;
begin
SetupSRL;
ScriptID := '933';
if ((SRLStatsID = '') or (SRLStatsPW = ''))then
begin
SRLID:='5774';
SRLPassword:='leechme';
writeln('Please get a SRLStatsID');
end else
begin
SRLID := SRLStatsID;
SRLPassword := SRLStatsPW;
writeln('Good to see you are not a leecher=)');
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| VersionCheck - Checks if you got the latest version ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure VersionCheck;
var
Version, VersionNow: string;
begin
VersionNow:= '2'; // Do NOT change this!
Version := GetPage('http://pvh.freehostia.com/versioncheck4.txt');
if Version = VersionNow then
begin
WriteLn('You have the latest version!');
Wait(2000);
end else
begin
ClearDebug;
WriteLn('The latest version is ' + Version);
writeLn('And you got version ' + VersionNow);
writeLn('Please download version '+ Version);
OpenWebPage('http://www.villavu.com/forum/showthread.php?t=33056');
TerminateScript;
end;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| Signature - Writes down the signature in the debug ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure Signature;
begin
cleardebug;
writeln(' ____ _ _ ');
writeln('| __ ) __ _| |__ __ _ _ __(_) __ _ _ __ ');
writeln('| _ \ / _` | ''_ \ / _` | ''__| |/ _` | ''_ \ ');
writeln('| |_) | (_| | |_) | (_| | | | | (_| | | | | ');
writeln('|____/ \__,_|_.__/ \__,_|_| |_|\__,_|_| |_| ');
wait(1000);
cleardebug;
writeln(' _____ _ _ ');
writeln('| ___(_)___| |__ ___ _ __ ');
writeln('| |_ | / __| ''_ \ / _ \ ''__| ');
writeln('| _| | \__ \ | | | __/ | ');
writeln('|_| |_|___/_| |_|\___|_| ');
wait(1000);
cleardebug;
writeln(' ____ ');
writeln('| __ ) _ _ ');
writeln('| _ \| | | | ');
writeln('| |_) | |_| | ');
writeln('|____/ \__, | ');
writeln(' |___/ ');
wait(1000);
cleardebug;
writeln(' ____ _ _ ');
writeln('| _ \__ _| | | | ');
writeln('| |_) \ \ / / |_| | ');
writeln('| __/ \ V /| _ | ');
writeln('|_| \_/ |_| |_| ');
wait(4000);
cleardebug;
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| ProgressReport - Writes down the progress report in the debug ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure ProgressReport;
begin
cleardebug;
writeln('--------------------------------------');
writeln('| Babarian fisher by PvH |');
writeln('|------------------------------------|');
Writeln(' Ran For ' +TimeRunning);
writeln(' Did '+inttostr(Banks)+' loads!');
writeln(' Caught '+inttostr(salmons)+' salmons!');
writeln(' Caught '+inttostr(trouts)+' trouts!');
writeln(' Caught '+inttostr(pikes)+' pikes!');
writeln(' Avoided '+inttostr(Whirlpoolz)+' Whirlpools!');
writeln(' Found '+inttostr(FoundRods)+' Rods!');
writeln(' Gained '+inttostr(Lvlups)+ ' fishing levels!');
writeln(' Slept '+IntToStr(Slepttimes)+' times!');
writeln('-------------------------------------|');
writeln('| Thank you for using my script! |');
writeln('-------------------------------------|');
end;
{<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
|| ScriptTerminate - Stops the script ||
|| By: PvH ||
<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>}
procedure ScriptTerminate;
Begin
Disguise('Script finished!');
if IDontLeech then
begin
writeln('I HATE LEECHERS!');
OpenWebPage('http://www.raygoldmodels.com/');
OpenWebPage('http://www.raygoldmodels.com/');
OpenWebPage('http://www.raygoldmodels.com/');
OpenWebPage('http://www.raygoldmodels.com/');
OpenWebPage('http://www.raygoldmodels.com/');
writeln('I hope you learned your lesson...');
writeln('You better restart you pc before running this script again if you don''t want lagg :p');
exit;
end;
ProgressReport;
SRLRandomsReport;
Writeln('I hope you liked my script!');
writeln('Please post this proggy on my tread!');
OpenWebPage('http://www.villavu.com/forum/showthread.php?t=33056');
End;
procedure CountThings;
begin
if not LoggedIn then exit;
if lowercase(players[currentplayer].Strings[1]) ='lure' then
CountFeathers
else
CountBait;
end;
procedure DropThings;
var
trout, salmon, pike: integer;
begin
if not LoggedIn then exit;
trout := LoadDTMPvH('trout');
Trouts:=Trouts + ItemAmount('inv', 'dtm', trout, []);
ReportVars[1] := ReportVars[1] + ItemAmount('inv', 'dtm', trout, []);
freedtm(trout);
salmon := LoadDTMPvH('salmon');
Salmons:=Salmons + ItemAmount('inv', 'dtm', salmon, []);
ReportVars[2] := ReportVars[2] + ItemAmount('inv', 'dtm', salmon, []);
freedtm(salmon);
pike := LoadDTMPvH('pike');
Pikes:=Pikes + ItemAmount('inv', 'dtm', pike, []);
ReportVars[3] := ReportVars[3] + ItemAmount('inv', 'dtm', pike, []);
freedtm(pike);
ReportVars[0] := ReportVars[0] + 1;
Inc(Banks);
Inc(Loads);
DropAll2;
if lowercase(players[currentplayer].Strings[1]) ='lure' then
CountFeathers
else
CountBait;
srlrandomsreport;
end;
begin
if IDontLeech then TerminateScript;
VersionCheck;
SetUpSmart;
Signature;
SRLstats;
DeclarePlayers;
Activateclient;
SymbolAccuracy := 0.6;
Disguise('© PvH');
loginplayer;
Setangle(true);
Makecompass('n');
wait(4000);
repeat
if Loads >= players[currentplayer].integers[0] then
begin
Loads:=Loads xor Loads;
writeln('We did our loads, switching players!');
if SleepBetweenPlayers then
begin
SleepTime:=players[currentplayer].integers[1]*60000;
logout;
writeln('Sleeping now!');
Status('Sleeping!');
sleep(SleepTime+random(300000));
Inc(Slepttimes);
ReportVars[7] := ReportVars[7] + 1;
end else logout;
end;
if not LoggedIn then
begin
writeln('Current player is not logged in, next player!');
nextplayer(true);
end;
if (players[currentplayer].Strings[2]='bank') then
begin
if lowercase(Players[CurrentPlayer].Loc) = 'bank' then
begin
writeln('Walking to fishing place!');
WalkToFish;
end;
if lowercase(Players[CurrentPlayer].Loc) = 'fish' then
begin
repeat
FishUntilFull;
if not FishUntilFull then
begin
Status('Switching places!');
SwitchPlaces;
end;
until InvFull;
WalkToBank;
Bank;
ProgressReport;
CountThings;
end;
end else
begin
if lowercase(Players[CurrentPlayer].Loc) = 'bank' then
begin
writeln('Walking to fishing place!');
WalkToFish;
end;
if lowercase(Players[CurrentPlayer].Loc) = 'fish' then
begin
repeat
FishUntilFull;
if not FishUntilFull then
begin
Status('Switching places!');
SwitchPlaces;
end;
until InvFull;
DropThings;
ProgressReport;
CountThings;
end;
end;
until(false);
Disguise('Done');
end.
-Tsn.