Results 1 to 9 of 9

Thread: Fishing help?

  1. #1
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default Fishing help?

    Hey, I have made a very basic barbarian fishing script for Otto's Grotto, and it is working fine so far except that when a spot disappears it does not detect this and find a next one, and I can't seem to fix it.
    Here's the relevant part of the script

    Simba Code:
    Procedure Spotfinding;
    Begin
      If Not loggedin Then
      Exit;
      If (not (FindColorSpiralTolerance(x, y, SpotColor, MSX1, MSY1, MSX2, MSY2, 5))) Then
      begin
        Wait(100+random(70));
        Tried:= Tries + 1;
      end;
      if(Tries = 15)Then
      Begin
      Logout;
      Exit;
      End else
      Begin
      if FindObjCustom(x, y, ['Use', 'rod'], [SpotColor], 5)Then
      MMouse(x, y, 5, 5);
      end;
         if IsUpText('Use') then
       begin
          Mouse(x, y, 0, 0, true);
       end;
    end;


    Procedure Fishing;
    begin
    repeat
      MarkTime(Fishcounter);
      If InvCount=+1 Then
      MarkTime(FishCounter);
      Antiban;
      Wait(1000);
    until(TimeFromMark(FishCounter)>7000) or (InvFull)
    end;

    Also, I am a completely new scripter, never attempted it in any format before, so have pity
    Last edited by stu; 04-15-2012 at 04:20 PM.

  2. #2
    Join Date
    Nov 2011
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would go with either DTM to find the spot or TPA. Check out the tut for some awesome tut on DTMS.

    Good luck with the script!

  3. #3
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    It's not that I can't find the water, I just dont know what's wrong with my script that it won't look for a new spot when one disappears in the middle of an inventory

  4. #4
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Your Fishing procedure is in an infinite loop. It is repeating the MarkTime(FishCounter); every second, so it will never get out. If you want to fix it, take the MarkTime(Fishcounter); out of the repeat statement(the one on top of the if...then statement. Then it should work. Just mark the timer before you enter the loop.

  5. #5
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    like this?
    Procedure Fishing;
    begin
    MarkTime(Fishcounter);
    repeat
    If InvCount=+1 Then
    MarkTime(FishCounter);
    Antiban;
    Wait(1000);
    until(TimeFromMark(FishCounter)>7000) or (InvFull)
    end;
    that just makes it drop fish every 7 seconds?
    (sorry dont really know what im doing, this is all new to me)

  6. #6
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Yes that's right. If that is the procedure you call after you click on the fishing spot, it will mark the time, if you gain a fish it will reset the timer. If you don't get any fish in 7 seconds or your inventory is full, it will exit the procedure.

  7. #7
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    thats what i thought, but testing it just made it drop my fish and click a new spot every 7 seconds no matter what

  8. #8
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Oh, you need to set a variable to your invcount.

    Simba Code:
    Procedure Fishing;
    var
      CurrentInv : Integer;
    begin
      CurrentInv := InvCount;
      MarkTime(Fishcounter);
      repeat
        If CurrentInv <> InvCount Then
        begin
          CurrentInv := InvCount;
          MarkTime(FishCounter);
        end;
        Antiban;
        Wait(1000);
      until(TimeFromMark(FishCounter)>7000) or (InvFull)
    end

    Try that. I don't know if that =+1 works in pascal, even if it did it would be +=1 I think.

  9. #9
    Join Date
    Dec 2011
    Posts
    134
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    haha thank you, genius

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
  •