From: Rasta Magician
yes, it should overnight without any trouble. Maybe the odd whirlpool, but i think it now catches all of them.
Just remember that if your char's are low levels there are NPCs that'll keep on hitting you.
@Colluci
Did you include Smart BEFORE including srl?
and Mormonman, you might want to wait another hour or two, as i am about to release a better version (autoresponder and better proggy)
~RM
Hey thanks for answering
here the script changed by me.
{==============================================================================]
[==============================================================================]
[ RM Fisher 0.90 ]
[ By: Rasta Magician ]
[==============================================================================]
[ Features ]
[==============================================================================]
[ 1. Debug ]
[ 2. AntiRandoms ]
[ 3. AntiBan ]
[ 4. Multiplayer ]
[ 5. Resting ]
[ 6. Progress Report ]
[ 7. Local Control ]
[ 8. Responder ]
[ 9. Proggy To File ]
[ 10. Solves Whirlpool ]
[ 11. Picks up Fishing Equipment ]
[ 12. Auto-Detects fishing type ]
[==============================================================================]
[ Description ]
[==============================================================================]
[ A Stable Fisher that can fish anywhere and any fish. ]
[ ]
[ ]
[ ]
[==============================================================================]
[ How To Use ]
[==============================================================================]
[ Fill in DeclarePlayers, Place your players close to a Fishing spot, with ]
[ fishing equipment in inventory and jsut press play. ]
[ ]
[ To use local control press F12 while fishing. ]
[==============================================================================]
[ Credits ]
[==============================================================================]
[ SRL Team ]
[ Wizzup? - DebugTPA ]
[==============================================================================]
[ RM Fisher by Rasta Magician ]
[==============================================================================]
[==============================================================================}
program RMScript;
{.include srl/srl.scar}
{.include srl/srl/skill/Fishing.scar}
{.Include SRL\SRL\Misc\SMART.SCAR}
Const
WorkTime = (10*60*1000); //10 mins
RestTime = (3*60*1000); //3 mins
UseDebug = True;
UseResponder = True;
SaveProggyToFile = True;
SaveImages = True; //this is to help me improve the script
MaxImages = 200;
ScriptName = 'RM Fisher'; // No Touchy!
Version = '0.90'; // No Touchy!
YourSRLID = '4066'; //your SRLID, if you dont have one leave as is
YourSRLPass = 'helloworld'; //your SRL Stats pass, if you dont have one leave as is
MyScriptID = '1137'; // don't touch
var
Rested, Worked, Loads, FishSymbolColor,
NetDTM, RodDTM, FlyDTM, CageDTM, HarpoonDTM,
IsFishCloseN, FoundWhirlPoolN, FoundFishSpotN :integer;
ProggyStr: string;
// By Wizzup?
Function DebugTPA(Points: TPointArray; BmpName: String): Boolean;
Var
Width, Height, ClientBMP, I: Integer;
xs, ys, xe, ye: Integer;
Begin
Try
Begin
xe := xs xor xs;
ye := ys xor ys;
xs := 1 shl 20;
ys := 1 shl 20;
For I := 0 To High(Points) Do
Begin
xs := Min(xs, Points[i].X);
ys := Min(ys, Points[i].Y);
xe := Max(xe, Points[i].X);
ye := Max(ye, Points[i].Y);
End;
Width := xe - xs;
Height := ye - ys;
DisplayDebugImgWindow(0, 0);
DisplayDebugImgWindow(Width, Height);
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, xs, ys, xe, ye);
For I := 0 To High(Points) Do
FastSetPixel(ClientBMP, Points[i].X - xs, Points[i].Y - ys, 255);
If BmpName <> '' Then
SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
DisplayDebugImgWindow(Width, Height);
FreeBitmap(ClientBMP);
End
Except
FreeBitmap(ClientBMP);
End;
Result := True;
End;
//Declaring players
Procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := True;
end;
//Used for debugging and finding errors
Procedure RMDebug(s:string);
var name:string;
begin
if not UseDebug then exit;
try name := Players[CurrentPlayer].Name +' : '; except name:= '' end;
writeln(name+TheTime+' - '+s);
end;
//local control, F12 to activate and then text. used to check on proggies and
//to reactivate players
//untested with smart, might not work
Procedure EasyRC;
var
i, h1, h2, x, y:integer;
s, str: string;
begin
if not LoggedIn then exit;
if IsFKeyDown(12) then
begin
h1 := GetClientWindowHandle;
GetMousePos(x, y);
SetClientPos(False);
Disguise('RM Easy RC');
if FindWindowTitlePart('RM Easy RC', false) then writeln('Using Easy RC');
h2 := GetClientWindowHandle;
SetOnTop(h1, False);
SetOnTop(h2, True);
SetClientWindowHandle(h2);
wait(100);
ActivateClient;
wait(100);
repeat
s:= ReadLn('What to do?'+chr(13)+'Status / Reset N / Reset All / Proggy / Exit');
lowercase(s);
if (s = 'exit') or (s = '') then break;
if s= 'status' then
begin
for i:= 0 to High(Players) do
if not Players[i].Active then str:= str+chr(13)+Players[i].Name;
readln('these are set to false: '+chr(13)+str+chr(13)+'Press ok');
end;
if s = 'proggy' then
begin
Readln(ProggyStr+chr(13)+'Press ok');
end;
if Pos('reset', s) > 0 then
begin
str := TrimLetters(Trim(s));
if str = '' then
begin
for i:= 0 to High(Players) do
Players[i].Active:= True;
ReadLn('All Players Active'+chr(13)+'Press ok');
end else
try begin
i:= StrToInt(str);
Players[i].Active := True;
Readln('activated player: '+str+chr(13)+'Press ok');
end except break end;
end;
until(false)
SetOnTop(h2, False);
SetOnTop(h1, True);
SetClientWindowHandle(h1);
ActivateClient;
MMouse(x, y, 2, 2);
wait(3000);
Disguise(' A: '+IntToStr(PlayersActive)+'/'+IntToStr(Length(Players))+' Loads: '+IntToStr(loads));
end;
end;
type
MyChat = record
Chatter: TStringArray;
Said: TStringArray;
LastResponded: integer;
end;
var
Trigger: Array of Array[0..1] of TStringArray; //questions, could make more triggers... if i
Answers: Array of TStringArray; //find i need them
RMTalks: MyChat;
procedure SetupRespond;
begin
SetLength(RMTalks.Chatter, 8);
SetLength(RMTalks.Said, 8);
SetLength(Trigger, 5); //how many questions
SetLength(Answers, Length(Trigger));
//you can have as many trigger words and rows as you want
//you can have as many answers as you want
Trigger[0][0]:= ['wc', 'woodcutting']; // trigger words 1
Trigger[0][1]:= ['lvl', 'level']; // trigger words 2
//Trigger[0][2]:= ['','','','','','']; // trigger words 3
Answers[0]:= [
'My Woodcutting Level is: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 1
'Wc: '+IntToStr(Players[CurrentPlayer].Level[20]), //answer 2
IntToStr(Players[CurrentPlayer].Level[20])+' wc lvl', //answer 3
'my wcing lvl is '+IntToStr(Players[CurrentPlayer].Level[20]) //answer 4
]
Trigger[1][0] := ['axe'];
Trigger[1][1] := ['which', 'what'];
Answers[1] := [
'I''m using a '+Players[CurrentPlayer].Strings[2]+' axe',
Players[CurrentPlayer].Strings[2],
'my axe is made out of '+Players[CurrentPlayer].Strings[2]
]
Trigger[2][0]:= ['good place', 'train'];
Trigger[2][1]:= ['woodcutting', 'wc'];
Answers[2] := [
'Try Training Woodcutting at Draynor',
'Draynor', 'Varrock', 'Edgy', 'Fally',
'Try Training Woodcutting at Edgeville',
'Try Training Woodcutting at Varrock Palace',
'Try Training Woodcutting at South of Falador'
]
end;
//from srl, modded ofr any line
function GetChatTextLine(var chat: string; line:integer): Boolean;
var
x, y: Integer;
textP: TPoint;
begin
if not LoggedIn then exit;
textP := TextCoords(line);
if findcolor(x, y, 16711680, textp.x, textp.y, textp.x + 200, textp.y + 14) then
begin
chat := LowerCase(Trim(GetTextAtEx(x - 3, textp.y - 2, 0, SmallChars, False,
False, -1, 1, 16711680, 60, False, tr_allChars)));
Result := True;
end;
end;
//from srl, modded for any line
function GetChatterLine(var name: string; line:integer): Boolean;
var
i: Integer;
textP: TPoint;
begin
if not LoggedIn then exit;
textP := TextCoords(line);
name := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
0, 60, False, tr_allChars)))
i := Pos(':', name)
if (i <> 0) then
begin
Delete(name, i, i);
Result := True;
end;
end;
procedure RMRespond;
var
str: string;
i, h, t, k, triggered:integer;
TSA:TStringArray;
begin
if not LoggedIn then exit;
if (TimeFromMark(RMTalks.LastResponded) < 60000+Random(30000)) then exit;
SetLength(TSA, 8)
str:='';
TSA:=['', '', '', '', '', '', '', ''];
RMTalks.said := ['', '', '', '', '', '', '', ''];
triggered := 0;
// Getting text on all the lines
for i:= 7 DownTo 0 do
begin
GetChatterLine(RMTalks.Chatter[i], i+1);
if Pos(Lowercase(Players[CurrentPlayer].Nick), Lowercase(RMTalks.Chatter[i])) > 0 then
break; //if we already answered, it means we already checked further up.
GetChatTextLine(RMTalks.said[i], i+1);
TSA[i] := RMTalks.said[i];
end;
for i:=High(TSA) DownTo 0 do //all text lines
for h:= 0 to High(Trigger) do //questions
begin
triggered:= 0;
for t:=0 to High(Trigger[h]) do //How many triggers
for k:=0 to High(Trigger[h][t]) do //specific trigger
if Pos(Trigger[h][t][k], TSA[i]) > 0 then
begin
Inc(triggered);
if triggered >= 2 then
begin
str:=(Answers[h][Random(Length(Answers[h]))]);
TypeSend(str); str := '';
MarkTime(RMTalks.LastResponded);
triggered := 0;
exit;
end; //end if
break;
end; //end if
//end k loop
end; //end h loop
//end of i loop
end;
//making sure we solve those annoying randoms :)
Function NoRandoms: boolean;
var
x, y:integer;
s:string;
begin
if not LoggedIn then exit;
GetMousePos(x, y);
//if UseResponder then RMRespond;
if ClickToContinue then MMouse(x, y, 3, 3);
if FindNormalRandoms then Result:=true;
if FindFight then
begin
//none of the run aways check for randoms....
case random(4) of
0: s:= 'N';
1: s:= 'E';
2: s:= 'S';
3: s:= 'W';
end;
RunTo(s, True);
Result:=True;
wait(1000);
NoRandoms;
end;
EasyRc;
end;
//Progress report
procedure Proggy;
var JX2:integer;
begin
ClearReport;
SRLRandomsReport;
AddToReport('[====== '+Padr(ScriptName+' '+Version, 27)+' ======]');
AddToReport('[ By Rasta Magician ]');
AddToReport('[=========================================]');
AddToReport('[ ' + Padr('Written ' + (TheTime) + ' on ' + (TheDate(3)) + '.', 40) + ']')
AddToReport('[ '+ Padr(TimeRunning, 40)+']');
AddToReport('[ ' + Padr('Players: ' + IntToStr(PlayersActive), 40) + ']');
AddToReport('[ ' + Padr('Current Player: ' + Players[CurrentPlayer].Nick, 40) + ']');
AddToReport('[ '+ Padr('Loads: '+IntToStr(Loads), 40)+']');
AddToReport('[ '+Padr('Rested: '+IntToStr(Rested), 40)+']');
AddToReport('[==================== RM =================]');
ProggyStr := '';
ProggyStr := ProggyStr + chr(13) + ('[====== '+Padr(ScriptName+' '+Version, 27)+' ======]');
ProggyStr := ProggyStr + chr(13) + ('[ By Rasta Magician ]');
ProggyStr := ProggyStr + chr(13) + ('[=========================================]');
ProggyStr := ProggyStr + chr(13) + ('[ ' + Padr('Written ' + (TheTime) + ' on ' + (TheDate(3)) + '.', 40) + ']');
ProggyStr := ProggyStr + chr(13) + ('[ ' + Padr('Players: ' + IntToStr(PlayersActive), 40) + ']');
ProggyStr := ProggyStr + chr(13) + ('[ '+ Padr('Loads: '+IntToStr(Loads), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[ '+Padr('Rested: '+IntToStr(Rested), 40)+']');
ProggyStr := ProggyStr + chr(13) + ('[==================== RM =================]');
if SaveProggyToFile then
begin
JX2 := ReWriteFile((ScriptPath + ScriptName +' '+ Version + '.txt'), False);
WriteFileString(JX2, ProggyStr);
CloseFile(JX2);
writeln('Progress report saved to: ' + ScriptPath + ScriptName + ' ' + Version + '.txt');
end;
Disguise(' A: '+IntToStr(PlayersActive) + '/' + IntToStr(PlayersActive) +
' Loads: ' + IntToStr(Loads));
end;
//Antiban, basically just picks up the mouse, increases mouse speed
//clicks a tab and resets everything back to the original.
//just to make sure we stay logged in.
procedure FastSwitchTabs;
var x, y, i, h:integer;
begin
if not LoggedIn then exit;
GetMousePos(x, y);
PickUpMouse;
IncEx(MouseSpeed, 10);
i := GetCurrentTab;
repeat
h := 1+Random(12);
until(h <> i)
GameTab(h);
wait(500+Random(500));
GameTab(i);
MMouse(x, y, 3, 3);
DecEx(MouseSpeed, 10);
end;
//will take "Time" + Random(1000) to complete the action, will return to original angle
// By Rasta Magician, heavily based on RandomMovement by Krazy_Meerkat
// will always move the compass around unlike in RandomMovement
procedure CompassMove(Time:Integer);
var
Keys: array of Integer;
I: Integer;
Deg: Extended;
begin
if not LoggedIn then exit;
Keys := [VK_RIGHT, VK_LEFT];
I := Random(2);
ActivateClient;
Deg := rs_GetCompassAngleDegrees;
Wait(100 + random(50));
KeyDown(Keys[I]);
Wait(Round(Time/2) + random(500));
KeyUp(Keys[I]);
Wait(Round(Time/2) + random(500));
MakeCompass(FloatToStr(Deg));
end;
//Random Right Click Return by Rasta Magician,
//Will right-click anywhere on he main map, choose "Cancel" and return the
//mouse to it's original position
procedure RRClickReturn;
var M, x, y:integer;
begin
if not LoggedIn then exit;
M := MouseSpeed;
GetMousePos(x, y);
MouseSpeed := MouseSpeed + Random(7);
ActivateClient;
Mouse(MSX1, MSY1, MSX2, MSY2, False);
wait(100 + Random(50));
ChooseOption('ancel');
wait(100 + Random(100));
MMouse(x, y, 3, 3);
MouseSpeed := M;
end;
Procedure AntiBan(percentage: integer);
begin
if not Loggedin then exit;
if random(100) <= percentage then
begin
case random(12) of
0, 1: FastSwitchTabs;
2, 3: CompassMove(1000);
4, 5: RRClickReturn;
6, 7: SleepAndMoveMouse(2000);
8, 9: HoverSkill('random', false);
10, 11: PickUpMouse;
end;
RMDebug('Antiban');
GameTab(4);
wait(200+Random(50));
end;
end;
procedure DoSomeFishing; forward;
//Just a few things it does when the script ends.
procedure ScriptTerminate;
begin
Proggy;
writeln('');
writeln('Thank for using my script, Rasta Magician');
writeln('Script stopped at ' + TheTime + ' ' + TheDate(3));
writeln('Please post the Progress Report');
FreeDTM(HarpoonDTM);
FreeDTM(CageDTM);
FreeDTM(FlyDTM);
FreeDTM(RodDTM);
FreeDTM(NetDTM);
end;
Procedure LoadDTMs;
begin
NetDTM := DTMFromString('78DA8DCDCD0A40601484E1735C83FBDF8ABE8' +
'5FC441F8A52DC156F3692326631B3796A7C4ACC2AB767DCD2ABCD' +
'0EE21193BDCDDDEC82C985593185303BA61466C374C2CC9851981' +
'E330853FFF80A9856980613BECD0916BF140B');
RodDTM := DTMFromString('78DA637CC6C4C0B08591011530229140FA0E5' +
'0CD66026A6E02D56C27A0E63650CD2E026AEE03D51C20A0E61150' +
'CD41026A9E02D5EC21A0E63950CD4E026ADE03D52C21C29CD504D' +
'43C00AAD9885F0D00D0A311CA');
FlyDTM := DTMFromString('78DA637CC2C4C03091910119D8E9733088006' +
'990E87F2060BC0954330D550D44164602E91B4035D309A8B90554' +
'338B809ADB40357308A87904543397809A1740359309A8790D54D' +
'34940CD5BA09A2E026A3E02D53412E16642E6DC07AAE9C7AF0600' +
'1897163C');
CageDTM := DTMFromString('78DA637CC6C4C0B089910119C43AF03088006' +
'990E87F20607C0C54B302550D44164602E9EB40355B08A8790854' +
'7380809AB740357B09A8F90454B39D0835ABF1AB01004D731022');
HarpoonDTM := DTMFromString('78DA63DCCDC4C070959101192479F13288006' +
'990E87F2060DC0354730E550D44164602E99D98E660A8D90854F3' +
'98809A4D40354F09A8D90F547389809AC34035E709A8390654739' +
'2809A434035C7F1AB0100542B130D');
end;
Function FindFishSpot: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
TimeMark, i: Integer;
Colors: TIntegerArray;
TP: TPoint;
begin
RMDebug('Looking for fish spot');
Result := False;
MarkTime(TimeMark);
Colors := [10457222, 11379614, 12169645, 12828090, 10786701];
SetLength(ATPA, Length(Colors));
for i:= 0 to 4 do
begin
FindColorsSpiralTolerance(MSCX,MSCY,ATPA[i], Colors[i],MSX1,MSY1,MSX2,MSY2, 5);
end;
TPA := MergeATPA(ATPA);
if Length(TPA) <= 0 then
begin
RMDebug('Couldn''t find fish spot - color search');
exit;
end;
Writeln('Took: '+IntToStr(TimeFromMark(TimeMark))+' ms.') //it's taking 100+ ms...
{
if SaveImages then
begin
if FoundFishSpotN >= MaxImages then FoundFishSpotN := 0
else Inc(FoundFishSpotN);
DebugTPA(TPA, 'RM_Fisher_Images - FoundFishSpot'+IntToStr(FoundFishSpotN)) ;
end;
}
ATPA := SplitTPA(TPA, 10);
SortATPAFrom(ATPA, IntToPoint(MSCX, MSCY));
for i := 0 to High(ATPA) do
begin
TP := MiddleTPA(ATPA[i]);
MMouse(TP.x, TP.y, 5, 5);
wait(250);
If IsUpText('ishin' ) then
begin
wait(Random(100));
RMDebug('Fish Points: ' + IntToStr(Length(ATPA[i])));
Result := True;
exit;
end;
end;
RMDebug('Couldn''t find fish spot');
end;
Function DiscoverFishEquip: String;
var
i, Ix, Iy:integer;
begin
Result := '';
Gametab(4);
for i:= 4 Downto 0 do
begin
case i of
4: if FindDTM(HarpoonDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2) then Result := 'Harpoon';
3: if FindDTM(CageDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2) then Result := 'Cage';
2: if FindDTM(FlyDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2) then Result := 'Fly';
1: if FindDTM(RodDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2) then Result := 'Rod';
0: if FindDTM(NetDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2) then Result := 'Net';
end;
if Result <> '' then break;
end;
RMDebug('fishing equip found: ' + Result);
end;
Function CheckEquip(name: String):Boolean;
var Ix, Iy:integer;
begin
Gametab(4);
case lowercase(name) of
'harpoon': Result := FindDTM(HarpoonDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2);
'cage': Result := FindDTM(CageDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2);
'fly': Result := FindDTM(FlyDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2);
'rod': Result := FindDTM(RodDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2);
'net': Result := FindDTM(NetDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2);
end;
end;
function PickUpFishingEquip(name:string):boolean;
var
TVFishingArray: TVariantArray;
x, y:integer;
begin
Result := False;
RMDebug('Looking for equip on the floor');
case lowercase(name) of
'harpoon': TVFishingArray := ['arpoon', 6645357, 14];
'cage': TVFishingArray := ['obster pot', 6974323, 7];
'fly', 'fly fishing': TVFishingArray := ['ly fishing', 872554, 13];
'rod', 'rod fishing': TVFishingArray := ['shing rod', 602951, 15];
'net': TVFishingArray := ['ing net', 1844525, 11];
else exit;
end;
FFLag(0);
if (FindObj(x, y, TVFishingArray[0], TVFishingArray[1], TVFishingArray[2])) then
begin
RMDebug('Found Equip');
Inc(RodsFound);
Result := True;
Mouse(x, y, 0, 0, True)
FFlag(0);
FTWait(5);
end else
RMDebug('Could not find equip');
end;
//By ACA2
function AutoColorFishSymbol: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.67, 1.30);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 15889937, MMX1, MMY1, MMX2, MMY2, 8);
if (Length(arP) = 0) then
begin
RMDebug('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) then
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 8) and (R <= 45) and (G >= 35) and (G <= 207) and (B >= 209) and (B <= 256) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 12.35) and (X <= 41.17) and (Y >= 5.95) and (Y <= 51.91) and (Z >= 61.44) and (Z <= 102.45) then
begin
Result := arC[i];
RMDebug('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
RMDebug('AutoColor failed in finding the color.');
end;
Function FindFishSymbol(close:boolean; var TP: TPoint): boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i: integer;
begin
Result := False;
RMDebug('looking for fish symbol');
FindSymbols(TPA, 'fish')
if Length(TPA) > 0 then
begin
RMDebug('found fish symbol')
FishSymbolColor := AutoColorFishSymbol;
Result := True;
end else begin
RMDebug('no fish symbol, looking with autocolor');
FindColorsTolerance(TPA, FishSymbolColor, MMX1, MMY1, MMX2, MMY2, 5);
if Length(TPA) > 0 then
begin
Result := True;
ATPA := SplitTPA(TPA, 3);
for i:= 0 to High(ATPA) do
TPA[i] := MiddleTPA(ATPA[i]);
RMDebug('Found Symbol with AutoColor');
end else begin
RMDebug('Still Couldn''t find symbol');
end;
end;
SortTPAFrom(TPA, IntToPoint(MMCX, MMCY));
if close then
TP := TPA[0]
else
TP := TPA[High(TPA)];
end;
Function IsFishSpotClose: boolean;
var
FindFish, i, h:integer;
TPA: TPointArray;
ATPA, ATPA2: T2DPointArray;
Colors: TIntegerArray;
TBs: Array[0..3] of TBox;
begin
Result := False;
MarkTime(FindFish);
repeat
Colors := [10457222, 11379614, 12169645, 12828090, 10786701];
TBs[0] := IntToBox(MSCX-20, MSCY - 60, MSCX + 20, MSCY - 20);
TBs[1] := IntToBox(MSCX+20, MSCY - 20, MSCX + 60, MSCY + 20);
TBs[2] := IntToBox(MSCX-20, MSCY + 20, MSCX + 20, MSCY + 60);
TBs[3] := IntToBox(MSCX-60, MSCY - 20, MSCX - 20, MSCY + 20);
SetLength(ATPA, Length(Colors));
SetLength(ATPA2, Length(TBs));
for h:= 0 to 3 do
begin
for i:= 0 to High(Colors) do
FindColorsSpiralTolerance(MSCX,MSCY,ATPA[i], Colors[i], TBs[h].x1, TBs[h].y1, TBs[h].x2, TBs[h].y2, 5);
try ATPA2[h] := MergeATPA(ATPA) except RMDebug('something went wrong with MergeATPA') end;
end;
try TPA := MergeATPA(ATPA2) except RMDebug('something went wrong with MergeATPA2') end;
if Length(TPA) > 20 then
begin
Result := True;
{
if SaveImages then
begin
if IsFishCloseN >= MaxImages then IsFishCloseN := 0
else Inc(IsFishCloseN);
if Length(TPA) > 0 then
DebugTPA(TPA, 'RM_Fisher_Images - IsFishClose'+IntToStr(IsFishCloseN)) ;
end;
}
exit;
end;
wait(300);
until(TimeFromMark(FindFish) > 3000)
end;
Function NextSpot: integer;
var
i:integer;
begin
if not LoggedIn then exit;
Result := 1;
for i:=1 to 28 do
if not ExistsItem(i) then
begin
Result:= i;
exit;
end;
end;
procedure DropFish;
var i, x, y:integer;
begin
for i:= 1 to 28 do
begin
if (i mod 3) = 0 then NoRandoms;
MMouseItem(i);
wait(100 + random(50));
if IsUpTextMultiCustom(['nchovies', 'erring', 'obster', 'pike',
'almon', 'hrimps', 'ardine', 'wordfish', 'trout', 'tuna'])
then
begin
GetMousePos(x, y);
Mouse(x, y, 2, 2, false);
wait(100+Random(50));
ChooseOption('Drop');
wait(RandomRange(50, 100));
end;
end;
Inc(Loads);
Inc(ReportVars[0]);
Proggy;
end;
Function StartFishing: boolean;
var
i, x, y:integer;
s: string;
begin
i:= 0;
Result := False;
if not CheckEquip(Players[CurrentPlayer].Strings[0]) then
begin
wait(1000 + Random(500));
if not PickUpFishingEquip(Players[CurrentPlayer].Strings[0]) then
begin
LogOut;
RMDebug('Player has no fishing equipment');
end;
end;
while not FindFishSpot do
begin
wait(1000);
inc(i);
if i > 3 then break;
end;
if i < 4 then
begin
GetMousePos(x, y);
case lowercase(Players[CurrentPlayer].Strings[0]) of
'harpoon': s := 'arpoon Fis';
'cage': s := 'age Fis';
'fly': s:= 'ure Fis';
'rod': s:= 'ait Fis';
'net': s:='et Fis';
end;
if IsUpText(s) then
begin
RMDebug('Started Fishing');
Result := True;
Mouse(x, y, 2, 2, True);
end else begin
Mouse(x, y, 2, 2, False);
wait(100 + Random(50));
if ChooseOption(s) then
begin
RMDebug('Started Fishing');
Result := True;
end;
end;
end;
end;
function FoundWhirlPoolMS: Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
Result := False;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.21, 1.58);
if not(FindColorsTolerance(arP, 13940675, MSX1, MSY1, MSX2, MSY2, 15)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := TPAToATPAEx(arP, 40, 40);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) > Round(300*WhirlPoolAcc)) then
begin
Result := True;
RMDebug('Found Whirlpool! n: '+IntToStr(FoundWhirlpoolN));
RMDebug('Whirpool Points: '+IntToStr(Length(ararP[i])));
if SaveImages then
begin
if FoundWhirlPoolN >= MaxImages then FoundWhirlPoolN := 0
else Inc(FoundWhirlPoolN);
DebugTPA(ararP[i], 'RM_Fisher_Images - FoundWhirlPool'+IntToStr(FoundWhirlPoolN)) ;
end;
break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
procedure RMHandleWhirlPool;
begin
if FoundWhirlPoolMS then
begin
Status('Whirlpool found!');
Inc(WhirlPools);
Mouse(MMCX + 5, MMCY + 5, 2, 2, True);
FTWait(50 + Random(15));
repeat
Antiban(50);
if (not (LoggedIn)) then Exit;
FTWait(2 + Random(2));
until not FoundWhirlPoolMS;
//could start fishing another spot instead of this
wait(Random(1000));
if not StartFishing then DoSomeFishing;
end;
end;
Procedure WaitWhileFishing;
var
LastMove, CheckSpot, SpotMark, FindFish, LastChecked, x, y: integer;
s: string;
begin
if not LoggedIn then exit;
MarkTime(FindFish);
MarkTime(LastMove);
FFlag(0);
repeat
case lowercase(Players[CurrentPlayer].Strings[0]) of
'harpoon': s:= 'start harpooning';
'cage': s:= 'attempt to catch';
'fly': s:= 'attempt to catch';
'rod': s:= 'attempt to catch';
'net': s:= 'cast out your';
end;
if IsChatBoxTextAnyLine(s, clMessage) then break;
if TimeFromMark(FindFish) > 7000 then
begin
if FindTextTpa(0,2,MCX1,MCY1,MCX2,MCY2, 'have any feathers', NPCChars, Nothing) or
FindTextTpa(0,2,MCX1,MCY1,MCX2,MCY2, 'have any fishing bait', NPCChars, Nothing) then
begin
RMDebug('Player is missing feathers / bait');
RMDebug('Logging Out');
LogOut;
exit;
end;
RMDebug('Getting to fish spot took too long');
exit;
end;
until(false);
CheckSpot := NextSpot;
MarkTime(SpotMark);
RMDebug('Waiting while fishng');
NoRandoms;
RMHandleWhirlpool;
MarkTime(LastChecked);
MarkTime(FindFish);
repeat
if (TimeFromMark(Worked) >= (WorkTime + Random(3*60*1000)))or(not LoggedIn) then
break;
If TimeFromMark(LastChecked) > 500 then
begin
if NoRandoms then
if not StartFishing then
break;
RMHandleWhirlpool;
MarkTime(LastChecked);
end;
if ExistsItem(CheckSpot) then
begin
CheckSpot := NextSpot;
wait(50);
MarkTime(SpotMark);
end;
wait(450);
if (TimeFromMark(SpotMark) > 30000) then
begin
wait(300);
RMDebug('Not Fishing...');
if not StartFishing then break else MarkTime(SpotMark);
end;
if TimeFromMark(LastMove) > (20000 + Random(5000)) then
begin
AntiBan(100);
MarkTime(LastMove);
end;
if not CheckEquip(Players[CurrentPlayer].Strings[0]) then
begin
wait(1000 + Random(500));
if not PickUpFishingEquip(Players[CurrentPlayer].Strings[0]) then
begin
LogOut;
RMDebug('Player has no fishing equipment');
break;
end;
end;
if InvFull then
begin
DropFish;
if not StartFishing then break;
end;
if TimeFromMark(FindFish) > 3000 then
if not IsFishSpotClose then
begin
RMDebug('There is no fishing spot nearby');
break;
end else MarkTime(FindFish);
until(false)
end;
procedure DoSomeFishing; //only here while testing i think
var
TP: TPoint;
i, t, x, y: integer;
StartedFishing, FoundSymbol: boolean;
s: string;
begin
if not CheckEquip(Players[CurrentPlayer].Strings[0]) then
begin
wait(1000 + Random(500));
if not PickUpFishingEquip(Players[CurrentPlayer].Strings[0]) then
begin
LogOut;
RMDebug('Player has no fishing equipment');
end;
end;
if InvFull then DropFish;
for i:= 0 to 3 do
begin
FoundSymbol := False;
if FindFishSymbol((i = 0), TP) then
begin
FoundSymbol := True;
if (i = 0)and(InCircle(TP.x, TP.y, MMCX, MMCY, 12)) then
wait(1)
else begin
Mouse(TP.x, TP.y, 3, 3, true);
FFlag(0);
wait(1000+Random(500));
end;
if not FoundSymbol then
begin
LogOut;
RMDebug('Could not Find Fish symbol');
RMDebug('Logged out player: '+ Players[CurrentPlayer].Name);
exit;
end;
if StartFishing then
begin
WaitWhileFishing;
break;
end;
end;
end;
end;
//Used to set up all the necessary things before the script starts running
Procedure SetupScript;
begin
ClearDebug;
WriteLn ('Loading SMART')
SMARTSetupEx(16, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
WriteLn ('Smart Loaded')
SetupSRL;
LoadDTMs;
DeclarePlayers;
if UseResponder then SetupRespond;
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
ScriptID := MyScriptID;
ActivateClient;
LoginPlayer;
end;
//for prepqring the playe and making sure he has all the requirements
procedure SetupPlayer;
begin
if not LoggedIn then exit;
repeat
SetGraphics(4, 'current', 'always', 'off', 'low', 'few', 'off', 'few', 'off');
SetAngle(true);
MarkTime(Worked);
Players[CurrentPlayer].Strings[0] := DiscoverFishEquip;
if Players[CurrentPlayer].Strings[0] <> '' then
break
else begin
NextPlayer(false);
RMDebug('player had no equipment');
end;
until(false)
end;
//switching palyers, or in case of jsut one player making it rest
// "not playing" for a while decreases the chance of getting a lot of randoms
procedure SwitchPlayers;
begin
if ( (TimeFromMark(Worked) >= ( WorkTime + Random(3*60*1000)) ) )or(LoggedIn = False) then
begin
if PlayersActive > 1 then
begin
NextPlayer(LoggedIn);
RMDebug('Switching players, ' + Players[CurrentPlayer].Name +'going to ' + BoolToStr(LoggedIn));
end else begin
if not LoggedIn then TerminateScript;
LogOut;
RMDebug('resting....');
Disguise('(Rest) A: '+IntToStr(PlayersActive) + '/' + IntToStr(PlayersActive) +
' L: ' + IntToStr(Loads));
if RestTime > 60000 then
begin
wait(RestTime - 60000);
Disguise('1M to Restart');
RMDebug('Re-Starting in 1 Minute');
wait(60000);
end else
wait(RestTime);
Disguise(' A: '+IntToStr(PlayersActive) + '/' + IntToStr(PlayersActive) +
' Loads: ' + IntToStr(Loads));
ActivateClient;
LoginPlayer;
Inc(Rested);
MarkTime(Worked);
end;
SetupPlayer;
end;
end;
begin
SetupScript;
SetupPlayer;
repeat
if not LoggedIn or AllPlayersInactive then exit;
DoSomeFishing;
Proggy;
SwitchPlayers;
until(false)
end.
Line 7: [Error] (16402:11): Duplicate identifier 'MOVEMOUSE' in script C:\Users\TMN\Desktop\SCAR\includes\SRL\SRL\Misc\SMART.SCAR
Well, I understand what the error means but i dunno how to fix.
EDIT:I'll try with the new version
EDIT1:Same error.