Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Amberleaf

[OSRS07] Catherby net fisher

Recommended Posts

[OSRS07] Catherby net fisher v0.4

 

Uses a 'small fishing net' & a 'big fishing net' to power-fish at the Catherby fishing spots.

 

Nets should be in these 2 slots in any order.

 

Catherbyfishersetup2nets.jpg

 

Requirements

 

  • Public chat must be switched off.
  • You'll need a 'small fishing net' & a 'big fishing net' in your bag as shown above.
  • Level 16 fishing.
  • Most recent version of Scar-divi.
  • OSI Include File>>Includes manager>> download or update.
  • MSSL Include File>>Includes manager>> download or update.

 

Start near any of the fishing spots.

 

Enjoy!

 

OSRS07 - Catherby net fisher v0.4

 

older versions below

 

OSRS07 - Catherby net fisher v0.3

 

OSRS07 - Catherby net fisher v0.2

Edited by Amberleaf

Share this post


Link to post
Share on other sites

Here's some pointers I think you may find useful

 

I see you have MSSL included yet you only use 1 MSSL function: RS07_IsUpText. OSI's equivalent to this is UpTextContains. There's really no reason to add an entire library for the use of one function. You could just use OSI's function or paste what you need if you really need it. After all, 1 function for a 'massive' library is a bit much, all though this is an unnecessary change you might like your script compiling 5x as fast.

 

The next thing I noticed was your coding standards. All bolded words are lower case. You seemed to follow this pretty well except for with If.. which is also a bold word and show be all lowercase. Your indentations are backwards. You are supposed to indent two spaces to the right after words such as begin, repeat, then, else, const and two the opposite direction after until, end... and in no other places (like you are indenting after Mouse and WaitRR... ????? no one has ever done this O_O) Another thing to be aware of is semicolons I see you did end else; which it should be end else on two seperate lines with no semi colons.

 

Then I noticed you had function RCDrop. It has no Result returned so it really only needs to be a procedure. Also I'm not sure what your MMouse/Mouse does (as that would just be one thing all together... Mouse does both) I assume it's just for changing to the inventory tab for which you could of just use Game-Tab.scar's SetGameTab(Tab_Inv). I like the use of DropAllExclude.

 

In your GetFishing procedure you use FindColorsSpiralTol with some hardcoded search bounds. I'll assume what you're looking for is on the main screen MSX1..MSX2 etc. you could of just used those or Color.scar's wrapper FindColorsSpiralTolP (ok maybe I don't have this one done yet..) and used MSB: TBox;.

 

I see you have antirandoms enabled but you never call OSIFindRandoms.

 

It seems to be a pretty simple script etc. hopefully I'll have LevelUp done soon in OSI so you won't need that custom FindColor any more.

 

I see a lot of potential in your coding skills but you need to hone in mistakes in your current skills so your code works better and is easier to read and then develop new skill sets that will make your coding a lot easier to perform complex tasks and more stable/durable/human like and overall clean. Such as TPA finding with CTS2 and overall script structure. It also looks like you should add login capability to this script.

 

If you need any examples there's also OSI's include itself to look through or you can look as some of the old OSI1 scripts https://github.com/OSI1 and see how they were done.

 

Nice job with this script though

 

Never stop improving :)

 

Cheers

Share this post


Link to post
Share on other sites
Here's some pointers I think you may find useful

 

I see you have MSSL included yet you only use 1 MSSL function: RS07_IsUpText. OSI's equivalent to this is UpTextContains. There's really no reason to add an entire library for the use of one function. You could just use OSI's function or paste what you need if you really need it. After all, 1 function for a 'massive' library is a bit much, all though this is an unnecessary change you might like your script compiling 5x as fast.

 

