Results 1 to 10 of 10

Thread: Lumbridge Fisher/Banker

  1. #1
    Join Date
    Jun 2015
    Posts
    29
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default Lumbridge Fisher/Banker

    Hey guys this is my second script! This is a simple Lumbridge fisher/banker that catches trout and salmon. Feel free to provide feedback and suggestions for new scripts!

    REQUIREMENTS:
    1) At least 20 fishing.
    2) Feathers.
    3) Uses OPENGL graphics. If you are using DIRECTX post and I'll give the script with DirectX DTMs.

    INSTRUCTIONS:
    1) Type your username and password in the first procedure in the script.
    2) Have feathers in your inventory or bank to fish with.
    3) Be between the Lumbridge bank chest and river fishing spot.
    4) Start!

    Lumby.PNG
    LumbridgeTroutv2.simba

    Simba Code:
    (*  This program is for fishing and banking trout/salmon on the Lumbridge River.
       To use, have a Lumbridge map named 'Lumby' in your RUNESCAPE_SURFACE folder.
       Simply fill out username and password in the first procedure to start!
        The program uses ACA, DTM, and SPS.

       Programmed by geek borgel, 24 June 2015
    *)


    program lumbridgeTrout;

    {$DEFINE SMART}              // Always have this to load smart
    {$I SRL-6/SRL.simba}         // To load the SRL include files
    {$I SPS/lib/SPS-RS3.Simba}   // To load the SPS include files

    var
      north: boolean;

    // Fill this out for your player.
    procedure declarePlayers();
    begin
      setLength(players, 1);
      with players[0] do
      begin
        loginName := 'USERNAME HERE';
        password := 'PASSWORD HERE';
        isActive := true;
        isMember := false;
      end
      currentPlayer := 0;
    end;

    // This procedure uses an SPS path to walk to the fishing spot.
    // Failsafes: If the player fails to walk to the fish spot the program will terminate.
    procedure walkToFish();
    var
      pathToFish : TPointArray;
    begin
      if (not isLoggedIn()) then
        exit;

      pathToFish := [Point(173, 159), Point(201, 155), Point(241, 146), Point(274, 146), Point(297, 156), Point(284, 183)];

      if SPS.walkPath(pathToFish)  then
         minimap.waitPlayerMoving()
      else
      begin
        writeLn('Failed to walk to fish.');
        terminatescript;
      end;
      north := true;
    end;

    // This procedure uses an SPS path to walk to the Lumbridge bank chest.
    // Failsafes: If the player fails to walk to the bank the program will terminate.
    procedure walkToBank();
    var
      pathToBank : TPointArray;
    begin
      if (not isLoggedIn()) then
        exit;

      pathToBank := [Point(284, 183), Point(297, 156), Point(274, 146), Point(241, 146), Point(201, 155), Point(173, 159)];

      if SPS.walkPath(pathToBank)  then
         minimap.waitPlayerMoving()
      else
      begin
        writeLn('Failed to walk to bank.');
        terminatescript;
      end;
    end;

    // This uses a DTM to find feathers and withdraws them after banking inventory.
    // Failsafes: If the bankscreen fails to close the program will terminate.
    procedure findBanker();
    var
      feather: integer;
    begin
      if (not isLoggedIn()) then
        exit;
      feather := DTMFromString('mbQAAAHicY2VgYOADYmEGCACx2YCYA8oXBWIBIOYEiUlzMmxavRpMz502jWHV4sUMrEBxfiCG0SDMhAWDAQB3sAbL');
      bankScreen.open(BANK_CHEST_LUMBRIDGE);
      Wait(1000 + random(1000));
      bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
      Wait(1000 + random(1000));
      bankScreen.withdraw(feather, 28);
      Wait(1000 + random(1000));
      freeDTM(feather);
      if (not bankScreen.close()) then
      begin
        if (exitTreasure()) then
          if (bankScreen.close()) then
            exit
          else
            terminatescript;
      end;
    end;

    // This procedure swaps the player between the north and south fishing spots.
    // If one doesn't have any locations it will send the player to the other one.
    // changeLocation uses a DTM for each spot on the minimap.
    procedure changeLocation();
    var
      x, y, northDTM, southDTM: Integer;
    begin
      northDTM := DTMFromString('mlwAAAHicY2dgYFBiZmAQBmIRIA4GYnMg9gfif0wMDKeA8ieBeBEQnwbiB0D8Doi/AbGumhxDXGoFQ02CDENtZRFDoIsxQ3NRMEOomxkDP1AeHUtCaWY8GAoAt74PdQ==');
      southDTM := DTMFromString('mggAAAHicY2NgYNAFYjkGCJAF4kAgdgBifyAOBeISqFwQEDsBsZqiNENcehlDY30pQ0umDENNvi9DkLsRAz9QDhtmwoEhAAC1agkw');

      if (north = true) then
        findDTM(southDTM, x, y, minimap.getBounds())
      else
        findDTM(northDTM, x, y, minimap.getBounds());

      mouse(x, y, MOUSE_MOVE, MOUSE_HUMAN);
      fastClick(MOUSE_LEFT);
      minimap.waitPlayerMoving();
      Wait(500 + random(250));

      freeDTM(northDTM);
      freeDTM(southDTM);
      if (north = true) then
        north := false
      else
        north := true;
    end;

    // This function uses ACA to find the fishing spot. It seaches for the white circles.
    // If it finds enough matches it will move the mouse and click if it is a fishing spot.
    // Output: Boolean if it succeeds on clicking the fishing spot or not.
    function findFish(): boolean;
    var
      x, y, t: integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      t := 0;
      repeat
        findColorsSpiralTolerance(x, y, TPA, 13283741, mainScreen.getBounds(), 9, colorSetting(2, 0.10, 1.02));
        t := t + 1;
        writeLn(length(TPA));
      until (length(TPA) > 15 or (t > 250));
      if (length(TPA) > 15) then
      begin
        ATPA := TPA.toATPA(15, 15);
        ATPA.sortFromMidPoint(mainscreen.playerPoint);
        //smartImage.debugATPA(ATPA);
        //smartImage.clear();
        mouse(middleTPA(ATPA[0]), MOUSE_MOVE, MOUSE_HUMAN);
      end;
      if(isMouseOverText(['ishing'], 500)) then
      begin
        fastClick(MOUSE_LEFT);
        result := true;
      end else
        result := false;
    end;

    // This procedure runs until the backpack is full. If the contents of the backpack
    // does not change in several seconds, it will call findFish to seach for a new fishing
    // spot. If it cannot it will send the player to the other fishing location.
    // Failsafes: If the player is not logged in the program will terminate.
    procedure goFishing();
    var
      count: integer;
    begin
      findFish();
      while (not tabBackPack.isFull()) do
      begin
        count := tabBackpack.count();
        wait(6000 + random(5000));
        if (count = tabBackpack.count()) then
          begin
            if (not findFish()) then
              changeLocation();
          end;

        if (not isLoggedIn()) then
          exit;
      end;
    end;

    // main loop
    begin
      clearDebug();               // Clear the debug box
      smartEnableDrawing := true; // So we can draw on SMART
      disableSRLDebug := false;
      smartShowConsole := false;
      setupSRL();                                     // Load the SRL include files
      SPS.setup('Lumby', RUNESCAPE_SURFACE);  // Setup our map
      declarePlayers();             // Set up your username/pass

      if not isLoggedIn() then             // If player isn't logged in then
      begin
        players[currentPlayer].login();   // Log them in
        Wait(5000);
        exitTreasure();            // Exit treasure hunter
        mainScreen.setZoom(true);
        minimap.clickCompass(false);
        mainScreen.setAngle(MS_ANGLE_HIGH);
      end;

      // Main loop, banks first, then walks to the fish and fishes until backpack is full then repeats.
      while (isLoggedIn()) do
      begin
        walkToBank();
        findBanker();
        walkToFish();
        goFishing();
      end;
    end.
    Last edited by geek borgel; 06-25-2015 at 06:07 PM.

  2. #2
    Join Date
    Apr 2015
    Location
    FireFox
    Posts
    528
    Mentioned
    10 Post(s)
    Quoted
    227 Post(s)

    Default

    Good work on the second release!
    Scripting with ogLib

  3. #3
    Join Date
    Jul 2014
    Posts
    28
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    Edit: Sorry, I had originally posted with some commentary, but realized that something was going wrong on my end, and that none of my suggestions would have any impact.

    Looks great, I will let this run indefinitely and update you.
    Last edited by flakazoid; 07-02-2015 at 04:36 AM.

  4. #4
    Join Date
    Jun 2015
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Good Script

  5. #5
    Join Date
    Nov 2014
    Location
    Australia
    Posts
    188
    Mentioned
    2 Post(s)
    Quoted
    97 Post(s)

    Default

    Quote Originally Posted by Xei View Post
    Good Script
    Make sure it's in the right folder...

    Nvm nice edit
    Why join the navy if you can be a pirate? -Steve Jobs

  6. #6
    Join Date
    Jun 2015
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by jonesy259 View Post
    Make sure it's in the right folder...

    Nvm nice edit
    xD i kept saving it into runescape_other fixed it now

  7. #7
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Gz on the script release!

  8. #8
    Join Date
    Aug 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Can i have the DirectX version please!

  9. #9
    Join Date
    Apr 2015
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    21 Post(s)

    Default

    I'd love to get a hold of the DirextX version as well!

  10. #10
    Join Date
    Oct 2015
    Location
    Texas
    Posts
    37
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    haven't had a chance to really dive into it fully yet as i am at work but the failsafes are not working. Once the fishing spot runs out the debug prints lines upon lines of numbers and the only way to fix it is to restart the script. other than that it was running ok.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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