SRL Archive - OSR Help

How to fish?


scubajesus

2010-06-19 17:27:59

I was wondering how I mine for fish?

I'm working on a fish and bank script for Monkfish, I believe I have the inventory and banking part down, but I'm totally clueless on how to effectively make it walk to the water, find a spot, and how to select netting.

For finding the spot, that I have absolutely positively no clue how to do. There's a FindFishSpot function in SRL I don't know how to set up. I tried to find how from 3Garrett3's Karamja fisher, but deciphering that is out of my league right now.

And once it finds the spot, how would I have it right click said spot? Something to do with: R_ChooseOption('Net') ?

tl;dr version
How to find fishing spot?
How to right click and net?

masterBB

2010-06-19 18:38:41

I have a very easy fishing script in first script section. Maybe that will help?

[PHP]procedure FindFish;
var
i:Integer;
AllNPCs:array of TNPC;
ClickingPoint:TPoint;
begin
AllNPCs := GetNPCs;
for i := 0 to (length(AllNPCs)-1) do
begin
if(AllNPCs.Name = 'Fishing spot') then
begin
ClickingPoint := TileToMs(AllNPCs.Tile,0);
Mouse(ClickingPoint.x,ClickingPoint.y,10,10,True);
Exit;
end;
end;
end;[/PHP]

Or this one, this will find the closest one:

[PHP]procedure FindFish;
var
i,j,k:Integer;
AllNPCs:array of TNPC;
ClickingPoint:TPoint;
begin
AllNPCs := GetNPCs;
k := 9999;
for i := 0 to (length(AllNPCs)-1) do
begin
if(AllNPCs.Name = 'Fishing spot') then
begin
if(DistanceFrom(AllNPCs.tile) < k) then
begin
k := DistanceFrom(AllNPCs.tile);
j := i;
end;
end;
end;
if( j = 0) then
exit;
ClickingPoint := TileToMs(AllNPCs[j].Tile,0);
Mouse(ClickingPoint.x,ClickingPoint.y,10,10,True);
wait(1500+random(1000));
Writeln(' Found fish! ' + IntToStr(AllNPCs[j].Tile.x) + ' ' + IntToStr(AllNPCs[j].Tile.y));
end; [/PHP]

Also add a "if(tileOnMS(AllNPCs[j].Tile)) then" failsafe.

Tickyy

2010-06-19 20:05:05

From: scubajesus
I was wondering how I mine for fish?

I'm working on a fish and bank script for Monkfish, I believe I have the inventory and banking part down, but I'm totally clueless on how to effectively make it walk to the water, find a spot, and how to select netting.

For finding the spot, that I have absolutely positively no clue how to do. There's a FindFishSpot function in SRL I don't know how to set up. I tried to find how from 3Garrett3's Karamja fisher, but deciphering that is out of my league right now.

And once it finds the spot, how would I have it right click said spot? Something to do with: R_ChooseOption('Net') ?

tl;dr version
How to find fishing spot?
How to right click and net?


Color only or Ref + color?

Sex

2010-06-19 22:45:10

I don't think that you can mine for fish.

Frement

2010-06-19 22:47:14

From: Sex
I don't think that you can mine for fish.


Well you can always try? Maybe jagex has added some rockfish in there?

Sex

2010-06-19 23:03:56

Ah, hadn't thought about that. Perhaps..:p.

Nava2

2010-06-19 23:17:22

To keep things simple, perhaps use FindColor to search for colors and move on from there.

I'm not sure if you are coming from a macroing community such as RSBot where there are APIs for things like that, but in general, you write the scripts and the include is here to aid you in doing so. Taking the really complicated bits out of it for you. We promote the learning of concepts behind logical programming techniqques and try to have our folks develop real-life applicable thought patterns, and skills.

If you want more help, feel free to ask more on this forum or perhaps check out the irc channel irc://irc.rizon.net/#srl or the tutorial island :)

x[Warrior]x3500

2010-06-20 01:37:44

I would use an autocolor based ATPA for finding the fishing spots. and from there, using mouse(…false); would bring up a right click option. then use chooseoption(); to choose the net.

scubajesus

2010-06-20 02:04:24

How I Mine For Fish was a joke a web comic made about noobs in mmo's, had to throw that out since it popped in my head when I asked how to fish.

@Nava2
SRL here is the first community for macroing I've been in. I tried to pick up SCAR back when there was only RSC but I was too young and didn't have the attention span >.>
I picked up RS after a break, and decided I didn't want to alch tens of thousands of times and work two jobs. I read through a bit of the tutorials, and did searches in there, but couldn't find anything about fishing spots. Mostly 5+ guides on DTM, several beginner basic tutorials. I wasn't sure if FindColor would work since the spots are animated, so I came to ask what way to do it.

Thanks for your help everyone. Once I fix up this script, add some anti-bans, and make sure it runs smoothly I'll post it.

masterBB

2010-06-20 09:28:36

Are you going to use reflection or color?

Nava2

2010-06-20 10:09:51

Just so you know, when SCAR/Simba reads from the client. They actually read from a still image of the client. Thus, when you call FindColor, it will actually look for the colour regardless if its moving!

scubajesus

2010-06-20 16:12:00

Thanks Nava, didn't know that.
Reflection script.
I used masterBB's post on find closest NPC, and move to bank and water using tiles near them. I tried modifying the bankNPC function to work for Arnold there, changing name and colors to him, but then the colors would change slightly and I haven't read into how to make it catch and fix that (if it can.) So it finds him through closest NPC too. Deposits through InvMouse(2, 2) and Deposit-All.

Couple anti-bans, and anti-random thrown in. Works pretty good, only flaws I'm having are I don't know how to make it use bank pin, and sometimes it misses it's right click on Arnold (can't blame it for that, jerk won't stand still and even I miss him sometimes.)

Sandstorm

2010-06-27 16:29:09

From: Sex
I don't think that you can mine for fish.


I hear, however, that mining yews is quite popular, or was, anyway.

Back in the days of level 3 nub defaults.

~The Otter

Sir R. M8gic1an

2010-06-27 21:05:55

Please people, let's stop the spam.

Scuba:
// * function InPin(Pin: string): Boolean;
combined with Players[CurrentPlayer].Pin is the answer you need for inserting the pin ;) It's within the SRL include already.

http://villavu.com/repositories/srl-opendev/SRL/core/Bank.scar
Is where you can find it, and to find examples on how to use it, you can read through the banking functions that are in there as well ;)

~RM