Results 1 to 7 of 7

Thread: [AL] F2P PowerFisher

  1. #1
    Join Date
    Mar 2018
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Post [AL] F2P PowerFisher

    This is my first script here. It's quite simple and doesn't have good antiban features.
    I got lvl 75 fishing with it before getting banned.

    I welcome any feedback and constructive criticism. Also any suggestions are welcome.
    Also feel free to ask for help if can't get the script working for any reason.

    Possible future plans:
    • Adding antiban features.
    • Adding drop for fish only so it doesn't drop fishing tool and other items if they are not in first inventory space.
    • Adding break timer.
    • Adding xp and fish counter.
    • Automatic check for:
      • Fishing tool in first inventory space.
    • Automatic check and select for:
      • Enable shift clicking.
      • Have brightness set to max.



    Requirements:


    How to use:
    Run the script near fishing spot with fishing tool in your first slot.

    Code:
    program new;
    {$define SMART} //If not using SMART, then comment this line out
    {$i AeroLib/AeroLib.Simba}
    
    const //Script config.
      P_USERNAME = '';
      P_PASSWORD = '';
      Fish_Tool_To_Fish_With := 'Net';  // Net, Bait, Lure, BaitRod, Harpoon, Cage
    
      PersonalRandomModifier := random(1,1000);
      dropRandom := random(50,350);
    var
      AFKCounter             : Integer;
      playerIsFishing        : Boolean;
      fishingSpotIsTop       : Boolean;
      fishingSpotIsRight     : Boolean;
      fishingSpotIsBottom    : Boolean;
      fishingSpotIsLeft      : Boolean;
    
      splitNumbers          : TIntegerArray;
      dropAmount            : TIntegerArray;
      dropStart             : TIntegerArray;
      numberOfSplits        : Integer;
      completedRandomLoop   : boolean;
    
    procedure declarePlayer();
    begin
      Me.Name := P_USERNAME;
      Me.Pass := P_PASSWORD;
      Me.Active := True;
      Me.Member := False;
    end;
    
    procedure setupPlayer();
    begin
      writeln('player setup...');
      if (not isLoggedIn()) then
        loginPlayer(false);
      if (isLoggedIn()) then
      begin
        clickNorth(True);
        setAngle(ANGLE_HIGH);
      end;
    end;
    
    procedure checkIfIsFishing();
    var
      netSearchAreaTop      : TBox;
      netSearchAreaRight    : TBox;
      netSearchAreaBottom   : TBox;
      netSearchAreaLeft     : TBox;
    
      baitSearchAreaTop      : TBox;
      baitSearchAreaRight    : TBox;
      baitSearchAreaBottom   : TBox;
      baitSearchAreaLeft     : TBox;
    
      harpoonSearchAreaTop     : TBox;
      harpoonSearchAreaRight   : TBox;
      harpoonSearchAreaBottom  : TBox;
      harpoonSearchAreaLeft    : TBox;
    
      cageSearchAreaTop     : TBox;
      cageSearchAreaRight   : TBox;
      cageSearchAreaBottom  : TBox;
      cageSearchAreaLeft    : TBox;
    
      color_Net              : TColEx;
      color_Bait             : TColEx;
      color_Cage             : TColEx;
      color_Harpoon          : TColEx;
    
      color_FishingTool : TColEx;
      fishingToolSearchAreaTop : TBox;
      fishingToolSearchAreaRight : TBox;
      fishingToolSearchAreaBottom : TBox;
      fishingToolSearchAreaLeft : TBox;
      fishingToolSearchArea : TBox;
      fishingSpotLocation : Boolean;
      i : Integer;
    
      T                     : Timer;
    begin
      netSearchAreaTop := [254,144,274,157];
      netSearchAreaRight := [273,169,298,191];
      netSearchAreaBottom := [256,178,273,216];
      netSearchAreaLeft := [214,171,237,191];
    
      baitSearchAreaTop := [262,101,273,149];
      baitSearchAreaRight := [273,165,331,183];
      baitSearchAreaBottom := [248,186,256,237];
      baitSearchAreaLeft := [184,157,238,178];
    
      harpoonSearchAreaTop := [258,139,268,166];
      harpoonSearchAreaRight := [253,158,294,187];
      harpoonSearchAreaBottom := [253,156,264,215];
      harpoonSearchAreaLeft := [227,140,268,167];
    
      cageSearchAreaTop := [247,142,262,152];
      cageSearchAreaRight := [282,166,295,182];
      cageSearchAreaBottom := [257,229,272,246];
      cageSearchAreaLeft := [219,168,234,182];
    
      color_Net.create(2765113, 15, 0.34, 0.50);
      color_Bait.create(6694, 15, 0.34, 0.50);
      color_Harpoon.create(1140619, 15, 0.34, 0.50);
      color_Cage.create(872564, 15, 0.34, 0.50);
    
      Case Fish_Tool_To_Fish_With of
        'Net': begin
                color_FishingTool    := color_Net;
                fishingToolSearchAreaTop := netSearchAreaTop;
                fishingToolSearchAreaRight := netSearchAreaRight;
                fishingToolSearchAreaBottom := netSearchAreaBottom;
                fishingToolSearchAreaLeft := netSearchAreaLeft;
               end;
        'Bait', 'Lure', 'BaitRod': begin
                color_FishingTool    := color_Bait;
                fishingToolSearchAreaTop := baitSearchAreaTop;
                fishingToolSearchAreaRight := baitSearchAreaRight;
                fishingToolSearchAreaBottom := baitSearchAreaBottom;
                fishingToolSearchAreaLeft := baitSearchAreaLeft;
               end;
        'Cage': begin
                color_FishingTool    := color_Cage;
                fishingToolSearchAreaTop := cageSearchAreaTop;
                fishingToolSearchAreaRight := cageSearchAreaRight;
                fishingToolSearchAreaBottom := cageSearchAreaBottom;
                fishingToolSearchAreaLeft := cageSearchAreaLeft;
               end;
        'Harpoon': begin
                color_FishingTool    := color_Harpoon;
                fishingToolSearchAreaTop := harpoonSearchAreaTop;
                fishingToolSearchAreaRight := harpoonSearchAreaRight;
                fishingToolSearchAreaBottom := harpoonSearchAreaBottom;
                fishingToolSearchAreaLeft := harpoonSearchAreaLeft;
               end;
      end;
    
      playerIsFishing := False;
      fishingSpotLocation := False;
      T.start();
    
      while ((playerIsFishing = True) OR (T.timeElapsed() <= 5000)) do
      begin
    
        for i := 1 to 4 do
        begin
        if (playerIsFishing = True) then
        begin
          break;
        end;
    
          Case i of
          1 : begin
                fishingSpotLocation := fishingSpotIsTop;
                fishingToolSearchArea := fishingToolSearchAreaTop;
              end;
          2 : begin
                fishingSpotLocation := fishingSpotIsRight;
                fishingToolSearchArea := fishingToolSearchAreaRight;
              end;
          3 : begin
                fishingSpotLocation := fishingSpotIsBottom;
                fishingToolSearchArea := fishingToolSearchAreaBottom;
              end;
          4 : begin
                fishingSpotLocation := fishingSpotIsLeft;
                fishingToolSearchArea := fishingToolSearchAreaLeft;
              end;
          end;
    
          if (fishingSpotLocation = True) then
          begin
            if color_FishingTool.findIn(fishingToolSearchArea) then
            begin
              playerIsFishing := TRUE;
              writeln('playerIsFishing = ' + toStr(playerIsFishing));
              exit;
            end;
          end;
    
        end;
    
      end else
      begin
        playerIsFishing := FALSE;
      end;
    
      writeln('playerIsFishing = ' + toStr(playerIsFishing));
    end;
    
    procedure fish();
    var
      Pnt : TPoint;
      Pnts : TPointArray;
      TestPnts : TPointArray;
    
      fishingSpotSearchAreaTop    : TBox;
      fishingSpotSearchAreaRight  : TBox;
      fishingSpotSearchAreaBottom : TBox;
      fishingSpotSearchAreaLeft   : TBox;
    
      obj_FishingSpot             : TMSObject;
      color_FishingSpot           : TColEx;
    
      textToCheckFor              : String;
      textToCheckForTwo           : String;
      mouseRightNeeded            : Boolean;
      clickedOnFishingSpot        : Boolean;
      i                           : Integer;
      T                           : Timer;
    
    begin
    
      obj_FishingSpot.create('Fishing Spot', [''], [createCol(14336937, 13, 0.27, 2.10)], [createCol(14996397, 20, 0.23, 1.15)], 10, 25, 25, 15);
    
    
      Case Fish_Tool_To_Fish_With of
        'Net': begin
                textToCheckFor    := 'Net Fishing spot';
                mouseRightNeeded  := False;
               end;
        'Bait': begin
                textToCheckFor    := 'Net Fishing spot';
                mouseRightNeeded  := True;
                textToCheckForTwo := 'Bait Fishing spot';
               end;
        'Lure': begin
                textToCheckFor    := 'Lure Rod Fishing spot';
                mouseRightNeeded  := False;
               end;
        'BaitRod': begin
                textToCheckFor    := 'Lure Rod Fishing spot';
                mouseRightNeeded  := True;
                textToCheckForTwo := 'Bait Rod Fishing spot';
               end;
        'Cage': begin
                textToCheckFor    := 'Cage Fishing spot';
                mouseRightNeeded  := False;
               end;
        'Harpoon': begin
                textToCheckFor    := 'Cage Fishing spot';
                mouseRightNeeded  := True;
                textToCheckForTwo := 'Harpoon Fishing spot';
               end;
      end;
    
      //Finding fishing spot
      while (NOT clickedOnFishingSpot = True) do
      begin
        if obj_FishingSpot.findall(10, MSCP, Pnts) then
        begin
          for i := low(Pnts) to high(Pnts) do
          begin
            if (NOT clickedOnFishingSpot = True) then
            begin
              HumanMMouse(Pnts[i], 5, 5);
              if IsUpTextMulti([textToCheckFor]) then
              begin
                if (mouseRightNeeded = False) then
                begin
                  fastClick(MOUSE_LEFT);
                  clickedOnFishingSpot := True;
                end;
                if (mouseRightNeeded = True) then
                begin
                  fastClick(MOUSE_RIGHT);
                  if WaitOption(textToCheckForTwo, 1000) then
                  begin
                    ChooseOption(textToCheckForTwo);
                    clickedOnFishingSpot := True;
                  end;
                end;
              end;
            end;
          end;
        end;
      end;
    
      AFKCounter := 0;
    
      wait(random(1000,2000));
      While isPlayerWalking() do
      begin
        wait(random(500,1200));
      end;
    
    
      // Check fishing spots locations.
      color_FishingSpot.create(14336937,13,0.27,2.10);
    
      fishingSpotSearchAreaTop := [253,139,278,157];
      fishingSpotSearchAreaRight := [286,169,307,189];
      fishingSpotSearchAreaBottom := [247,203,273,227];
      fishingSpotSearchAreaLeft := [208,171,233,195];
    
      fishingSpotIsTop    := False;
      fishingSpotIsRight  := False;
      fishingSpotIsBottom := False;
      fishingSpotIsLeft   := False;
    
      T.start();
      while (T.timeElapsed() <= 5000) do
      begin
        //Top
        if ((fishingSpotIsTop = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaTop)) then
        begin
          writeln('Found fishing spot in area: Top.');
          fishingSpotIsTop := True;
        end;
    
        //Right
        if ((fishingSpotIsRight = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaRight)) then
        begin
          writeln('Found fishing spot in area: Right.');
          fishingSpotIsRight := True;
        end;
    
        //Bottom
        if ((fishingSpotIsBottom = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaBottom)) then
        begin
          writeln('Found fishing spot in area: Bottom.');
          fishingSpotIsBottom := True;
        end;
    
        //Left
        if ((fishingSpotIsLeft = False) AND color_FishingSpot.findIn(fishingSpotSearchAreaLeft)) then
        begin
          writeln('Found fishing spot in area: Left.');
          fishingSpotIsLeft := True;
        end;
      end;
    
    end;
    
    procedure drop();
    var
      j                     : Integer;
      i                     : Integer;
      randomNumber          : Integer;
      dontDropSpaces        : Integer;
      chosenOption          : Integer;
      temporaryInteger      : Integer;
    
      sortReady             : boolean;
      randomNumberWasUnique : boolean;
    
    begin
      writeLn('completedRandomLoop: ' + ToStr(completedRandomLoop));
      if completedRandomLoop = False then
      begin
    
        numberOfSplits := random(1,10);
        randomNumberWasUnique := True;
        SetLength(splitNumbers,numberOfSplits);
    
        for i := 0 to (numberOfSplits-1) do
        begin
    
          // Set randomNumberWasUnique to False to enter loop.
          randomNumberWasUnique := False;
    
          while randomNumberWasUnique = False do
          begin
    
            // Set randomNumberWasUnique to True to enter loop.
            randomNumberWasUnique := True;
    
            // Generate new random number.
            splitNumbers[i] := random(1,100);
    
            // See if that random number is already in array.
            for j := 0 to (i-1) do
            if randomNumberWasUnique = True then
            begin
              begin
                if splitNumbers[i] <> splitNumbers[j] then
                begin
                  randomNumberWasUnique := True;
                end;
                if splitNumbers[i] = splitNumbers[j] then
                begin
                  randomNumberWasUnique := False;
                end;
              end;
            end;
    
          end;
    
        end;
    
        // Sort the array.
        sortReady := False;
        while sortReady = False do
        begin
          sortReady := true;
          for i := 0 to (numberOfSplits-2) do
          begin
            if splitNumbers[i] > splitNumbers[i+1] then
            begin
              // Put first number in temporary array.
              temporaryInteger := splitNumbers[i];
              // Move second number to where first number was.
              splitNumbers[i] := splitNumbers[(i+1)];
              // Move first number to second number spot.
              splitNumbers[(i+1)] := temporaryInteger;
              sortReady := False;
            end;
          end;
        end;
        writeLn('numberOfSplits: ' + ToStr(numberOfSplits));
        writeLn('splitNumbers: ' + ToStr(splitNumbers));
    
        if((Fish_Tool_To_Fish_With = 'Net') OR (Fish_Tool_To_Fish_With = 'Cage') OR (Fish_Tool_To_Fish_With = 'Harpoon')) then
          dontDropSpaces := 1;
        if((Fish_Tool_To_Fish_With = 'Bait') OR (Fish_Tool_To_Fish_With = 'BaitRod') OR (Fish_Tool_To_Fish_With = 'Lure')) then
          dontDropSpaces := 2;
    
        // Generate drop amount for each split + 1.
        SetLength(dropAmount,(numberOfSplits+1));
        for i := 0 to (numberOfSplits) do
        begin
          dropAmount[i] := random(1,(28-dontDropSpaces));
        end;
        Writeln('dropAmount: ' + ToStr(dropAmount));
    
        // Generate where drop starts for each split + 1.
        SetLength(dropStart,(numberOfSplits+1));
        for i := 0 to (numberOfSplits) do
        begin
          dropStart[i] := random((dontDropSpaces+1),(29-dropAmount[i]));
        end;
        Writeln('dropStart: ' + ToStr(dropStart));
    
        completedRandomLoop := True;
      end;
    
      randomNumber := random(1,100);
      Writeln('randomNumber: ' + ToStr(randomNumber));
    
      //chosenOption;
      for i := 0 to (numberOfSplits) do
      begin
        if i = 0 then
        begin
          case randomNumber of
            1..splitNumbers[i] : chosenOption := i;
          end;
        end;
        if NOT(i = 0) AND NOT(i = (numberOfSplits)) then
        begin
          begin
            case randomNumber of
              splitNumbers[(i-1)]..splitNumbers[i] : begin
              Writeln('i: ' + ToStr(i));
              chosenOption := i;
              end;
            end;
          end;
        end;
        if i = (numberOfSplits) then
        begin
          begin
            case randomNumber of
              splitNumbers[i-1]..100 : chosenOption := i;
            end;
          end;
        end;
      end;
      Writeln('chosenOption: ' + ToStr(chosenOption));
    
    
      Writeln('dropStart[chosenOption]: ' + ToStr(dropStart[chosenOption]));
      Writeln('dropStart[chosenOption] + dropAmount[chosenOption]: ' + ToStr(dropStart[chosenOption] + dropAmount[chosenOption]));
      for i := dropStart[chosenOption] to (dropStart[chosenOption] + dropAmount[chosenOption]) do
      begin
        fastDropSlots([i]);
        wait(gaussRandom(dropRandom));
      end;
    
      wait(random(1500,2600));
    
      if anySlotActivated() = True then
      begin
        fastDropSlots([dropStart[chosenOption] + dropAmount[chosenOption]]);
      end;
    
      wait(random(100,1500));
    
      AFKCounter := 0;
    
    end;
    
    
    begin
      clearDebug();
      initAL();
      declarePlayer();
      setupPlayer();
    
      writeln('PersonalRandomModifier = ' + toStr(PersonalRandomModifier));
      writeln('dropRandom = ' + toStr(dropRandom));
    
      Repeat
      checkIfIsFishing();
    
    
      if((Fish_Tool_To_Fish_With = 'Bait') OR (Fish_Tool_To_Fish_With = 'BaitRod') OR (Fish_Tool_To_Fish_With = 'Lure')) then
      begin
        if (itemInSlot(2) = False) then
        begin
          exit;
        end;
      end;
    
      if isInvFull() then
      begin
        drop();
      end;
    
      if (playerIsFishing = FALSE) then
      begin
        fish();
        wait(random(150,3500));
      end;
    
      if (AFKCounter >= 25) then
      begin
        fastClick(MOUSE_RIGHT);
        HumanMMouse([400, 400], 100, 100);
        wait(random(100,2500));
        AFKCounter := 0;
      end;
    
      wait(5000);
      AFKCounter := AFKCounter + 1;
      Until(false);
    end.
    Attached Files Attached Files
    Last edited by Nixes; 05-22-2021 at 11:20 AM.

  2. #2
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Hey Nixes, originally stopped here to test your script and provide feedback. However, i see it is using Aero Lib and I'm familiar with the SRL include...

    That being said, I can make a few suggestions.
    - Randomize! To avoid bans you want to avoid patterns. Take a look at your script and see where you can adjust wait times or mix up the order you do certain things.
    - Add pointless tasks for antiban. Mouse off client, check quest points, look at music, scroll through recent game chat, etc.

  3. #3
    Join Date
    Mar 2018
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Thank you for the feedback. I will certainly try to add them.

  4. #4
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Looking good mate. It's clearly been a while since anyone has been putting out new work, I'm pleased to see this. Keep it up my friend.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  5. #5
    Join Date
    Mar 2018
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Thanks. It means a lot to me. Always liked your scripts, tutorials and your work on Aerolib.

  6. #6
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Nixes View Post
    Thank you for the feedback. I will certainly try to add them.
    Feel free to ask for anything!

    You have a lot of repeated code, which makes it tedious to critique... You'll improve on that over time.

    Here's a specific suggestion, everywhere that you have a "wait(###)" in your script you could consider adding randomness by doing something like the following:

    Old - Your current code:
    Simba Code:
    while (NOT obj_FishingSpotCage.find(Pnt)) do
    begin
      wait(1000);
      writeln('Searching for fishing spot: Cage. ' + toStr(Pnt));
    end else
    begin
      writeln('Found fishing spot: Cage. ' + toStr(Pnt));
      wait(gaussRandom(2000));
      fastClick(MOUSE_LEFT);
      AFKCounter := 0;
    end;

    New - An example of adding in some randomness:
    Simba Code:
    while (NOT obj_FishingSpotCage.find(Pnt)) do
    begin
      wait(750, 1250);
      if random(50) = 0 then wait(0, 500);
      if random(100) = 0 then wait(1000, 3000);
      writeln('Searching for fishing spot: Cage. ' + toStr(Pnt));
    end else
    begin
      writeln('Found fishing spot: Cage. ' + toStr(Pnt));
      wait(1800, 3000);
      if random(50) = 0 then wait(0, 2000);
      if random(100) = 0 then wait(1000, 5000);
      fastClick(MOUSE_LEFT);
      AFKCounter := 0;
    end;

    Explanation:\
    You said you got banned at lvl 75 fishing. Imagine the pattern you were following. You kept an identical routine and waited an EXACT amount of milliseconds(in most cases). Obviously this "behavior" isn't very human. A lot of times i find the best way to make my script more human is to do the action myself in-game and then attempt to emulate my own behavior. Once you have wait times that are more-human, consider jumbling up the order that you do tasks.

    Cheers
    Last edited by footballjds; 05-23-2021 at 11:41 PM.

  7. #7
    Join Date
    Mar 2018
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Thank you for the helpful feedback. I will certainly keep it in mind when I get to adding antiban.

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
  •