Results 1 to 11 of 11

Thread: Runtime Error

  1. #1
    Join Date
    May 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Runtime Error

    Hey I just finished my wc'er and I've been having a small problem with it. The script itself works fine except if you stop the script and try to run it again, it opens text.scar and I get this error:

    [Runtime Error] : Exception: Access violation at address 0070F96E in module 'scar.exe'. Read of address 00000030 in line 353.

    So every time I stop a script and make some changes, I have to close scar and re-open it so I don't get that problem. Anyone know how to fix this? Thanks.

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For all your errors, you should check out my tut on fixing errors before posting

    But your problem most likely is:

    1. You didn't call for SetupSRL; in your main loop (As said above).

    2. You had a bitmaps procedure, and you didn't call for it in the main loop, so the script couldn't access the bitmaps when called for.

    Those would be the most likely problems with that error, and I haven't heard of any other access violations caused by other things.

  4. #4
    Join Date
    May 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Haven't seen that topic before, will use it next time, thanks.

    I'm still getting that problem even though I do add that in a procedure that is called for in the main setup. Could you take a look through my script? Thanks.

    SCAR Code:
    {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //                                           \\
    ||     Scarf4ce's Power Willow Chopper       ||
    ||~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~||
    ||1) Declare your players.                   ||
    ||2) Drag the cross hairs onto the RS screen ||
    ||3) Keep your axe in the first inv slot     ||
    ||4) Hit the play button and watch your lvl  ||
    ||   climb :P.                               ||
    ||5) Post your progress report =].           ||
    ||                                           ||
    ||~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~||
    ||               Thanks to                   ||
    ||~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~||
    || - Yohojo for letting me use his Ent       ||
    ||   finding procedure                       ||
     \\- SRL community for helping me fix bugs  //
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    }


    program Scarf4cePWC;

    {.include SRL\SRL.SCAR}
    {.include SRL\SRL\Skill\Woodcutting.SCAR}

    const
    RunDirec = 'W'; //Run away direction from fights, ents, etc.
    AmountofLoads = 1; //How many loads per player
    Treecolor = 1982520;
    Treename = 'Willow';

    var
    Loads, LogsCut: Integer;
    Log, BrokenAxe, AxeHandle, RegularAxe: Integer;

    procedure DeclarePlayers;
    begin
      Status('Loading Players')

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

      Players[0].Name := ''; // Runescape username
      Players[0].Pass := ''; // Runescape password
      Players[0].Nick := ''; // 2-4 letters of your Runescape username (No capitals or spaces)
      Players[0].Active := True; //Are you using this player?

      Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := False;

      Players[2].Name := '';
      Players[2].Pass := '';
      Players[2].Nick := '';
      Players[2].Active := False;

      Players[3].Name := '';
      Players[3].Pass := '';
      Players[3].Nick := '';
      Players[3].Active := False;

      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);

    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



    {
      ==============================
    //                               \\
    ||             DTM'S              ||
    \\                               //
      ===============================
    }


    procedure LoadDTMs;
    begin

    Log := DTMFromString('78DA632C666260E0646440067921460CFF813' +
           '448F43F103066314179C880118904D2354035FF19F0AB2905AA11' +
           '22604E23500D0F0135C94035DCF8D50000507909F5');

    BrokenAxe := DTMFromString('78DA633CCAC4C090C1C8800C9A127919FE036' +
       '990E87F2060BC0C54938CAA06220B2381F445A09A04026A8E01D5' +
       'C41050B31FA8A698809AB384CD0100CBBD0D20');

    AxeHandle := DTMFromString('78DA637CCFC4C0E0C6C8800CCA227819FE036' +
       '990E87F2060FC06546389AA06220B2381F473A09A00026ADE00D5' +
       'F81350F316A8C685809A97403541F8D50000D0090D3C');

    RegularAxe := DTMFromString('78DA637461626060676440060DF1BC0CFF813' +
       '448F43F10300601D5FC6740038C482490F604AAF94D408D13500D' +
       '2B237E35F640358204D4F813618E1F50CD1F02EE0906AA61C26F0' +
       'E0099720B7E');

    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    {  =============================
    //                              \\
    ||           Anti Ban            ||
    \\                              //
      ==============================   }


    procedure MyAntiBan;

    begin
    if (not (LoggedIn)) then
       Exit;
    case Random(14) of

       0: AntiBan;

       1: begin
            HoverSkill('Woodcutting', false);
            Wait(992 + random(213));
            GameTab(4);
          end;

       2: begin
            HoverSkill('Attack', false);
            Wait(892 + random(113));
            GameTab(4);
          end;

       3: begin
            GameTab(5)
            Wait(889 + random(852));
            GameTab(4)
          end;

       4: LeaveScreenEvery(6 + Random(4));

       5: PickUpMouse;

       6: RandomChatEvery(5 + Random(4));

       7: begin
            case random(4) of
             0:
               begin
                 TypeSend('Woodcutting lvls ppl?')
                   Wait(2458 + random(1438));
                 TypeSend('Mines 48');
               end;

             1: TypeSend('Yay only 200k more exp to go... -.-');

             2: TypeSend('Omg Woodcutting is so lame and boring..');

             3: TypeSend('Boredd..');

             4: TypeSend('Well only 20 more levels to go..');

             5:
               begin
                 TypeSend('Cant wait till im lvl 70 wc');
                 Wait(2438 + random(1589));
                 TypeSend('Cutting yews is so much faster =]');
               end;

             6: TypeSend('These guys are autoers.. Or are they? X[)');

             7:
               begin
                 TypeSend('Well you ppl are lame..');
                 Wait(1135 + random(895));
                 TypeSend('Jk =P');
               end;

             8: TypeSend('Hmm.. am i bored, or am i bored? =[]');

             9:
               begin
                 TypeSend('Anyone see family guy last night?')
                   Wait(1184 + random(854));
                 TypeSend('Well i didnt X[) lol');
               end;
            end;
          end;

       8: RandomRClickEvery(2 + Random(5));

       9: begin
            HoverSkill('Mining', false);
            Wait(792 + random(121));
            GameTab(4);
          end;

       10: begin
             GameTab(1);
             Wait(500 + random(98))
             GameTab(2);
             Wait(698 + random(87))
             GameTab(3);
             Wait(410 + random(110))
             GameTab(4);
             Wait(619 + random(54))
             GameTab(5);
             Wait(742 + random(67))
             GameTab(6);
             Wait(355 + random(69))
             GameTab(4);
           end;

       11: RotateEvery(10 + Random(10));

       12: MMouse(Random(MSX2), Random(MSY2), 0, 0);

       13: HoverSkill('random', false);
    end;
    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    {  ==================================
    //                                    \\
    ||                Ent                  ||
    ||                                     ||
    || Thanks to Yohojo for this Procedure ||
    \\                                    //
      ===================================     }


    procedure EntFinder;
    var
    EX, EY: integer;
    FX, FY: integer;
    SafeEntWait: LongInt;

    begin
    Status('Checking For Ent')
       if (FindObjMultiText(EX, EY, Treename, Treename, Treename, Treecolor, 2)) then
    begin
       MMouse(EX, EY, 0, 0)
         if FindColorTolerance(FX, FY, 55769, 85, 15, 115, 15, 20) then
       begin
         Status('Ent Found');
         MouseFindFlag(645, 83, 2, 2);
         MarkTime(SafeEntWait)
           repeat
           FTWait(5)
             FindNormalRandoms;
           if not (LoggedIn) then
             NextPlayer(False);
         until TimeFromMark(SafeEntWait) > 29000 + Random(10000)
           EntsAvoided := EntsAvoided + 1
       end;
    end;
    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    {
      ==============================
    //                               \\
    ||          Anti-Randoms          ||
    \\                               //
      ==============================
    }


    function FindFastRandoms: Boolean; //Function by WT-Fakawi
    var
    i: Integer;
    begin
    for i := 1 to 8 do
    begin
       case I of
         1: if FindDead then
             Result := True;
         2: if FindMod then
             Result := True;
         3: if FindMime then
             Result := True;
         4: if FindMaze then
             Result := True;
         5: if FindQuiz then
             Result := True;
         6: if FindDemon then
             Result := True;
         7:
           begin
             if NoGameTab then
             begin
               Result := True;
               Players[CurrentPlayer].loc := 'No GameTab';
               Logout;
               Exit;
             end;
           end;
         7:
           begin
             if InBlack then
             begin
               Result := True;
               Players[CurrentPlayer].loc := 'InBlack';
               Logout;
               Exit;
             end;
           end;
         8: RC;
       end;
       wait(1);
    end;
    end;

    procedure FindRandoms;
    begin
    FindFastRandoms;
    FindNormalRandoms;
    Wait(20)
       FindTalk;
    Wait(20)
       EntFinder;
    if (FindFight) then
    begin
       RunAwayDirection(RunDirec);
       Wait(8000 + Random(2000));
       RunBack;
    end;
    Wait(20)
       FindTalk;
    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    { =============================
    //                             \\
    ||          Axe Stuff           ||
    \\                             //
      =============================   }


    procedure AxeHeadColors;
    begin
      Wait(300)
      HighestAngle;
      MakeCompass('N');
      GameTab(4)
      FindAxeHeadColor;
    end;

    procedure IsAxeBroken;
    var
    FX, FY, TX, TY: Integer;

    begin
      GameTab(4)
      Wait(450 + random(130))
      if (FindDTM(RegularAxe, FX, FY, MIX1, MIY1, MIX2, MIY2)) and
         (not(FindDTM(BrokenAxe, TX, TY, MIX1, MIY1, MIX2, MIY2))) then
      begin
        Exit;
      end;
      begin
        if (FindDTM(BrokenAxe, TX, TY, MIX1, MIY1, MIX2, MIY2)) and
           (not(FindDTM(RegularAxe, FX, FY, MIX1, MIY1, MIX2, MIY2))) then
        begin
          Writeln('Axe Broken, Switiching Players.')
          NextPlayer(False)
        end;
      end;
    end;

    procedure FindAxeHead;
    begin
    Status('Attempting to find the Axe Head')
       Findhead;
    end;

    //---------

    function FindObjMultiText2(var cx, cy: Integer; Ut1, UT2, UT3: string; color,
    tolerance: Integer): Boolean;
    var
    x, y, a, c, i, x1, y1, x2, y2: Integer;
    begin
       Color := Color;
    if (FindColorTolerance(x, y, color, msx1, msy1, msx2, msy2, tolerance)) then
    begin
       x1 := 245;
       y1 := 165;
       x2 := 277;
       y2 := 185;
       repeat
         if (not (Loggedin)) then
           Break;
         a := a + 1;
         if (a = 1) or (a = 3) then
           c := c + 1;
         for i := 1 to c do
         begin
           if (a = 1) then
           begin
             x1 := x1 + 30;
             x2 := x2 + 30;
           end
           else if (a = 2) then
           begin
             y1 := y1 - 20;
             y2 := y2 - 20;
           end
           else if (a = 3) then
           begin
             x1 := x1 - 30;
             x2 := x2 - 30;
           end
           else if (a = 4) then
           begin
             y1 := y1 + 20;
             y2 := y2 + 20;
           end;
           if (x1 = 485) and (x2 = 517) then
             x2 := x2 - 2;
           if (y1 = 325) and (y2 = 345) then
             y2 := y2 - 7;
           if (x2 > 515) then
             Break;
           if (FindColorTolerance(x, y, Color, x1, y1, x2, y2, tolerance)) then
           begin
             MMouse(x, y, 0, 0)
               cx := x;
             cy := y;
             if (IsUpTextMulti(UT1, UT2, UT3)) then
             begin
               Result := True;
               Break;
             end;
           end;
         end;
         if (a = 4) then
           a := 0;
       until (x2 > 515) or (Result = True);
    end;
    end;
    //-----

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



    {  =============================
    //                              \\
    ||         Tree Chopping         ||
    \\                              //
      =============================   }



    Procedure ChopTree;
    var
    TimeMarker: integer;
    TreeFound: boolean;

    begin
      If InvFull then
      Exit;
      If not LoggedIn then
      Exit;
      AxeHeadColors;
      Repeat
        IsAxeBroken;
        wait(154+random(28));
        if FindObjMultiText2(X, Y, Treename, Treename, Treename, TreeColor, 12) then
        begin
          Wait(23 + Random(34))
          Mouse(x, y, 2, 2, True);
          TreeFound := True;
          MyAntiBan;
        end Else writeln (' Did not find tree color ')
        Wait(234+random(123));
        if treefound then
        begin
          TreeFound := False;
          MarkTime (TimeMarker);
          Repeat
            Wait(500+random(100))
            FindRandoms;
            EntFinder;
          Until (InvFull) or (TimeFromMark (TimeMarker) > 4000)  // Add here time to wait till clicking tree again
        end Else Wait(232+random(143));
      until (InvFull) or (not LoggedIn)
    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



    {  ==============================
    //                               \\
    ||          Log Dropping          ||
    \\                               //
      ==============================   }


    procedure DroppingLogs;

    var
    bx, by: Integer;

    begin
    if (InvFull) then
      begin
       GameTab(4);
       repeat
         if (FindDTM(Log, bx, by, MIX1, MIY1, MIX2, MIY2)) then
            Mouse(bx, by, 4, 4, false)
            ChooseOption(bx, by, 'Drop')
            FindRandoms;
            Wait(300+Random(120))
            LogsCut := LogsCut + 1;
       until (not (FindDTM(Log, bx, by, MIX1, MIY1, MIX2, MIY2)))
      Loads := Loads + 1;
    end;
    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    {  ==============================
    //                               \\
    ||        Progress Report         ||
    \\                               //
      ==============================   }


    procedure ProgressReport;
    begin
    ClearDebug;
       Writeln('<<_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_>>')
       Writeln('<<      Scarf4ce Place/Tree Power Cutter         ')
       Writeln('<<          Worked For: ' + TimeRunning)
       Writeln('<<          Chopped: ' + IntToStr(LogsCut) + ' Logs ')
       Writeln('<<          Did: ' + IntToStr(Loads) + ' Loads   ')
       Writeln('<<      Thanks for using my script           ')
       Writeln('<<_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_>>')
       SRLRandomsReport;
    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    {  ==============================
    //                               \\
    ||           Main Setup           ||
    \\                               //
      ==============================   }


    procedure Setup;
    begin
      SetupSRL;
      DeclarePlayers;
      LoadDTMs;
      ActivateClient;
    end;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    begin
      Wait(2000)
      Setup;
      begin
        if (not (LoggedIn)) then Loginplayer;
        HighestAngle;
        MakeCompass('N')
        repeat
          Wait(2000 + Random(1000))
          DisguiseScar('[' + IntToStr(Loads) + '/' +IntToStr(AmountofLoads) + '] ' +(Players[CurrentPlayer].name) + '')
          ChopTree;
          DroppingLogs;
          ProgressReport;
          if (Loads >= AmountofLoads) then
          begin
            HighestAngle;
            MakeCompass('N');
            LogOut;
            NextPlayer(True);
            Loads := 0
          end;
        until (false)
      end;
    end.

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  5. #5
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try SetupSRL; rather than just Setup.

    If that doens't work I'll take a closer look.

  6. #6
    Join Date
    May 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by omgh4x0rz View Post
    Try SetupSRL; rather than just Setup.

    If that doens't work I'll take a closer look.
    Nope, still not working. Same error when I end the script and try to run it again.

  7. #7
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    hmmm I don't know if u include mining u have to do SetupSRLMining;
    or something check the manual in the woodcutting skill include bit and see if there's one for SetupSRLWoodcutting or something
    Sleeping...

  8. #8
    Join Date
    May 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rkroxpunk View Post
    hmmm I don't know if u include mining u have to do SetupSRLMining;
    or something check the manual in the woodcutting skill include bit and see if there's one for SetupSRLWoodcutting or something
    Nope, that is not the problem =/.

  9. #9
    Join Date
    May 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Anyone else know how I might be able to fix this problem?

  10. #10
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    all i can think of is that the DTM's arn't correct...

  11. #11
    Join Date
    May 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The_Rs_Monkey View Post
    all i can think of is that the DTM's arn't correct...
    Thanks monkey, I'll try remaking the DTMs again and see how that goes.

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
  •