Results 1 to 6 of 6

Thread: [Runtime Error] : Exception: Access violation at address 00721BB8

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default [Runtime Error] : Exception: Access violation at address 00721BB8

    ok i get that error every time it tries to do this


    Code:
    Procedure treesTobank;
    var bankers:integer;
    begin
    disguise(' to banking')
    Bankers := DTMFromString('78DA632C666260706740015FBF32300802694' +
           '620FE0F048C20355E0C6880118904D2E540353E44A8F14055F1EF' +
           '9F20AA1A905D6E04D41462BA19AB1A4F02EEA900AAF126420D9A3' +
           '977EF32A0A80100852514A9');
        if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
        Mouse(X+5+random(3),Y+5+random(3), 0, 0, True);
        Flag;
        freedtm(bankers);
        if not DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
        begin
         if (FindSymbol(x, y, 'bank')) then
         begin
          Mouse(x, y, 5, 5, True);
          fflag(10);
        end else
      end;
    end;
    alost he srl color window pops up along with the error

  2. #2
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    freedtm(bankers);
        if not DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then

    You free the DTM and then search for it?

  3. #3
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    use this:
    SCAR Code:
    procedure TreesToBank;
    var
      Bankers: integer;
    begin
      Disguise(' to banking');
     
      Bankers := DTMFromString('78DA632C666260706740015FBF32300802694' +
               '620FE0F048C20355E0C6880118904D2E540353E44A8F14055F1EF' +
               '9F20AA1A905D6E04D41462BA19AB1A4F02EEA900AAF126420D9A3' +
               '977EF32A0A80100852514A9');
           
      if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
        Mouse(x + RnadomRange(5, 8), y + RnadomRange(5, 8), 0, 0, True);
        Flag;
        FreeDtm(Bankers);
      end else
      begin
        if FindSymbol(x, y, 'bank') then
        begin
          Mouse(x, y, 5, 5, True);
          fflag(10);
        end;
      end;
     
      FreeDtm(Bankers);
    end;
    :P

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You should still exit out of the procedure when it finds symbol or you will still get the error as you only free it if it finds the DTM and it will try to free it twice.

    SCAR Code:
    function TreesToBank : boolean;
    var
      Bankers: integer;
    begin
      Disguise(' to banking');
     
      Bankers := DTMFromString('78DA632C666260706740015FBF32300802694' +
               '620FE0F048C20355E0C6880118904D2E540353E44A8F14055F1EF' +
               '9F20AA1A905D6E04D41462BA19AB1A4F02EEA900AAF126420D9A3' +
               '977EF32A0A80100852514A9');
           
      if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
        Mouse(x + RnadomRange(5, 8), y + RnadomRange(5, 8), 0, 0, True);
        Flag;
        result := true;
      end else
      begin
        if FindSymbol(x, y, 'bank') then
        begin
          Mouse(x, y, 5, 5, True);
          fflag(10);
          result := true;
        end;
      end;
      FreeDTM(Bankers);
    end;

    Also try to make it a function.
    Last edited by Da 0wner; 05-01-2009 at 06:16 PM.

  5. #5
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    How do you want to do Result:=true; when it's not a function?
    ~Hermen

  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry forgot to change that. It is changed now. I meant to put it as a function hence the last line of the post.

    I believe that most procedures/functions like this should be functions to easily check if it was found or preformed or not.

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
  •