The next thing I noticed was your coding standards. All bolded words are lower case. You seemed to follow this pretty well except for with If.. which is also a bold word and show be all lowercase. Your indentations are backwards. You are supposed to indent two spaces to the right after words such as begin, repeat, then, else, const and two the opposite direction after until, end... and in no other places (like you are indenting after Mouse and WaitRR... ????? no one has ever done this O_O) Another thing to be aware of is semicolons I see you did end else; which it should be end else on two seperate lines with no semi colons.

 

Then I noticed you had function RCDrop. It has no Result returned so it really only needs to be a procedure. Also I'm not sure what your MMouse/Mouse does (as that would just be one thing all together... Mouse does both) I assume it's just for changing to the inventory tab for which you could of just use Game-Tab.scar's SetGameTab(Tab_Inv). I like the use of DropAllExclude.

 

In your GetFishing procedure you use FindColorsSpiralTol with some hardcoded search bounds. I'll assume what you're looking for is on the main screen MSX1..MSX2 etc. you could of just used those or Color.scar's wrapper FindColorsSpiralTolP (ok maybe I don't have this one done yet..) and used MSB: TBox;.

 

I see you have antirandoms enabled but you never call OSIFindRandoms.

 

It seems to be a pretty simple script etc. hopefully I'll have LevelUp done soon in OSI so you won't need that custom FindColor any more.

 

I see a lot of potential in your coding skills but you need to hone in mistakes in your current skills so your code works better and is easier to read and then develop new skill sets that will make your coding a lot easier to perform complex tasks and more stable/durable/human like and overall clean. Such as TPA finding with CTS2 and overall script structure. It also looks like you should add login capability to this script.

 

If you need any examples there's also OSI's include itself to look through or you can look as some of the old OSI1 scripts https://github.com/OSI1 and see how they were done.

 

Nice job with this script though

 

Never stop improving :)

 

Cheers

You made some really good points up there, but I must say, I wouldn't recommend using UpTextContains (not from either one, OSI or MSSL) for any important checking purposes - so I disagree with you.. You know why?

It's just not too reliable, because it's based on rs_GetTextAt. It would be great if rs_GetTextAt would return ALWAYS correctly, but it doesn't, due to the way uptext behaves.

So, I recommend using IsTextAtEx based detection instead (for all cases where you can use it).

 

Pros/Cons compared to UpTextContains:

+Highly reliable (100%)

+Very fast (at average this is about 10 times faster than the methods based on rs_GetTextAt)

-Case-sensitive

