Results 1 to 8 of 8

Thread: Banking is going to drive me OVER THE EDGE!

  1. #1
    Join Date
    Sep 2008
    Location
    Nova Scotia, Canada
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Banking is going to drive me OVER THE EDGE!

    I have couple of issues with this one:

    When I run it I get a run-time error in line 50 of SRL.scar when it hits the line srl_FreeBitmaps

    And when I run this (with bank already open) it searches, finds my rune axe which is the top left corner of the search, then reclicks on All Tab because the coords returned are messed.

    Here's the output from this:

    Code:
    SRL Compiled in 16 msec
    screen coord x: 57, y: 98
    bank coord x: 0, y: 0
    [Runtime Error] : Out Of Range in line 50 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL.scar
    Edit: Yuck! Don't ever post your message after hitting the preview button. It goes all to hell. Reposted so its readable.

    SCAR Code:
    program New;

    {.Include SRL/SRL.scar}

    const
      bronze = 0;
      iron = 1;
      steel = 2;
      black = 3;
      mithril = 4;
      adamant=5;
      rune = 6;
      dragon = 7;
      none = 99;

    function FindAxeInBank(BestAxeToUse: integer; TakeOut: boolean): integer;
    var
      MSP: TPoint;
      BP: TPoint;
      Axe: integer;
    begin
      result := none;
      srl_LoadBitmaps([bmp_Axe_Bronze, bmp_Axe_Iron, bmp_Axe_Steel, bmp_Axe_Black,
        bmp_Axe_Mithril, bmp_Axe_Adamant, bmp_Axe_Rune, bmp_Axe_Dragon]);
      try
        FixBankTab();
        FixBank;
        SearchBank('axe');
        for Axe := BestAxeToUse downto bronze do
        begin
          if FindBitmapToleranceIn(srl_GetBitmap(bmp_Axe_Bronze + Axe), MSP.x, MSP.y, MSX1, MSY1, MIX1, MSY2, 10) then
          begin
            if (TakeOut) then
            begin
    writeln('screen coord x: ' + inttostr(MSP.x) + ', y: ' + intTostr(MSP.y));
              BP := MSTPointToBankPoint(MSP);
    writeln('bank coord x: ' + inttostr(BP.x) + ', y: ' + intTostr(bp.y));
              Withdraw(BP.y, BP.x, 1);
            end;
            result := Axe;
            exit;
          end;
        end;
      finally
        srl_FreeBitmaps;
      end;
    end;

    begin
      ClearDebug;
      SetupSRL;
      ActivateClient;
      FindAxeInBank(rune, true);
    end.
    http://www.stats.srl-forums.com/sigs/6137.png

    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly. - Put this in your sig.

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

    Default

    lol easy fix, use DTM's instead of bitmaps I have never used bitmaps, so im no help at all, but i know that DTM's are way more reliable than bitmaps. just a thought, but goodluck with you script.

    -Blumblebee
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Sep 2008
    Location
    Nova Scotia, Canada
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Next time around

    Yeah, in a *future* version I'll use DTMs. But for just learning to script I was sticking to what is in the basic SRL library as much as possible.

    Plus I really am not a big fan of the DTM editor. That tiny little bitmap gives me migranes squinting to see it lol.
    http://www.stats.srl-forums.com/sigs/6137.png

    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly. - Put this in your sig.

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

    Default

    Quote Originally Posted by spamthis View Post
    Yeah, in a *future* version I'll use DTMs. But for just learning to script I was sticking to what is in the basic SRL library as much as possible.

    Plus I really am not a big fan of the DTM editor. That tiny little bitmap gives me migranes squinting to see it lol.
    er tiny, the picture you can use can be anysize, you just have to make the points of the item you want to make the dtm of. In my opinion, dtms are easier to create than bitmaps, but i guess its what ever you feel most comfortable with scripting. I thnk however, that if you used dtms, your script would run more efficient (less errors atleast) and be more reliable. Plus, more people know about dtms than bitmap (or atleast i do ). Anyways, best of uck with the bitmap thing, if youd like some help with dtms however, i would be more than happy to help you out.

    -Blumblebee
    “Ignorance, the root and the stem of every evil.”

  5. #5
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by blumblebee View Post
    er tiny, the picture you can use can be anysize, you just have to make the points of the item you want to make the dtm of. In my opinion, dtms are easier to create than bitmaps, but i guess its what ever you feel most comfortable with scripting. I thnk however, that if you used dtms, your script would run more efficient (less errors atleast) and be more reliable. Plus, more people know about dtms than bitmap (or atleast i do ). Anyways, best of uck with the bitmap thing, if youd like some help with dtms however, i would be more than happy to help you out.

    -Blumblebee
    *cough*
    Bitmaps = Copy/paste
    DTMs = Pick point by point, then select tolerances etc.

    @spamthis
    Bitmaps work fine for Banking/Inventory. Hard part is getting a good copied/pasted part of the bitmap in question. Also I use a tolerance of 18 for most of the bitmaps I use.

    I think its how your declaring and searching for your bitmaps that's messing it up.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  6. #6
    Join Date
    Sep 2008
    Location
    Nova Scotia, Canada
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bah!

    Edit: Found the problem. Its (yet another) bug in the SRL routines.

    Edit: No it's not. I was manually freeing the bitmap instead of calling srl_FreeBitmaps (which unloads every single bitmap in the array) because I may have other bitmaps loaded I still want to use. I guess I could also manually unflag that bitmap as being loaded...That would solve the problem as well.

    Edit: I spend WAAAAAY too much time reading the SRL source code.

    And way too much time editing an re-editing my posts. lol
    http://www.stats.srl-forums.com/sigs/6137.png

    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly. - Put this in your sig.

  7. #7
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Better then double posting... Not to you know advertise, but if you want some easy withdrawing features, look into my WithdrawItem procedures in the SRL Public SVN.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  8. #8
    Join Date
    Sep 2008
    Location
    Nova Scotia, Canada
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Thanks

    Thanks, I'll look into it.

    I have mine working now, but it wouldn't be much of a stretch to imagine yours are better.

    Edit: Finally got my axe detect to check your inventory, weapon slot, and bank, figure out which is better and put in inventory or wield if attack lvl is high enough.
    http://www.stats.srl-forums.com/sigs/6137.png

    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly. - Put this in your sig.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hermpie's banking proc's and Func's makes banking a piece of a cake!
    By ShowerThoughts in forum Research & Development Lounge
    Replies: 13
    Last Post: 06-11-2008, 03:16 PM
  2. Parkway Drive
    By StrikerX in forum Music, Movies and TV
    Replies: 4
    Last Post: 03-26-2008, 02:33 AM
  3. Edge Man Killer!
    By I Karma I in forum OSR Help
    Replies: 10
    Last Post: 05-05-2007, 12:28 AM

Posting Permissions

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