SRL Archive - Help

Finding fishing spots? [On private server]


Pew

2012-12-29 02:41:01

I have tried bitmap and DTM but the animation is constantly changing. I know I could use direct co-ords but when you move to a new fishing spot you move so they would be inaccurate.

I don't mind if it's hard/requires learning new things.

Wardancer

2012-12-29 06:52:50

Have you tried TPA? I'd go with a two colours TPA finding function that would compare the distance between two TPAs. That would get you rid of false positives I believe.

Pew

2012-12-29 07:10:55

I'm not quite sure what you mean? I can't really get a distinguishable colour.

These are the spots I'm trying to find.


Laimonas171

2012-12-29 07:34:28

From: Pew
I'm not quite sure what you mean? I can't really get a distinguishable colour.

These are the spots I'm trying to find.



first of all set up client for srl


after that ACA tool would help you at this point. search forums.

also i have replied at http://villavu.com/forum/showthread.php?t=94490 so check it out.

Pew

2012-12-29 07:48:14

Well there's nothing to setup as this is a 06 remake and the only graphics options are brightness hahaa.

Thanks a million for the help <3

Laimonas171

2012-12-29 07:56:03

From: Pew
Well there's nothing to setup as this is a 06 remake and the only graphics options are brightness hahaa.

Thanks a million for the help <3


Still, pretty sure here is at-least LOW' settings which reduces stuff (lightening etc.) around the world.

Pew

2012-12-29 07:59:36

From: Laimonas171
Still, pretty sure here is at-least LOW' settings which reduces stuff (lightening etc.) around the world.


ProjectRS06, complete 2006 remake.


litoris

2012-12-29 08:18:20

From: Wardancer
Have you tried TPA? I'd go with a two colours TPA finding function that would compare the distance between two TPAs. That would get you rid of false positives I believe.


My multi-skiller does this, I suggest OP to check out the fishing function. (Was a pain to get the color BTW)

Pew

2012-12-29 08:20:49

From: litoris
My multi-skiller does this, I suggest OP to check out the fishing function. (Was a pain to get the color BTW)


What fishing function?

Dynamite

2012-12-29 08:24:04

From: Pew
What fishing function?


In his multi-skiller?

-Boom

Pew

2012-12-29 08:30:10

From: litoris
My multi-skiller does this, I suggest OP to check out the fishing function. (Was a pain to get the color BTW)


from what I can see you define
Fish1   :=  Point(4518, 3603);  //SPS Coordinates
Fish2 := Point(4531, 3559);

The problem is with this old rs SPS is broken.

-edit
From the examples this looks like it might be promising if anyone else is trying to do the same thing. I think it was what WarDancer was suggesting. I'm gonna get reading.

http://villavu.com/forum/showthread.php?t=42428

litoris

2012-12-29 08:46:23

From: Pew
from what I can see you define
Fish1   :=  Point(4518, 3603);  //SPS Coordinates
Fish2 := Point(4531, 3559);

The problem is with this old rs SPS is broken.


That's the walking part, has nothing to do with click on the fishing spots. I am using a function called AND_TPA to compare colors from two TPAs and pick ones that are close to each other.

Pew

2012-12-29 08:51:51

From: litoris
That's the walking part, has nothing to do with click on the fishing spots. I am using a function called AND_TPA to compare colors from two TPAs and pick ones that are close to each other.


Is that what's in the link I posted above? Will investigate further and post results once I finish this other part.

Thanks for the help everyone.

rj

2012-12-29 10:23:02

From: Pew
I'm not quite sure what you mean? I can't really get a distinguishable colour.

These are the spots I'm trying to find.



The cyan part is extremly unique i tested it with ACA

Rezozo

2012-12-29 10:32:48

What worked for me was to just search for the white outlines (the color) in a specific boxed area.
~Rez

Mr[S]

2012-12-29 10:35:50

From: Pew
ProjectRS06, complete 2006 remake.



Brinbs back memories haha

rj

2012-12-30 12:06:08

Here are some unique colors:


And some code that will click the spot:

program ClickSpot;
{$i srl/srl.simba}

procedure FindFishTPA;
var
tmpCTS, l, r: Integer;
FishSpotTPA: TPointArray;
begin
MouseSpeed := 15;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.12, 0.39);
if FindColorsTolerance(FishSpotTPA, 15647647, 178, 92, 348, 295, 6) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(FishSpotTPA) wait(randomrange(60, 100));
mmouse((FishSpotTPA[r].x), (FishSpotTPA[r].y), 2, 2);
wait(randomrange(100, 150));
clickmouse2(mouse_left);
WriteLn('We found the fishing spot!') wait(randomrange(2000, 2500));
end;
Writeln('We did not find the fishing spot.')
end;

begin
FindFishTPA;
end.

Thehatered

2012-12-30 12:09:07

From: rjj95
Here are some unique colors:


And some code that will click the spot:

program ClickSpot;
{$i srl/srl.simba}