-The text MUST at least start with that you use for it (so you can't do middle searching, like with UpTextContains)

 

James, if you want to add the same methods as I have wrote to MSSL, to OSI, then here you go (converted them to OSI standards):

 

{==============================================================================]   
 Explanation: Returns true if uptext equals OR starts with any of the texts. CASE-SENSITIVE!             
[==============================================================================}
function IsUpTextMulti(texts: TStrArray): Boolean;
var
 u: TIntArray;
 t, l, h, i, CTS: Integer;
 b: TSCARBitmap;
 c: TSCARClient;   
begin
 l := Length(texts);
 if ((l > 0) and LoggedIn) then
 begin
   b := GetClient.CaptureEx(8, 7, 514, 22);
   CTS := GetColorToleranceSpeed;    
   ColorToleranceSpeed(0);      
   u := [4231423, 16776960, 16777215, 255, 12543, 28927, 45311, 65535, 65472, 65408, 65344, 65280];
   h := High(u);
   try 
     for i := 0 to h do
       ReplaceColorTol(b, u[i], u[i], 80);
     c := SetClient(TSCARBitmapClient.Create(b)); 
     try       
       for t := 0 to (l - 1) do  
       begin                                                      
         Result := IsTextAtEx(0, 0, texts[t], 0, ScreenChars, False, False, 0, 2, -1); 
         if Result then
           Break;
       end;  
     except
     finally
       SetClient(c).Free;
     end; 
   except  
   finally
     b.Free;      
   end;  
   ColorToleranceSpeed(CTS);
 end;          
end; 

{==============================================================================]   
 Explanation: Returns true if uptext equals OR starts with text. CASE-SENSITIVE!             
[==============================================================================}
function IsUpText(text: string): Boolean;
begin
 Result := IsUpTextMulti([text]);
end;

 

So yeah, UpTextContains is "O.K." if you need to search for stuff in the middle of the text, but otherwise I recommend you'll ALWAYS use IsUpText instead. Seriously.

I noticed speed problems (mostly because of incorrect results from rs_GetTextAt) in Project RS06, so I wrote that method for much more accurate text checking.

Sometimes scripts got stuck aswell, simply because rs_GetTextAt just wouldn't return the text correctly (failsafes did help but things did get slower)!

 

-Jani

Edited by Janilabo

Share this post


Link to post
Share on other sites
You made some really good points up there, but I must say, I wouldn't recommend using UpTextContains (not from either one, OSI or MSSL) for any important checking purposes - so I disagree with you.. You know why?

It's just not too reliable, because it's based on rs_GetTextAt. It would be great if rs_GetTextAt would return ALWAYS correctly, but it doesn't, due to the way uptext behaves.

So, I recommend using IsTextAtEx based detection instead (for all cases where you can use it).

 

Pros/Cons compared to UpTextContains:

+Highly reliable (100%)

+Very fast (at average this is about 10 times faster than the methods based on rs_GetTextAt)

-Case-sensitive

-The text MUST at least start with that you use for it (so you can't do middle searching, like with UpTextContains)

 

James, if you want to add the same methods as I have wrote to MSSL, to OSI, then here you go (converted them to OSI standards):

 

{==============================================================================]   
 Explanation: Returns true if uptext equals OR starts with any of the texts. CASE-SENSITIVE!             
[==============================================================================}
function IsUpTextMulti(texts: TStrArray): Boolean;
var
 u: TIntArray;
 t, l, h, i, CTS: Integer;
 b: TSCARBitmap;
 c: TSCARClient;   
begin
 l := Length(texts);
 if ((l > 0) and LoggedIn) then
 begin
   b := GetClient.CaptureEx(8, 7, 514, 22);
   CTS := GetColorToleranceSpeed;    
   ColorToleranceSpeed(0);      
   u := [4231423, 16776960, 16777215, 255, 12543, 28927, 45311, 65535, 65472, 65408, 65344, 65280];
   h := High(u);
   try 
     for i := 0 to h do
       ReplaceColorTol(b, u[i], u[i], 80);
     c := SetClient(TSCARBitmapClient.Create(b)); 
     try       
       for t := 0 to (l - 1) do  
       begin                                                      
         Result := IsTextAtEx(0, 0, texts[t], 0, ScreenChars, False, False, 0, 2, -1); 
         if Result then
           Break;
       end;  
     except
     finally
       SetClient(c).Free;
     end; 
   except  
   finally
     b.Free;      
   end;  
   ColorToleranceSpeed(CTS);
 end;          
end; 

{==============================================================================]   
 Explanation: Returns true if uptext equals OR starts with text. CASE-SENSITIVE!             
[==============================================================================}
function IsUpText(text: string): Boolean;
begin
 Result := IsUpTextMulti([text]);
end;

 

So yeah, UpTextContains is "O.K." if you need to search for stuff in the middle of the text, but otherwise I recommend you'll ALWAYS use IsUpText instead. Seriously.

I noticed speed problems (mostly because of incorrect results from rs_GetTextAt) in Project RS06, so I wrote that method for much more accurate text checking.

Sometimes scripts got stuck aswell, simply because rs_GetTextAt just wouldn't return the text correctly (failsafes did help but things did get slower)!

 

-Jani

I have to do some research before replying to your post fully Janilabo. I am aware of the functionality differences. I will say for now I have not yet experienced any performance or accuracy issues with rs_GetUpText in either RS07 and RS2.

Edited by Wanted

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...