SCAR Code:
{ ---------------------------------------------------------------------------- ]
[ ________ ]
[ \______ \____________ ___.__. ____ ___________ ]
[ | | \_ __ \__ \< | |/ \ / _ \_ __ \ ]
[ | ` \ | \// __ \\___ | | ( <_> ) | \/ ]
[ /_______ /__| (____ / ____|___| /\____/|__| ]
[ \/ \/\/ \/ ]
[ _______ __ __ ]
[ \ \ _____/ |__/ |_ ___________ ]
[ / | \_/ __ \ __\ __\/ __ \_ __ \ ]
[ / | \ ___/| | | | \ ___/| | \/ ]
[ \____|__ /\___ >__| |__| \___ >__| ]
[ \/ \/ \/ ]
[ ---------------------------------------------------------------------------- ]
[ >> DESCRIPTION << ]
[ ---------------------------------------------------------------------------- ]
[ This Script is Designed to fish and bank in Draynor on a Specific Char ]
[ until a Certain Number of Loads have been Autoed. This will then ]
[ Switch Charactere and Auto the next Players Fishing Skill. This will ]
[ Keep Repeating until all Players are Inactive, or the script is Terminated ] ]
[ ---------------------------------------------------------------------------- ]
[ >> UPDATE LOG << ]
[ ---------------------------------------------------------------------------- ]
[ Version .10 - Basic framework of script completed. ]
[ Version .20 - A little more variety and structure implemented. ]
[ Version .30 - Improved fishing spot finding and focused on solving ]
[ whirlpool random. ]
[ Version .40 - Improved walking, used DDTM's for walking. ]
[ Version .50 - A BIG UPDATE! Improved fishing spot finding, once more, ]
[ bank opening, added option to power-fish, made my own ]
[ whirlpool detection. ]
[ Version .60 - Added Version checker, added progress report, and auto ]
[ nickname creator(for the noobs). ]
[ Version .70 - Added forms. ]
[ Version .80 - Took forms back out, too many errors. ]
[ Version .82 - Fixed little bugs, fixed runtime error. ]
[ Version .84 - Fixed banking bugs and hopefully fixed lagging bug. ]
[ Version .85 - Fixed little things, such as FindFishSpotClose. ]
[ Version .85b - Fixed the bug in FindFishSpotClose hopefully. ]
[ ---------------------------------------------------------------------------- ]
[ >> SETUP INSTRUCTIONS << ]
[ ---------------------------------------------------------------------------- ]
[ o For each Individual Player, place a small fishing net in the player's ]
[ inventory. ]
[ o Place Each Individual Player in the bank ]
[ o Fill in the Setup on lines 56 - 64, and Declare Players on line 110. ]
[ o Hit the Run Button Now! ]
[ o Make sure you are using SCAR 3.11+ ]
[ ---------------------------------------------------------------------------- ]
[ Script by Itschris917 ]
[ Please Post Progress Reports, Bugs and Suggestions in my Thread! ]
[ ---------------------------------------------------------------------------- }
program DraynorNetter;
{.include SRL\SRL.scar}
{.include SRL\SRL\Misc\trade.scar}
{.include SRL\SRL\Extended\xAntiBan.scar}
//----------------------------------------------------------------------------\\
//----------------------------------------------------------------------------\\
// --> USER DEFINED PARAMETERS <-- \\
//----------------------------------------------------------------------------\\
//----------------------------------------------------------------------------\\
Const NumberOfUsers = 4;
Const StartPlayer = 0;
Const VerNumber = '.85b'; //No need to change this.
Const YourSRLSTATSID = ''; // Stats ID.
Const YourSRLSTATSPASS = ''; // Stats Pass.
Const YourRCMASTER = ''; // Remote Control Master.
Const DoDebug = 4;//1: title bar. 2: writeln. 3: status. 4: All
Const ExtendedDebug = True; //My debug? It helps me correct bugs etc..
Const AntiBanRandomness = 1; //Smaller number = more anti-ban...
//----------------------------------------------------------------------------\\
// --> VARIABLES <-- \\
//----------------------------------------------------------------------------\\
Var
FishingNet, FishingNetColor, iX, iY, WhirlPoolDTM, x, y : Integer;
Var
RDTMTol, RDTMArea, Rock, RockDTM, BankDTM : Integer;
Var
Shrimp, Anchovy, TotalShrimp, TotalAnchovies : Integer;
Var
NoNet, Fishing, InBank : Boolean;
Var
SkipItems: Array[1..21] of String;
Var
ShrimpEXP, AnchovyEXP : Extended;
Var
ShrimpCount, AnchovyCount, cx, cy : Integer;
//----------------------------------------------------------------------------\\
// --> DEBUG <-- \\
//----------------------------------------------------------------------------\\
procedure DoomDebug(S:String);
begin
Case DoDebug Of
1:Disguise(S);
2:Writeln(S);
3:Status(S);
4: Begin
Disguise(S);
Writeln(S);
Status(S);
end;
end;
end;
//----------------------------------------------------------------------------\\
// --> DECLARE PLAYERS <-- \\
//----------------------------------------------------------------------------\\
Procedure DeclarePlayers;
Begin
DoomDebug('Declare Players');
NumberOfPlayers(NumberOfUsers);
HowManyBooleans := 1;
Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Integers[0] := 15; //Loads to do..
Players[0].Booleans[0] := False; //True to bank, false to power-fish
Players[0].Extendeds[0] := 0; //DONT TOUCH!
Players[0].Extendeds[1] := 0; //DONT TOUCH!
Players[0].Extendeds[2] := 0; //DONT TOUCH!
Players[0].Strings[0] := ''; //Bank pin. If none, leave blank.
Players[0].Strings[1] := 'E'; //Direction to run. N, E, S, W.
Players[0].Active := True; //Is the player active?
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Integers[0] := 15;
Players[1].Booleans[0] := False;
Players[1].Extendeds[0] := 0; //DONT TOUCH!
Players[1].Extendeds[1] := 0; //DONT TOUCH!
Players[1].Extendeds[2] := 0; //DONT TOUCH!
Players[1].Strings[0] := '';
Players[1].Strings[1] := 'E';
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Integers[0] := 15;
Players[2].Booleans[0] := False;
Players[2].Extendeds[0] := 0; //DONT TOUCH!
Players[2].Extendeds[1] := 0; //DONT TOUCH!
Players[2].Extendeds[2] := 0; //DONT TOUCH!
Players[2].Strings[0] := '';
Players[2].Strings[1] := 'E';
Players[2].Active := True;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Integers[0] := 15;
Players[3].Booleans[0] := False;
Players[3].Extendeds[0] := 0; //DONT TOUCH!
Players[3].Extendeds[1] := 0; //DONT TOUCH!
Players[3].Extendeds[2] := 0; //DONT TOUCH!
Players[3].Strings[0] := '';
Players[3].Strings[1] := 'E';
Players[3].Active := True;
Players[4].Name := '';
Players[4].Pass := '';
Players[4].Integers[0] := 5;
Players[4].Booleans[0] := True;
Players[4].Extendeds[0] := 0; //DONT TOUCH!
Players[4].Extendeds[1] := 0; //DONT TOUCH!
Players[4].Extendeds[2] := 0; //DONT TOUCH!
Players[4].Strings[0] := '';
Players[4].Strings[1] := 'E';
Players[4].Active := True;
Players[5].Name := '';
Players[5].Pass := '';
Players[5].Integers[0] := 5;
Players[5].Booleans[0] := True;
Players[5].Extendeds[0] := 0; //DONT TOUCH!
Players[5].Extendeds[1] := 0; //DONT TOUCH!
Players[5].Extendeds[2] := 0; //DONT TOUCH!
Players[5].Strings[0] := '';
Players[5].Strings[1] := 'E';
Players[5].Active := True;
Writeln('Using '+IntToStr(HowManyPlayers)+' Players');
LoadPlayerArray;
end;
//----------------------------------------------------------------------------\\
// --> INTRO <-- \\
//----------------------------------------------------------------------------\\
Procedure Intro;
Begin
Status('Script created by Itschris917');
Writeln('');
Writeln(' ___ _ __ __ __ ');
Writeln(' / _ \ ____ ___ _ __ __ ___ ___ ____ / |/ /___ / /_ / /_ ___ ____ ');
Writeln(' / // // __// _ `// // // _ \/ _ \ / __/ / // -_)/ __// __// -_)/ __/ ');
Writeln('/____//_/ \_,_/ \_, //_//_/\___//_/ /_/|_/ \__/ \__/ \__/ \__//_/ ');
Writeln(' /___/ ');
Writeln(' ');
Writeln(' Ver '+VerNumber+' By Itschris917 ');
Writeln('');
Wait(2500);
ReportVars[0]:= ReportVars[0] + 1;
End;
//----------------------------------------------------------------------------\\
// --> CHECK VERSION <-- \\
//----------------------------------------------------------------------------\\
Procedure CheckVersion;
Var
Version : String;
Begin
ClearDebug;
Writeln('Checking SCAR Version..');
If not(GetSCARVersion >= 311) then
begin
Writeln(' >> You Need SCAR Divi 3.11 or above to Run this Script!');
Writeln(' >> Please Download it from http://www.freddy1990.com/scar.php');
TerminateScript;
end;
Writeln('SCAR Version.. OK! You have SCAR '+IntToStr(GetSCARVersion));
Wait(200);
Writeln('Checking Script Version..');
Wait(1);
Version := (Getpage('http://itschris917.freehostia.com/DraynorNetter/DNCurrentVersion.txt'));
If not(VerNumber = Version) and not(Version = '')then
Begin
Writeln('');
Writeln(' ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ');
Writeln(' Draynor Netter Ver ' +Version+ ' Released!');
Writeln(' Your Version : '+VerNumber );
Writeln(' It is Recommended that you Update your Script! ');
Writeln(' ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ');
Writeln('');
If(GetApplication.MessageBox('Draynor Netter Ver ' +Version+ ' Released!' +Chr(13)+ 'Your Version : '+VerNumber + Chr(13)+ 'Press "OK" to Cancel the Script Run and Download the new Version!', 'New Version Released', 1) = 1) then
Begin
OpenWebPage('http://itschris917.freehostia.com/DraynorNetter/DNCurrentVersion.scar');
TerminateScript;
End;
end else
Writeln('Latest Version... OK!');
end;
//----------------------------------------------------------------------------\\
// --> LOAD NULL WORS <-- creds to Mad Cow \\
//----------------------------------------------------------------------------\\
procedure LoadNullWords;
begin
SkipItems[1] := 'the';
SkipItems[2] := 'but';
SkipItems[3] := 'yes';
SkipItems[4] := 'lol';
SkipItems[5] := 'brb';
SkipItems[6] := 'gtg';
SkipItems[7] := 'cya';
SkipItems[8] := 'how';
SkipItems[9] := 'hey';
SkipItems[10] := 'wat';
SkipItems[11] := 'umm';
SkipItems[12] := 'him';
SkipItems[13] := 'she';
SkipItems[14] := 'man';
SkipItems[15] := 'wow';
SkipItems[16] := 'god';
SkipItems[17] := 'nub';
SkipItems[18] := 'nop';
SkipItems[19] := 'did';
SkipItems[20] := 'you';
SkipItems[21] := 'ing';
end;
//----------------------------------------------------------------------------\\
// --> CREATE NICK <-- creds to Mad Cow \\
//----------------------------------------------------------------------------\\
function CreateNick(Username : String) : String;
var
UserLength, NickStart, INick, A : Integer;
Nicks, Temp : String;
BadNick : Boolean;
begin
UserLength := Length(Username);
INick := 0;
LoadNullWords;
repeat
BadNick := False;
NickStart := 2 + INick;
Nicks := Nicks + Copy(Username, NickStart, 3);
for A := 1 to 3 do
begin
Temp := Copy(Nicks, A, 1);
if(Temp = ' ') or (Temp = '_')then
begin
INick := INick + 1;
Nicks := '';
BadNick := True;
end;
end;
for A := 1 to 21 do
begin
if(Nicks = SkipItems[A]) then
begin
INick := INick + 1;
Nicks := '';
BadNick := True;
end;
end;
until((not(BadNick)) or (NickStart >= 15))
Result := Nicks;
end;
//----------------------------------------------------------------------------\\
// --> GENERATE NICKNAMES <-- creds to Mad Cow \\
//----------------------------------------------------------------------------\\
Procedure GenerateNickNames;
Begin
Writeln('');
Writeln('Creating Nicknames:');
Status('Creating Nicknames');
For X := 0 to HowManyPlayers - 1 do
begin
if(Players[X].Nick = '') then
begin
Players[X].Nick := CreateNick(Players[X].Name);
WriteLn(' Players[' + IntToStr(X) + '].Nick := ' + Players[X].Nick + ';');
Wait(1);
end;
end;
Writeln('');
Status('Setting Players Current Location:');
For X := 0 to HowManyPlayers - 1 do
Players[X].Loc := 'Not Yet Started Autoing';
Status('If you see this Message for Longer than 3 Seconds, Stop the Script and Restart Straight Away!');
end;
//----------------------------------------------------------------------------\\
// --> SRL STATS REPORT <-- \\
//----------------------------------------------------------------------------\\
procedure SRLStatsRep;
begin
ReportVars[1] := (GetSkillLevel('fishing')-Players[CurrentPlayer].Level[17]);
ReportVars[2] := Banks;
ReportVars[3] := TotalShrimp;
ReportVars[4] := TotalAnchovies;
SRLRandomsReport;
end;
//----------------------------------------------------------------------------\\
// --> EXP PER ITEM <-- \\
//----------------------------------------------------------------------------\\
Function ExpPerItem: Extended;
Begin
ShrimpEXP := 10; Result:= 10;
AnchovyEXP := 40; Result:= 40;
End;
//----------------------------------------------------------------------------\\
// --> PROGRESS REPORT <-- \\
//----------------------------------------------------------------------------\\
Procedure ProgressReport(ForceProgress: Boolean);
Var
i: Integer;
TempExp, TempLoads: Extended;
A: String;
Begin
If (ForceProgress) then
Begin
DoomDebug('Progress Report');
For i := 0 to (HowManyPlayers-1) do
TempLoads := TempLoads + Players[i].Extendeds[2];
For i := 0 to (HowManyPlayers-1) do
TempExp := (TempExp + ((ShrimpExp * Players[i].Extendeds[0]) + (AnchovyEXP * Players[i].Extendeds[1])));
Writeln('<---------------------------------------------->');
Writeln('¦ Draynor Netter Ver '+VerNumber+' By Itschris917 ¦');
Writeln('<---------------------------------------------->');
Writeln(' Total Running Time : ' +TimeRunning);
Writeln(' Total Loads Done : ' +FloatToStr(TempLoads));
Writeln(' Total Exp Gained : ' +FloatToStr(TempExp));
Writeln('<---------------------------------------------->');
Writeln(' Current Player No. : ' +IntToStr(CurrentPlayer+1)+ '/' +IntToStr(HowManyPlayers));
Writeln(' Current Player Name : ' +Players[CurrentPlayer].Name);
Writeln(' Player Running Time : ' +IntToStr((GetSystemTime/60000)- (PlayerStartTime/60000))+ ' Minutes');
Writeln(' Current Player Loads : ' +FloatToStr(Players[CurrentPlayer].Extendeds[2]));
If (LoggedIn) then
begin
Writeln(' Fishing Levels Gained : ' +IntToStr(GetSkillLevel('fishing')-Players[CurrentPlayer].Level[17]));
end;
Writeln(' Exp Approx Gained : ' +FloatToStr(ShrimpExp * Players[CurrentPlayer].Extendeds[0] + AnchovyEXP * Players[CurrentPlayer].Extendeds[1]));
Writeln(' Player Worked for : '+IntToStr(GetSystemTime/60000-PlayerStartTime/60000)+' Minutes');
Writeln(' Player Currently : '+Players[CurrentPlayer].loc);
Writeln('<---------------------------------------------->');
for i := 0 to HowManyPlayers-1 do
begin
if Players[i].Active=True then A:='True' else A:='False';
writeln( (inttostr(i))+' : '+Players[i].name+ ' = '+A
+'. - Lvl: '+inttostr(Players[i].Level[17])
+'. - W: '+intToStr(Players[i].Worked)+' mins.'
+' - Shrimp: '+floatToStr(Players[i].Extendeds[0])
+' - Anchovies: '+floatToStr(Players[i].Extendeds[1])
+'. - Loads: '+floatToStr(Players[i].Extendeds[2])
+'. - Loc: '+Players[i].loc);
end;
Writeln('<---------------------------------------------->');
SRLStatsRep;
End;
end;
//----------------------------------------------------------------------------\\
// --> AUTO RETALIATE <-- \\
//----------------------------------------------------------------------------\\
procedure AutoRetaliate(Yes: Boolean);
begin
GameTab(1)
case Yes of
True: if (not (GetColor(637, 386) = 2106255)) then
Begin
MouseBox(570, 361, 714, 400, True);
Wait(600 + Random(200));
End;
False: if (GetColor(637, 386) = 2106255) then
Begin
MouseBox(570, 361, 714, 400, True);
Wait(600 + Random(200));
End;
end;
end;
//----------------------------------------------------------------------------\\
// --> ANTI-BAN FEATURES <-- \\
//----------------------------------------------------------------------------\\
Procedure DoAntiBan(Extras: Boolean);
Begin
If not(LoggedIn) then Exit;
If (Extras) then
Begin
Case Random(12) of
0: RandomRClickEvery(2 + Random(8));
1: HoverSkill('random', false);
2: RotateEvery(20 + Random(10));
3: LeaveScreenEvery(5 + Random(5));
4: PickUpMouse;
5: BoredEvery(9 + Random(24));
6: Begin
GameTab(1 + Random(12));
Wait(1500 + Random(500));
GameTab(4);
end;
7: SleepAndMoveMouse(1000 + Random(1000));
8: MMouse(Random(MSX2), Random(MSY2), 0, 0);
9: SleepAndMoveMouse(2500 + Random(2500));
10: SleepAndMoveMouse(1500 + Random(1500));
11: SleepAndMoveMouse(500 + Random(500));
end;
end else
begin
Case Random(10) of
0 : IdleTime(1000 + Random(350), 500, 1.0);
1 : IdleTime(1000 + Random(350), 1000, 1.0);
2 : IdleTime(1000 + Random(350), 750, 0.5);
3 : SleepAndMoveMouse(2500 + Random(2500));
4 : SleepAndMoveMouse(1500 + Random(1500));
5 : SleepAndMoveMouse(500 + Random(500));
end;
end;
FindTalk;
end;
{
//----------------------------------------------------------------------------\\
\\----------------------------------------------------------------------------// }
Function AngleCompass(Angle:extEnded):Boolean;
Var //FIX THIS CHRIS!
//DOESNT WORK WITH NEW RS INTERFACE!!!
Ax, Ay, AMark:Integer;
Begin
MarkTime(AMark);
Ax:= Round( 6 * Sin (Angle * Pi / 180))+ 566;
Ay:= Round(-6 * Cos (Angle * Pi / 180))+ 20;
KeyDown(VK_Left);
repeat
Wait(10+rAnDom(5));
If(FindColor(x, y, 723587, Ax, Ay, Ax, Ay))Then
Begin
Result:=true;
break;
End;
Until(TimeFromMark(AMark) > 10000);
KeyUp(VK_Left);
End;
//----------------------------------------------------------------------------\\
// --> HANDLE WHIRLPOOL <-- \\
//----------------------------------------------------------------------------\\
Function HandleWhirlpool:Boolean;
Var
mX, mY:Integer;
Begin
Result:= (FindDTM(WhirlPoolDTM, mX, mY, MSX1, MSY1, MSX2, MSY2));
If (Result) Then
Begin
Mouse(MMCX, MMCY, 0, 0, True);
DoomDebug('Whirlpool found..');
Wait(30000+random(5000));
End;
End;
//----------------------------------------------------------------------------\\
// --> DTM AND BMP LOADING <-- \\
//----------------------------------------------------------------------------\\
Procedure LoadBMPDTM;
Begin
FishingNet := BitmapFromString2(False, 'aA0E2278DAE55741128' +
'3200CFC1245407AC456FFFFA4925C3C30324B82944E3964324160' +
'09EB128C310F1B4C6E3BD9E5EDB2F5DB9E6D70897D73460CF7269' +
'BAD73EC471A157CCCD6468EF817D983E3F4A17189FDE399ED9A16' +
'F2F778461CCFFC5E6994657FF314DF68B6B0F0D84848FEB61D459' +
'B1F6D3D3ECF2E4A24659E4BFF5BF8AFB0E1688F8B363EB7087219' +
'D3FAF2F6BE73E9851639C73A075AD7EACB61CD2AF53C6BF4B3CE5' +
'264174804514B2427B25E9902B46AA68CC37A54BD30237F776B3E' +
'EFFBA695517DEF029916F5BA5B352C6A3D4D9C03883AE9EF2324E' +
'7F81E65ABDF370AD7F991759A6C7E5C4F3495B6FE4CC7542363AA' +
'3B5C7F7A29DBC88A5AFF67CDF99691D542E35F8EADFECCAFF5F93' +
'1FF2E5A19873F512');
WhirlPoolDTM := DTMFromString('78DA63D4606460B8C380024E9EBAC02002A41' +
'9A17C466D20EB16AA9A03BBF7A2AA5107B29EA1AAD9B46D27AA1A' +
'6320EB36AA9A43474EA2AA5105B2EEA1AA397FE1128A1A001C7C1' +
'117');
Rock := BitmapFromString2(False, 'a928A778DA658B490AC0300C0' +
'3BFE478C9728C5BF4FF27354A291472198B912C2232FB82C4B5E0' +
'8DAC4529EA246F52BB33EF4DA072A3FBA9F1B400CD30E6922C6EE' +
'E055D4D5313F0E20644C6FC4863830CA379799ABF3FDB0710C');
Shrimp := DTMFromString('78DA63CC64626078C28002AE2E6A65E004D28' +
'C40FC1F0818CB816AEE30A00146241248C702D53C22A0261BA8E6' +
'237E350078D90B50');
Anchovy := DTMFromString('78DA634C636260D061644006AD6D2B1838813' +
'448F43F10309601D5A8A0AA81C8C248209D0D546349404D1C508D' +
'267E350064340827');
End;
//----------------------------------------------------------------------------\\
// --> INVENTORY DTM FINDING <-- \\
//----------------------------------------------------------------------------\\
Function ClickAllItemsColWait(Col, Tol:integer; option: string; waitnum:
Integer):Integer;
var
i, x, y: Integer;
TB: Tbox;
begin
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
if FindColorTolerance(x, y, Col, TB.x1, TB.y1, TB.x2, TB.y2, Tol) then
begin
if (not (option = '')) then
begin
MouseItem(i, False);
ChooseOption(option);
Inc(Result);
end
else
MouseItem(i, True);
Wait(waitnum);
end;
end;
end;
{
//----------------------------------------------------------------------------\\
\\----------------------------------------------------------------------------// }
//Counts fishes, and skips 2 first slots. Creds to JuKKa!
Function CountFishes(Color, Tol: Integer): Integer;
Var
Dx, Dy, I: Integer;
ItemTp: TPoint;
Begin
GameTab(4);
For I:= 1 To 28 Do
Begin
ItemTP:= ItemCoords(I);
If(FindColorTolerance(Dx,Dy,Color,ItemTP.X-10,ItemTP.Y-10,ItemTP.X+10,ItemTP.Y+10, Tol))Then
Result:= Result + 1;
End;
End;
//----------------------------------------------------------------------------\\
// --> DROPPING <-- \\
//----------------------------------------------------------------------------\\
Procedure Drop(Col, Tol: Integer);
Var
cx, cy, Current, i: integer;
Coords: TPoint;
Begin
If not(LoggedIn) then Exit;
GameTab(4);
For i := 1 to 28 do
begin
DoomDebug('Checking If Item Exists');
If (ExistsItem(i)) then
begin
Current := InvCount;
Coords := ItemCoords(i);
DoomDebug('Finding color');
If(FindColorTolerance(cx, cy, Col, Coords.x-30, Coords.y-20, Coords.x+30, Coords.y+30, Tol))then
Begin
Mouse(Coords.x, Coords.y+5, 3, 3, False);
Wait(50 + Random(50));
DoomDebug('Finding Drop Text');
If(ChooseOption('Drop'))Then
Wait(200);
While(InvCount = Current) do
Wait(100);
Wait(250 + Random(100));
end else
ChooseOption('Cancel');
end;
end;
Wait(1);
end;
//----------------------------------------------------------------------------\\
// --> DDTM LOADING <-- \\
//----------------------------------------------------------------------------\\
Procedure SetRockDTM;
var RockMP: TDTMPointDef;
var RockSP: array[0..1] of TDTMPointDef;
var RockDTMSkel: TDTM;
Begin
RDTMTol:=40;
RDTMArea:=1;
RockMP.x:=906;
RockMP.y:=303;
RockMP.areasize:=1;
RockMP.areashape:=0;
RockMP.color:=4999259;
RockMP.tolerance:=RDTMTol;
RockSP[0].x:=912;
RockSP[0].y:=270;
RockSP[0].areasize:=RDTMArea;
RockSP[0].areashape:=0;
RockSP[0].color:=FindRoadColor;
RockSP[0].tolerance:=10;
RockSP[1].x:=863;
RockSP[1].y:=297;
RockSP[1].areasize:=RDTMArea;
RockSP[1].areashape:=0;
RockSP[1].color:=FindWaterColor;
RockSP[1].tolerance:=10;
RockDTMSkel.MainPoint:=RockMP;
RockDTMSkel.SubPoints:=RockSP;
RockDTM:=AddDTM(RockDTMSkel);
End;
{
//----------------------------------------------------------------------------\\
\\----------------------------------------------------------------------------// }
Procedure SetBankDTM;
var BankMP: TDTMPointDef;
var BankSP: array[0..1] of TDTMPointDef;
var BankDTMSkel: TDTM;
Begin
RDTMTol:=40;
RDTMArea:=1;
BankMP.x:=654;
BankMP.y:=28;
BankMP.areasize:=1;
BankMP.areashape:=0;
BankMP.color:=FindRoadColor;
BankMP.tolerance:=1;
BankSP[0].x:=648;
BankSP[0].y:=24;
BankSP[0].areasize:=RDTMArea;
BankSP[0].areashape:=0;
BankSP[0].color:=195836;
BankSP[0].tolerance:=RDTMTol;
BankSP[1].x:=656;
BankSP[1].y:=25;
BankSP[1].areasize:=RDTMArea;
BankSP[1].areashape:=0;
BankSP[1].color:=195836;
BankSP[1].tolerance:=RDTMTol;
BankDTMSkel.MainPoint:=BankMP;
BankDTMSkel.SubPoints:=BankSP;
BankDTM:=AddDTM(BankDTMSkel);
End;
{ ---------------------------------------------------------------------------- ]
[ >> Function UpdateCoords(Var ax, ay: Integer; TheColor: Integer): Boolean; ]
[ >> Updates Color Coords When you are Moving after a Click ]
[ >> Huge Thanks to Sumillion and Lorax for the Function - modified by Star ]
[ ---------------------------------------------------------------------------- }
Function UpdateCoords(Var cx, cy: Integer; ax, ay, TheColor, Tol: Integer): Boolean;
var
//ax, ay,
Counter: Integer;
Begin
DoomDebug('Updating Color Coords ...');
//GetMousePos(ax, ay);
If (ax < 20) then ax := 20; If (ay < 20) then ay := 20;
While (FlagPresent) and (FindColorSpiralTolerance(cx, cy, TheColor, ax-20, ay-20, ax+20, ay+20, Tol)) do
begin
ax := cx; ay := cy;
Wait(10);
end;
If (ax < 10) then ax := 10; If (ay < 10) then ay := 10;
While (FindColorSpiralTolerance(cx, cy, TheColor, ax-10, ay-10, ax+10, ay+10, Tol)) and (Counter < 100) do
begin
ax := cx; ay := cy;
Counter := Counter + 1;
Wait(10);
end;
Result := FindColorSpiralTolerance(cx, cy, TheColor, ax-10, ay-10, ax+10, ay+10, Tol);
if (not Result) then
DoomDebug('We lost the Color while Updating it')
else
DoomDebug('Updated Color Coords');
end;
//----------------------------------------------------------------------------\\
// --> BANKING <-- \\
//----------------------------------------------------------------------------\\
Function OpenMyBank:Boolean;
Var
i, SearchBank:Integer;
Begin
MarkTime(SearchBank)
repeat
If(FindObj(x, y, 'ank', 5066840, 5))Then
Begin
mouse(x, y, 1, 1, false);
If (ChooseOption('quickly'))OR ChooseOption('Bank Banker') Then
Begin
Flag;
repeat
Wait(100);
i := i + 1
until (BankScreen) OR (i >= 50) OR (PinScreen);
If (PinScreen) Then
Begin
DoomDebug('Pin screen detected..');
DoomDebug('Inputing pin..');
InPin(Players[CurrentPlayer].Strings[0]);
If (BankScreen) Then
Begin
DoomDebug('Pin successfully entered..');
End
Else
CloseBank;
LogOut;
Players[CurrentPlayer].Loc := 'Pin Screen Detected!';
Players[CurrentPlayer].Active := False;
Exit;
End;
DoomDebug('Bank opened!');
Result:= True;
End;
End;
until(BankScreen)Or (TimeFromMark(SearchBank)>=40000)
If (not(BankScreen))Then
DoomDebug('Can not find the bank at all.');
End;
{
//----------------------------------------------------------------------------\\
\\----------------------------------------------------------------------------// }
Procedure DepositFish;
Begin
ShrimpCount:= ( CountFishes(9020886, 9 ) );
AnchovyCount:= ( CountFishes(8283492, 9) );
Wait(250+Random(200));
ClickAllItemsColWait(9020886, 9, 'All', 1500);
ClickAllItemsColWait(8283492, 9, 'All', 1500);
TotalShrimp := (TotalShrimp + ShrimpCount);
TotalAnchovies := (TotalAnchovies + AnchovyCount);
Players[CurrentPlayer].Extendeds[0]:= Players[CurrentPlayer].Extendeds[0] + TotalShrimp;
Players[CurrentPlayer].Extendeds[1]:= Players[CurrentPlayer].Extendeds[1] + TotalAnchovies;
Banks := Banks + 1;
Players[CurrentPlayer].Extendeds[2]:= Players[CurrentPlayer].Extendeds[2] + 1;
CloseBank;
End;
//----------------------------------------------------------------------------\\
// --> NET FINDING <-- \\
//----------------------------------------------------------------------------\\
Function IsFishNet: Boolean;
Begin
GameTab(4);
If FindBitmapMaskTolerance(FishingNet, iX, iY, MIX1, MIY1, MIX2, MIY2, 2, 2)Then
Begin
Result := True;
End;
If(Result) Then
Begin
FishingNetColor := GetColor(iX, iY);
If (ExtendedDebug)Then
DoomDebug('Fishing Net Color: ' +IntToStr(FishingNetColor));
End;
If (Not(Result)) Then
Begin
If (ExtendedDebug)Then
DoomDebug('Can not find net in inventory.');
End;
End;
{
//----------------------------------------------------------------------------\\
\\----------------------------------------------------------------------------// }
Function FindNet: Boolean;
Begin
If (IsFishNet) Then
Begin
NoNet := False;
Result := True;
End
Else
NoNet := True;
Result := False;
End;
//----------------------------------------------------------------------------\\
// --> FISHING SPOT <-- \\
//----------------------------------------------------------------------------\\
Function FindFishingSpot(Var x, y: Integer): Boolean;
Var
FishColor : Integer;
Begin
If Not LoggedIn Then Exit;
ColorToleranceSpeed(2);
If FindColorSpiralTolerance(x, y, 15515800, 5, 5, 515, 336, 20) Then
Begin
FishColor := GetColor(x, y);
FindColorSpiralTolerance(x, y, FishColor, x - 10, y - 10, x + 10, y + 10, 30)
Result := True;
If(ExtendedDebug)Then
Begin
DoomDebug('Found fishing spot!');
End;
ColorToleranceSpeed(1);
Exit;
End Else
ColorToleranceSpeed(1);
End;
Function FindFishSpotClose(Var x, y:Integer): Boolean;
Var
FishColor, I, SizeOfBox : Integer;
Begin
If Not LoggedIn Then Exit;
ColorToleranceSpeed(2);
SizeOfBox := 5;
For I := 0 to 5 do
Begin
SizeOfBox := SizeOfBox + 5;
If FindColorSpiralTolerance(x, y, 15515800, MSCX - SizeOfBox, MSCY - SizeOfBox, MSCX + SizeOfBox, MSCY + SizeOfBox, 20) Then
Begin
FishColor := GetColor(x, y);
If (FindColorSpiralTolerance(x, y, FishColor, x - 10, y - 10, x + 1, y + 10, 30)) Then
Result := True;
If(ExtendedDebug)Then
Begin
DoomDebug('Found fishing spot!');
End;
ColorToleranceSpeed(1);
Exit;
End Else
ColorToleranceSpeed(1);
End;
End;
//----------------------------------------------------------------------------\\
// --> WALKING <-- \\
//----------------------------------------------------------------------------\\
Function WalkToFishSpot: Boolean;
Var
rX, rY : Integer;
Begin
If (DTMRotated(RockDTM, x, y, MMX1, MMY1, MMX2, MMY2)) Then
Begin
Mouse(x - 20, y, 2, 2, True);
Wait(5000);
Flag;
Wait(500+Random(405));
If (FindFishingSpot(x, y)) Then
Begin
Result:= True;
Exit;
End Else
If ( FindSymbol( rX, rY, 'fish' ) ) Then
Begin
Mouse(rX, rY, 2, 2, True);
Fishing:= False;
DoomDebug('Clicked on fishing symbol..');
Players[CurrentPlayer].Loc:= 'FishingSymbol';
Result:= True;
Flag;
Wait(500+random(400));
End;
End;
End;
{
//----------------------------------------------------------------------------\\
\\----------------------------------------------------------------------------// }
Function WalkToBank:Boolean;
Var
rX, rY : Integer;
Begin
If (DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2)) Then
Begin
Mouse(x, y, 4, 4, True);
Flag;
{If (OpenMyBank) Then
Begin
InBank:= True;
Result:= True;
Exit;
End Else}
If (FindSymbol(rX, rY, 'bank')) Then
Begin
Mouse(rX, rY, 2, 2, True);
Flag;
InBank:= True;
Result:= True;
End;
End;
End;
//----------------------------------------------------------------------------\\
// --> CHECK LOST EQUIP <-- \\
//----------------------------------------------------------------------------\\
Function LostEquip:Boolean;
Var
dX, dY, i : Integer;
Begin
If NOT(IsFishNet) Then
Result:= True;
Wait(1);
For i:= 0 to 4 do
Begin
If (FindColorSpiralTolerance(dX, dY, FishingNetColor, MSX1, MSY1, MSX2, MSY2, 5)) Then
Begin
Mouse(dX, dY, 1, 1, True);
Flag;
If (IsFishNet) Then
Exit;
End
Else
DoomDebug('We lost the net, and couldn''t find it.. :(');
DoomDebug('Terminating Player..');
Players[CurrentPlayer].Loc:= 'NetLost';
End;
End;
//----------------------------------------------------------------------------\\
// --> ANTI-RANDOMS <-- \\
//----------------------------------------------------------------------------\\
Function FindFastRandoms: Boolean; // By WT-Fakawi.
var
i: Integer;
begin
for i:=1 to 14 do
begin
case I of
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
8 : If RC Then Result := True;
9: If FindTalk Then Result := True;
10: If HandleTrade Then Result := True;
11: If HandleWhirlpool Then Result := True;
12: ProgressReport(False);
13: If ClickToContinue Then Result := True;
14: If (FindFight) Then
Begin
Result := True;
RunAwayDirection(Players[CurrentPlayer].Strings[1]);
Wait(5000 + Random(2500));
If (FindSymbol(x, y, 'Fish')) Then
Begin
Mouse(x, y, 2, 2, True);
Flag;
End;
End;
15: If (LostEquip) Then Result := True;
End;
Wait(1);
end;
end;
//----------------------------------------------------------------------------\\
// --> WAIT WHILST FISHING <-- \\
//----------------------------------------------------------------------------\\
Procedure WaitWhilstFishing;
Var
q, e, Mark, Current : integer;
i : Extended;
Begin
If not(Loggedin) then Exit;
Current := InvCount;
e := 70 + Random(30)
DoomDebug('Fishing');
MarkTime(Mark);
Repeat
If not(Loggedin) then Exit;
i := i + 1;
Status('Fishing: ' +FloatToStr(I)+ '/' +IntToStr(E));
If (FindFastRandoms)then Exit;
Wait(50);
If (FindNormalRandoms)then Exit;
Wait(50);
If (Random(6) = 0) then
For q := 1 to 4 do
Begin
i := i + 0.25;
If (Random(AntiBanRandomness) = 0) then DoAntiBan(False);
end;
If (FindNormalRandoms)then Exit;
Wait(50);
If (TimeFromMark(Mark) >= 10*1000) and (Current = InvCount) then
Break
else
begin
Current := InvCount;
MarkTime(Mark);
end;
Wait(50);
Until( I >= E ) OR (InvFull)
end;
Procedure FishBankLoop;
Begin
If (IsFishNet) Then
Begin
WalkToFishSpot;
Repeat
If (FindFishingSpot(X, y)) Then
Begin
Mouse(X, Y, 4, 4, True);
UpdateCoords(cx, cy, x, y, 15714472, 30);
Flag;
Wait(500+random(643));
Fishing:= True;
Players[CurrentPlayer].Loc := 'Fishing';
WaitWhilstFishing;
End;
Until (InvFull) OR (Not(LoggedIn));
MakeCompass('N');
If (Not(Fishing)) AND (Players[CurrentPlayer].Loc = 'FishingSymbol')Then
Begin
Repeat
Begin
If (FindFishingSpot(X, Y)) Then
Begin
Mouse(x, y, 4, 4, True);
UpdateCoords(cx, cy, x, y, 15714472, 30);
Flag;
Wait(500+random(643));
Players[CurrentPlayer].Loc := 'Fishing';
WaitWhilstFishing;
End;
End;
Until (InvFull) OR (Not(LoggedIn));
End;
MakeCompass('N');
If (InvFull) Then
Begin
WalkToBank;
If (InBank) Then
Begin
Players[CurrentPlayer].Loc := 'Bank';
OpenMyBank;
DepositFish;
ProgressReport(True);
End;
End;
End;
End;
Procedure PowerFishLoop;
Begin
Repeat
If (FindFishingSpot(X, y)) Then
Begin
Mouse(X, Y, 4, 4, True);
UpdateCoords(cx, cy, x, y, 15714472, 30);
Flag;
Wait(500+random(643));
Fishing:= True;
Players[CurrentPlayer].Loc := 'Fishing';
WaitWhilstFishing;
End;
Until (InvFull) OR (Not(LoggedIn));
MakeCompass('N');
If (Not(Fishing)) AND (Players[CurrentPlayer].Loc = 'FishingSymbol')Then
Begin
Repeat
Begin
If (FindFishingSpot(X, Y)) Then
Begin
Mouse(x, y, 4, 4, True);
UpdateCoords(cx, cy, x, y, 15714472, 30);
Flag;
Wait(500+random(643));
Players[CurrentPlayer].Loc := 'Fishing';
WaitWhilstFishing;
End;
End;
Until (InvFull) OR (Not(LoggedIn));
End;
MakeCompass('N');
If (InvFull) Then
Begin
Players[CurrentPlayer].Loc := 'Dropping';
ShrimpCount:= ( CountFishes(9020886, 9 ) );
AnchovyCount:= ( CountFishes(8283492, 9) );
Drop(9020886, 9);
Drop(8283492, 9);
TotalShrimp := (TotalShrimp + ShrimpCount);
TotalAnchovies := (TotalAnchovies + AnchovyCount);
Players[CurrentPlayer].Extendeds[0]:= Players[CurrentPlayer].Extendeds[0] + TotalShrimp;
Players[CurrentPlayer].Extendeds[1]:= Players[CurrentPlayer].Extendeds[1] + TotalAnchovies;
Players[CurrentPlayer].Extendeds[2]:= Players[CurrentPlayer].Extendeds[2] + 1;
ProgressReport(True);
End;
End;
//----------------------------------------------------------------------------\\
// --> MAIN LOOP <-- \\
//----------------------------------------------------------------------------\\
begin
SetupSRL;
ClearDebug;
CheckVersion;
Intro;
ExpPerItem;
DeclarePlayers;
GenerateNickNames;
ActivateClient;
Wait(100);
LoadBMPDTM;
SymbolAccuracy:= 0.4;
ScriptID:= '251';
SRLID := YourSRLstatsID;
SRLPassword := YourSRLstatsPASS;
Repeat
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
If not(Loggedin)then LoginPlayer;
Status('Preparing Character');
PlayerStartTime := GetSystemTime;
GameTab(4);
SetRockDTM;
SetBankDTM;
DoomDebug('Calibrating..');
HighestAngle;
GetAllLevels;
AutoRetaliate(False);
SetRun(True);
Repeat
Case Players[CurrentPlayer].Booleans[0] Of
True : FishBankLoop;
False : PowerFishLoop;
End;
Until ( Players[CurrentPlayer].Extendeds[2] >= Players[CurrentPlayer].Integers[0] ) OR (Not(LoggedIn));
Players[CurrentPlayer].Extendeds[2] := 0;
FreeBitmap(NickNameBMP);
ProgressReport(True);
NextPlayer(LoggedIn);
Until(False)
end.