procedure FindFishTPA;
var
tmpCTS, l, r: Integer;
FishSpotTPA: TPointArray;
begin
MouseSpeed := 15;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.12, 0.39);
if FindColorsTolerance(FishSpotTPA, 15647647, 178, 92, 348, 295, 6) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(FishSpotTPA) wait(randomrange(60, 100));
mmouse((FishSpotTPA[r].x), (FishSpotTPA[r].y), 2, 2);
wait(randomrange(100, 150));
clickmouse2(mouse_left);
WriteLn('We found the fishing spot!') wait(randomrange(2000, 2500));
end;
Writeln('We did not find the fishing spot.')
end;

begin
FindFishTPA;
end.


This helped me I was having trouble with this thanks

Wardancer

2012-12-30 14:59:09

The "TPA" function suggested by rjj95 doesn't really make use of TPA. It only searches for the first TP found and ignores the rest of the array. You need to add a loop (I usually use for…to) to go through each TP of the TPA. I'm somewhat busy at the moment (or just feeling lazy and not wanting to edit the function), but I'll post something in a few hours if you don't understand what I mean.

Actually… a few things are wrong with rjj95's function. I'll come back in a bit to explain.

rj

2012-12-30 15:08:51

From: Wardancer
The "TPA" function suggested by rjj95 doesn't really make use of TPA. It only searches for the first TP found and ignores the rest of the array. You need to add a loop (I usually use for…to) to go through each TP of the TPA. I'm somewhat busy at the moment (or just feeling lazy and not wanting to edit the function), but I'll post something in a few hours if you don't understand what I mean.

Actually… a few things are wrong with rjj95's function. I'll come back in a bit to explain.


But it works :D

I'll stick around and heat you out because im pretty sure im doing it wrong anyway

Pew

2012-12-30 22:45:15

Really appreciate the help everyone, if you have time would be awesome if you could expand wardancer.

Wardancer

2012-12-30 23:22:56

I apologize for the delay. I wanted to make sure I'd have enough time to come up with an educational post beneficial to as many people as possible.

First, I'd like to talk a bit about theories and why TPA are so highly regarded. I recall that, not so long ago, TPA were, to me, some kind of mythical creature with an aura of mystery. For this reason, I find it important to stress what TPA stands for: TPointArray or, if you prefer, an array of TPoints. As you might know already, a TPoint is a set of two coordinates (x, y) giving you a point. The usefulness of TPA is that it gives you multiple points on the screen, therefore giving you a chance to find what you're looking for in case you mess up the first time. This is why adding a loop to go through each points is that important. It's also important to add some kind of failsafe to make sure you're getting what you want. On the official runescape server, this can easily be done by using UpText, but it's a bit more complicated for private servers. I leave that part to you though.

Being a lazy person, I'll just paste the basic TPA finding function that I use. Many things can be edited to narrow down the search, but I'd rather keep it simple as this is meant as just one helpful post and not a tutorial.

Here it is:

function FindObject(var x, y : Integer; Obj: MSObject; X1, Y1, X2, Y2:integer) : Boolean;
var
a : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
Box : TBox;
begin
if not LoggedIn then Exit;
tmpCTS := GetColorToleranceSpeed; //Saves your setting not to mess up your whole colour finding for the rest of the script.
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Obj.Hue, Obj.Sat);//Sets the hue and sat of the item.
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Obj.Col, X1, Y1, X2, Y2, Obj.Tol); //Self explaining I hope.
SortTPAFrom(TPA, point(MSCX,MSCY)); //Starts the list of TPA from the center. Aka the TPA[0] will be the one closer to the center. Can be changed based on our needs.
ATPA := TPAtoATPAEx(TPA, 15, 15); //One of many possible function used to reduce the length of the array and have more precision. Read TPA tutorials to learn more about those as they don't all do the same, but that one groups some TPA into ATPA.
for a := 0 to High(ATPA) do //Since I transformed my TPA into an ATPA, I loop through those. If you decide to stick to TPA, the loop would be different. For example, using rjj95's function, it'd be "for a := 0 to high(FishSpotTPA) do"
begin
MP := MiddleTPA(ATPA[a]); //Checks the middle of the TPA.
MMouse(MP.x,MP.y,4,4); //EDIT: Had accidentally removed this line in the editing
if(WaitUpText(Obj.UpText, 400))then //UpText failsafe. Could be changed to anything though to ensure that you got the TP you want.
begin
x := MP.x; y := MP.y; //Just the way the function is built. It gives the var x and y at this point.
Result := True //Hope I don't need to explain.
Break; //You obviously want to get out of the loop once you found what you want. Do not exit though.
end;
end;

ColorToleranceSpeed(tmpCTS); //Goes back to the earlier settings. Try not to skip those lines.
SetColorSpeed2Modifiers(0.2,0.2);
end;

Note: MSObject is a record with a lot of information. If you don't fully understand that part, don't worry. Focus on the actual content of the function.

If anything is unclear, feel free to ask for more information.