Results 1 to 24 of 24

Thread: Fishing

  1. #1
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Fishing

    Anyone got suggestions for an isfishing function

    We need to check if the player is still fishing...
    this is for karamja docks, fishing with lobster pot or harpoon...

    suggestions so far... (from me and jimmy mac)

    - Check for the spot being where it was before...with a backup invo checker, to see if any fish after a while...

    - check for the colour of the harpoon or cage in a small box around the player...

    Sugestions from you

    - none so far

    Also is the "findfishingspot" in fishing.scar working, if so, what do i need to do to get it working...

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I posted one on a thread for you that works flawlessly, you don't need to use it but the concept behind it is what your looking for.
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    right, I decided to try out the second idea...and boy did it work...at least it did for me...can I get anyone willing to check this out...and see if when they are fishing, it tells them they are.. and if not tells them they arent'...

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/Skill/fishing.scar}

    function isfishing:boolean;
    var i, colorc:integer;
    begin
      result:=false
      for i:=0 to 18 do
      begin
        wait(333)
        colorc := colorc + CountColorTolerance(800338, MSCX-15, MSCY-15, MSCX+15, MSCY+15, 5)
      end;
      if(colorc > 35) then;
        result:=true;
    end;

    begin
    if isfishing then
      writeln('fishing')
      else
      writeln('not fishing');
    end.

    Test it out when you are fishing, and when you aren't and make sure you get results, don't come back saying "oh it said I wasn't fishing when I was!"

    give me results of all the tests, how many times you tried when fishing, and how many succeded and failed, and same for when you weren't fishing...

    EDIT: it takes 6 seconds to run, after it compiles....so don't be impatient...also....this seems like a good length to call an antiban after? ie run the test for isfishing, then if it returns true then run anti ban kinda like

    while isfishing do;
    antiban;

    should I add a function for if it returns <5 or 10 (lowest value on my tests when not fishing was 21) to check for randoms? or should i just call that when I do the antiban? but when it returns less than 35, it will look for a fishing spot, fail and we have issues, i recon a <10 or so check for antiban....
    Last edited by Bad Boy JH; 01-23-2010 at 08:02 AM.

  4. #4
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    I ran it with just the SCAR screen showing and it said I was fishing...
    ^pic http://i45.tinypic.com/6fb8jo.png

    I then added a loop and it still said I was fishing...
    ^ pic http://i45.tinypic.com/2l8e04j.png

    Hope this helps.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  5. #5
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmmm try this...tell me what it says...


    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/Skill/fishing.scar}

    function isfishing:boolean;
    var i, colorc:integer;
    begin
      result:=false
      for i:=0 to 18 do
      begin
        wait(333)
        colorc := colorc + CountColorTolerance(800338, MSCX-15, MSCY-15, MSCX+15, MSCY+15, 5)
      end;
      if(colorc > 35) then
        result:=true;
      writeln(inttostr(colorc))
    end;

    begin
    if isfishing then
      writeln('fishing')
      else
      writeln('not fishing');
    end.

    It should tell me if its for some reason ignoring the
    If color > 35 then;
    line and still doing setting result as true...which would be irritating as ****!

    Edit, I removed the colorcounttolerance section, and set the colorc to 20, it returned true...fixes anyone?

    Edit two, taking away semi-colon after "then" in the colorc > 35 line
    Last edited by Bad Boy JH; 01-23-2010 at 09:18 AM.

  6. #6
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    This is what I use for my ProIvy, but should work same for you


    SCAR Code:
    function GetAnimation: Integer;
    var
      I : Integer;
    begin
      I := SmartGetFieldObject(0, 'at.N');
      Result := SmartGetFieldInt(I, 'W');
      SmartFreeObject(I);
    end;

    SCAR Code:
    Function IsFishing : boolean;
    var
    GetAnimationTime : integer;
    begin
      Writeln('IsFishing');
      Result := true;
    repeat
       AntiRandoms;
       Antiban;
      until (GetAnimation > 0);
      repeat
       if not (GetAnimation > 0) then
         begin
         Wait(200 + Random(400));
         Inc(GetAnimationTime);
         end;
         until (GetAnimationTime > 10)
         begin
          if ClickContinue(false, false) then
          Inc(Stats_CustomVars[5]);  //SRL STATS
          FindNewFishingpot;
         end;
    end;

  7. #7
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    just figured out its week point, If the spot to the east (which is off the dock) is selected by findfishspot, then unfortunatly... the countcolortolerance result is lower, as it picks up the dock, whist on it...to enough of a degree, that when fishing that spot there is MUCH lower result... to fix this, I rotated the camera 180, so its the last spot, if i understand how it worked (considering it chose that spot repeatedly, i assume that it checked left to right, now that spot is on the right, and not getting picked....)

    also this *should* (not tested yet) allow me to set the value (35 in above code) higher, as now we don't have to worry about a rear facing player giving lower counts...

  8. #8
    Join Date
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you dont need to rotate. you can just use FindFishSpotTPA, the use this:
    SCAR Code:
    function RemoveDistTPointArray(x, y, dist: Integer; ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray;
    Description:
         Removes the points that are inside or outside the distance Dist
         from the point (x, y) from the TPointArray ThePoints.

    or use the code I gave you as it works (below), which would allow you to fish at the spot on the beach. rotating is detectable if u do it every time u go to the dock.

    SCAR Code:
    procedure CountCageColors; //Ths procedure takes 6 seconds.
    var
      i : Integer;
      CageCount : TIntegerArray;
    begin
      SetArrayLength(CageCount, 18);
      for i := 0 to 17 do
      begin
        CageCount[i] := CountColorTolerance(1000036, MSCX - 20, MSCY - 20, MSCX + 20, MSCY + 20, 10);
        if CageCount[i] >= 5 then
        begin
          Writeln('Still Fishing');
          exit;
        end;
        wait(300);
      end;
      Writeln('Not Fishing');
    end;
    Last edited by jimmy_mac; 01-24-2010 at 01:07 AM.

  9. #9
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    IsMoving. Or Tbox + PixelShift.

  10. #10
    Join Date
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    IsMoving doesn't seem to pick up when you are cage fishing (just tested).

  11. #11
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Jimmy, are you able to make the movement with the player facing south instead of north, it *should* only be a matter of adding/subtracting 180 from all the directions of radial walks and such...

    That way we won't have the detectibility of turning the camera around every time...

  12. #12
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Function FindFishingSpot:boolean;
    var
      x, y, i:integer;
      TPA:TPointArray;
    begin
      result:=false;
      if not(FindfishspotsTPA(TPA)) then
        exit;
      SortTPAFrom(TPA, Point(MSCX, MSCY));
      for i:=0 to high(TPA) do
      begin
        MMouse(TPA[i].x, TPA[i].y, 5, 5)
        if isuptext('age') then
        begin
          getmousepos(x, y)
          if players[currentplayer].strings[1]=lowercase('lobster') then
          Mouse(x, y, 0, 0, true) else
          begin
            Mouse(x, y, 0, 0, false)
            ChooseOption('harpoon')
          end;
        result:=true
        exit;
        end;
      end;
    end;
    anyone find a problem in that code

    btw [currentplayer].strings[1] is the type of fish they are fishing, only lobster, swordfish or tuna...

  13. #13
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    It will return True not matter what...Try this:
    SCAR Code:
    Function FindFishingSpot:boolean;
    var
      x, y, i : Integer;
      TPA : TPointArray;
    begin
      if(not(FindfishspotsTPA(TPA)))then Exit;
      SortTPAFrom(TPA, Point(MSCX, MSCY));
      for i := 0 to high(TPA) do
      begin
        MMouse(TPA[i].x, TPA[i].y, 5, 5);
        if isuptext('age') then
        begin
          getmousepos(x, y);
          if(Players[CurrentPlayer].Strings[1] = Lowercase('lobster'))then
            Mouse(x, y, 0, 0, True);
            Result := // Check the last line in the chat box to see if it says your player is fishing
            Exit
          else
          begin
            Mouse(x, y, 0, 0, False);
            Result := ChooseOption('harpoon');
            Exit;
          end;
        end;
      end;
    end;

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  14. #14
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oops someone forgot a begin and end....XD

  15. #15
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Haha, yeah xD oh well lol.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  16. #16
    Join Date
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Camo Developer View Post
    It will return True not matter what...
    Dissagree. check out the line near the top
    SCAR Code:
    Result:=False;
    if not FindFishSpotsTPA(TPA) then
    exit;
    That would work fine.

  17. #17
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Updated Fishing.scar so that now the TPA you receive from FindFishingSpotsTPA will be sorted from closest to (MMCX, MMCY) as had been intend in the first place.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  18. #18
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    that is excellent, does this mean that FindFishSpot, will find the closest spots first?

  19. #19
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Bad Boy JH View Post
    that is excellent, does this mean that FindFishSpot, will find the closest spots first?
    Yeah. Now that it starts search from the middle of the mainscreen.

  20. #20
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great, so AFTER I Fix, a fairly major issue in our script (I think its mine now, haven't seen Jimmy...), you decide to make the overall SRL function do exactly what I was Spending my time trying to get it to do....bugger...well at least it taught me enough to help me make that findcoins function work...lol....*sigh* effort for nothing...at least the function is fixed now...

  21. #21
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Smarter Child View Post
    Yeah. Now that it starts search from the middle of the mainscreen.
    Not really, What it does is sort the ATPA from the center, which then gets transformed into a TPA which is the result.

    Quote Originally Posted by Bad Boy JH View Post
    Great, so AFTER I Fix, a fairly major issue in our script (I think its mine now, haven't seen Jimmy...), you decide to make the overall SRL function do exactly what I was Spending my time trying to get it to do....bugger...well at least it taught me enough to help me make that findcoins function work...lol....*sigh* effort for nothing...at least the function is fixed now...
    Heh sorry, this thread made me notice there was a fault in the function..

    ~RM
    Last edited by Sir R. M8gic1an; 01-28-2010 at 09:07 AM.

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  22. #22
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You misunderstand me, I wasn't complaining seriously, though I figure that I may not be known well enough for my smart arse attitude here yet, where I can tend to complain about anything, just as a joke, If i was pissed of, I would be giving you about 5 and 3 quarter ears full (ear fulls? hmm what is the plural here) I figure, if it improves SRL, I am fine with it... The last word usually communicates what I mean, "at least the function is fixed now" hint of irritation, but Still happy its fixed...

  23. #23
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Bad Boy JH View Post
    You misunderstand me, I wasn't complaining seriously, though I figure that I may not be known well enough for my smart arse attitude here yet, where I can tend to complain about anything, just as a joke, If i was pissed of, I would be giving you about 5 and 3 quarter ears full (ear fulls? hmm what is the plural here) I figure, if it improves SRL, I am fine with it... The last word usually communicates what I mean, "at least the function is fixed now" hint of irritation, but Still happy its fixed...
    I never took it as a complaint, I am jsut genuinely sorry that you had to go through all that work when it should've been me doing it in the first place as I was the original function writer

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  24. #24
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well..alls well that ends well...Still learnt alot of knowlage, that I have put to use...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •