Results 1 to 3 of 3

Thread: Runtime Error

  1. #1
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Runtime Error

    I get this error and i am not sure why. I dont think it is my SRL as it happens to other people running it aswell. And I have restarted scar. Thanks in advance and for reading this.

    Heres the error:
    [Runtime Error] : Exception: Access violation at address 006D72AA in module 'scar.exe'. Read of address 00000000 in line 159 in script

    Heres the script:

    SCAR Code:
    program FallyEastToFurnaceWalker;
    {.Include SRL\SRL.SCAR}
    {.Include srl/srl/skill/smithing.scar}

    Var
       BankDTM, SteelBar: Integer;
       x,y: Integer;

    Procedure DeclarePlayers;
    Begin

      HowManyPlayers :=1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer :=0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;

    Function FindMyLocation: String;
    var
      sx, sy: Integer;
    Begin
      If Not LoggedIn then Exit;
      SymbolAccuracy := 0.5;
      If FindSymbol(sx,sy,'Furnace') then
         Begin
           Result:='AtFurnace'
           Writeln('At furnace :)')
         end else
          If FindSymbol(sx,sy,'Bank') then
            Begin
              Result:='AtBank'
              Writeln('We are at Bank');
            end else
            begin
              Writeln('Lost... Could not find location, Logging out.');
              Logout;
              Exit;
            end;
    end;

    Procedure OpenBank2;
    begin
     FFlag(0);
      OpenBankFast('Feb');
     end;

    Procedure WalkToFurnace;
    Begin
      If Not LoggedIn then Exit;
      MakeCompass('N');
      GameTab(4);
      SetRun(True);
      RadialRoadWalk(FindFallyRoadColor, 277, 346, 64, 2, 0);
      FFlag(0);
      RadialRoadWalk(FindFallyRoadColor, 277, 346, 64, 2, 0);
      FFlag(0);
      SymbolAccuracy := 0.5;
      If FindSymbol(x, y, 'Furnace') then
      Begin
        Writeln('Found the Furnace Symbol');
        Mouse(x,y,5,5,True);
        FFlag(0)
        SymbolAccuracy := 0.8;
        Writeln('Entering Furnace');
      end else
      begin
        Writeln('Could not find the Furnace ');
        Logout;
      end;
    end;

    Procedure LoadDTMs(DTM: String);
    Begin
        Case LowerCase(DTM) of

      'BankDTM':
      Begin
        BankDTM:= DTMFromString('78DA636C64626088604001FFFEFD636060042' +
                      '386FF40C0D805549300916385AAF9F387094C3342F98C2073E209' +
                      'A82925424D2D6135001FB8135B');
      end;

      'Steelbar':
      Begin
        Steelbar := DTMFromString('78DA6314646060E063400101DEDE609A11CA6' +
                      '7140612120C688011550D37901023A0861548F012502300249808' +
                      'A89104122C04D4C8116117C81C61FC6A0099450201');
      end;
     end;
    end;

    Function FindFurnace2: Boolean;
    Begin
      If Findfurnace(x, y) then
      begin
        writeln('furnace found trying to open');
        Mouse(x, y, 5, 5, true);
        if openfurnace then
        begin
          writeln('furnace opened');
          Result:= True;
        end else
          writeln('found furnace but could not open');
      end else
        Writeln('Couldn''t find furnace');
    end;

    Procedure WalkToBank;
    Begin
      If Not LoggedIn then Exit;
      Begin
        MakeCompass('N');
        SetRun(True);
        RadialWalk(FindFallyRoadColor, 45, 105, 70, 2, 1);
        FFlag(0);
        RadialWalk(FindFallyRoadColor, 95, 158, 66, 2, 0);
        FFlag(0);
        SymbolAccuracy := 0.5;
        If FindSymbol(x, y, 'Bank') then
        Begin
          Writeln('Found the Bank Symbol');
          Mouse(x,y,5,5,True);
          FFlag(3);
          Writeln('Entering Bank');
        end else
        begin
          Writeln('Could not find the Bank ');
          Logout;
        end;
      end;
    end;

    Procedure WalkTobank2;
    var
      BankDTM : Integer;
    begin
      LoadDTMs('BankDTM');
      If  DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
        Mouse(x, y, 5, 5, true);
        WriteLn('Found The BankBooth');
        FreeDTM(BankDTM);
      end else
        Begin
          Writeln('Not Found Bank...')
        End;
      end;


    Procedure WithdrawSteelBars;
    var
      SteelBar: Integer;
    begin
      LoadDTMs('SteelBar');
      if FindDTM(SteelBar, x, y, MSx1, MSy1, MSx2, MSy2) then
      begin
        Wait(500+random(150));
        Mouse(x, y, 3, 3, False);
        Wait(100 +random(100));
        ChooseOption('All');
      end else
      begin
        MouseBox(302, 300, 326, 316, 1);
        repeat
          Wait(100 +random(500));
        until FindTextTPA(clBlack, 30, MCX1, MCY1, MCX2, MCY2, 'name of', UpChars, Nothing);
        TypeSend('steel bars');
        Wait(100 +random(500));
        If FindDTM(SteelBar, x, y, MSx1, MSy1, MSx2, MSy2) then
        begin
          Mouse(x, y, 5, 5, false);
          Wait(25 +random(100));
          ChooseOption('All');
        end;
      end;
      FreeDTM(SteelBar);
    end;

    begin
      SetupSRL;
      ClearDebug;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      Wait(100 +random(500));
      If (FindMyLocation = 'AtBank') then
      Begin
        OpenBank2;
        WithdrawSteelBars;
        WalkToFurnace;
        FindFurnace2;
      end else
      Begin
        If (FindMyLocation = 'AtFurnace') then
        Begin
          WalkToBank;
           WalkToBank2
           OpenBank2;
           WithdrawSteelBars;
        end;
      end;
    end.

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Not sure if you got this fixed (you did ask on the IRC), but if not, the problem is you have a global and local variable SteelBar, so the procedure that looks for the SteelBar DTM tries to use the local variable, while the DTM is assigned to the global variable. Renaming one of the variables (probably the local variable) should fix it.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Apr 2007
    Location
    England
    Posts
    313
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm, it seems thats not the problem . I originally had it as a global variable and then i added it as a local to not overload it, and it seems i forgot to remove it. Thanks for taking your time to read this though

    Edit: Actually, i need the Global one, i just need to remove the local one

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [Runtime Error] : Exception: buffer error
    By GasMan in forum OSR Help
    Replies: 11
    Last Post: 05-13-2007, 02:07 PM
  2. Runtime Error
    By CamHart in forum OSR Help
    Replies: 2
    Last Post: 11-23-2006, 05:21 AM
  3. Runtime error
    By sk8ter in forum OSR Help
    Replies: 3
    Last Post: 10-30-2006, 01:55 PM

Posting Permissions

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