Results 1 to 8 of 8

Thread: Access Violation?

  1. #1
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Access Violation?

    Everytime I run the script ive been making all of a sudden it's giving me Access Violations everytime I focus on the RS client. Anybody know why? Could I need to reinstall scar?

    edit: Reinstalled scar, still getting the gay error...

    Here's the script.

    SCAR Code:
    {=========================================================================]
    [                     Awsome Air Crafter                                  ]
    [                                                                         ]
    [           NAME        : Alex's air crafter                              ]
    [           WRITER      : ~alex~                                          ]
    [           CATEGORY    : Runecrafting                                          ]
    [           DESCRIPTION : Air Rune crafter                                ]
    [           AUTOCOLOR   : Yes                                             ]
    [           NOTES       : MUST WEAR A TIARA -- DO *NOT* USE A TALISMAN    ]
    [                         Thanks to Icefire908 for edited enterRcAlter    ]
    [                         function                                        ]
    [           CONTACT     : [email]Gamesjunky1991@gmail.com[/email]                        ]
    [                                                                         ]
    [                                                                         ]
    [=========================================================================]
    [         This is a empty Template for a Collecting Script                ]
    [=========================================================================]
    [                           Instructions.                                 ]
    [=========================================================================]
    [ 1. USE Runescape with Low Detail, Very Bright.                          ]
    [ 2. Set your Screen to 32 bit TRUE color.                                ]
    [ 3. Set Playernames and Passwords in DeclarePlayers.                     ]
    [ 4. SET HOWMANYPLAYERS inside DeclarePlayers                             ]
    [ 5. Set StartPlayer and essToCraft                                       ]
    [ 6. Start script, logged in or out, in fally west bank                   ]
    [ 7. Tell me about any bugs                                               ]
    [=========================================================================}



    program AlexsAirrCrafter;
    {.include srl/srl.scar}
    var
    bankbooth1,bankbooth2,bankbooth3:integer;
    esscrafted,esstobecrafted:integer;

    //******************** Set These Constants  *******************//

    const StartPlayer         = 0;     // Determines who will play first
    Const essToCraft          = 43;     // Number of loads before switching Player.

    //**********************RuneScape Constants*******************************//


    //************************************************************************//
    const VersionNumber       = '2';      // Compliant with Rev 568+
    //************************************************************************//

    Procedure DeclarePlayers;
    begin
         HowManyPlayers  :=6;               // Set Number of Players here.
         NumberOfPlayers(6);   // Sets the Players Array Length;
         CurrentPlayer:=0;        // CurrentPlayer = Array Index

         Players[0].Name :='';
         Players[0].Pass :='';
         Players[0].Nick :='';
         Players[0].Loc  :='Loc1';
         Players[0].Skill:='runecrafting';
         Players[0].Active:=True;

         Players[1].Name :='';
         Players[1].Pass :='';
         Players[1].Nick :='';
         Players[1].Loc  :='Loc1';
         Players[1].Skill:='';
         Players[1].Active:=false;

         Players[2].Name :='';
         Players[2].Pass :='';
         Players[2].Nick :='';
         Players[2].Loc  :='Loc1';
         Players[2].Skill:='';
         Players[2].Active:=false;

         Players[3].Name :='';
         Players[3].Pass :='';
         Players[3].Nick :='';
         Players[3].Loc  :='Loc1';
         Players[3].Skill:='';
         Players[3].Active:=false;

         Players[4].Name :='';
         Players[4].Pass :='';
         Players[4].Nick :='';
         Players[4].Loc  :='Loc1';
         Players[4].Skill:='';
         Players[4].Active:=false;

         Players[5].Name :='';
         Players[5].Pass :='';
         Players[5].Nick :='';
         Players[5].Loc  :='Loc1';
         Players[5].Skill:='';
         Players[5].Active:=false;

         writeln(inttostr(HowManyPlayers)+' Players');

    end;

    procedure PlayerStats;

    var Active: string;
    var i: Integer;
    begin
    writeln('**********************************************');
    writeln('Name         : '+ Players[CurrentPlayer].Name);
    writeln('Number       : '+ inttostr(CurrentPlayer));
    writeln('Runecrafting Level : '+ inttostr(getskilllevel('runecrafting')));
    writeln('Select Skill : '+ Players[CurrentPlayer].Skill);
    writeln('Worked for   : '+ inttostr(Players[CurrentPlayer].Worked)+' minutes.');
    if Players[CurrentPlayer].Active=True then Active:='True' else Active:='False';
    writeln('Active       : '+ Active);
    writeln('**********************************************');

    for i := 0 to HowManyPlayers-1 do
       begin
       if Players[i].Active=True then Active:='True' else Active:='False';
          writeln( (inttostr(i))+' : '+Players[i].name+ ' = '+Active+'. - Lvl : '+inttostr(Players[i].Level[15])+
          '. - B :'+inttostr(Players[i].Banked)+' Times.'+
          ' -  : '+IntToStr(Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
        end
       writeln('**********************************************');
    end;

    //************************************************************************//

    procedure ProgressReport;
    begin
      begin
      WriteLn(' ');
      WriteLn('<============== -'+VersionNumber+'- Progress Report ===============>');
      SRLRandomsReport;
      Writeln(' ');
      end;
      PlayerStats;
    end;

    procedure randoms;
    begin
      findnormalrandoms;
      if findfight then
      begin
        runawaydirection('N');
        wait(3000+random(1000));
        runback;
      end;
    end;

    function EnterRCAlter: Boolean; //Made By SRL Edited by Icefire908
    var
      cx, cy, c: Integer;
    begin
      repeat
        if (not (LoggedIn)) then
          Exit;
        repeat
          c := c + 1;
          if (not (LoggedIn)) then
            Exit;
          Wait(25);
          if (c > 100) then
          begin
            Result := False;
            Exit;
          end;
        until (FindMSColorTol(cx, cy, 6243878, 20));
        MMouse(cx, cy, 0, 0);
        Wait(300 + random(160));
      until (IsUpText('Mysterious ruins'));
      Mouse(cx, cy, 1, 1, true);
      randoms;
    end;

    procedure loadbmps;
    begin
      bankBooth1 := BitmapFromString(13, 9, 'z78DAADCD490E8340104' +
               '3D12BF550D8AE65D3C3FD8F14225004A291B260F356D6379D010B' +
               '770B2370D687BB1B2B3338B1D1A0B3320AA598575FB455B14E245' +
               '7D4896245BBD839302E0E0586BB1E9518272665A64308CC17B93D' +
               'DB446DFFCB4497FFECAAC4839C38D4A8BB256AD045288FD72CA8F' +
               '6ED063376C0F4E4BE99D8D02D1D3A86F5478166F52FF77284ACBC' +
               'E50733879C1F');

        bankBooth2 := BitmapFromString(11, 1, 'z78DAB33034B33071B4A' +
               '0800400DD030E45');

        bankBooth3 := BitmapFromString(14, 1, 'z78DA3335333132B2302' +
             '582347204626CA4AB913310229100E65111DD');
    end;

    procedure bankOpener;
    var
    tolerance,attempts:integer;
    found:boolean;

    begin
      makecompass('N')
      tolerance:=10
      loadbmps;
      repeat
      if (findbitmaptolerancein(bankBooth1,x,y,msx1,msy1,msx2,msy2,tolerance)) or
      (findbitmaptolerancein(bankBooth2,x,y,msx1,msy1,msx2,msy2,tolerance)) or
      (findbitmaptolerancein(bankBooth3,x,y,msx1,msy1,msx2,msy2,tolerance)) then
      begin
        attempts:=attempts + 1
        mmouse(x,y,3,3)
        tolerance := tolerance + 1
        writeln('stage1')
        if (isuptextmulti('booth','ank','nk bo')) then
        begin
          found := true
          writeln('stage2')
        end;
      end;
      until((found = true) or not(loggedin) or (tolerance >=200))

      if tolerance >=200 then
      begin
        writeln('Could not find booth')
        nextplayer(true)
        writeln('stage 4')
      end;
     
      if (not (loggedin)) then
      begin
       loginplayer;
       bankopener;
       writeln('stage 4')
      end;
     
      if found then
      begin
        mouse(x,y,4,4,false)
        ('stage 5')
        if clickoption('Use-quickly',1) then
        begin
          writeln('stage6')
          flag;
          writeln('stage')
          randoms;
        end else
        begin
         // bankopener;
         writeln('stage8')
         end;
        end else
      begin
        writeln('Could not find bank')
        nextplayer(true)
      end;
        writeln('stage 9')
       freebitmap(bankbooth1)
       freebitmap(bankbooth2)
       freebitmap(bankbooth3)
    end;

    procedure walkto2;
    begin
      mouse(615,132,0,0,true) // first movement
      wait(10000)
      randoms;
      flag;
      mouse(648,143,5,5,true) //second movement, fally exit
      randoms;
      flag;
      mouse(621,120,5,5,true) // 3rd movement towards symbol
      randoms;
      flag;
      if (findsymbol(x,y,'tree')) then
      begin
        mouse(x,y,2,2,true)
        randoms;
        flag;
        mouse(638,144,5,5,true)
        randoms;
        flag;
        mouse(608,92,5,5,true)
        randoms;
        flag;
        enterrcalter;
        randoms;
        flag;
        wait(4000+random(500))
        esstobecrafted:=invcount
       if findobj(x,y,'Altar',3947587,5) then
       mouse(x,y,5,5,true)
       randoms;
       flag;
       esscrafted := esscrafted + esstobecrafted
       esstobecrafted:=0
       if esscrafted >= esstocraft then
         begin
           writeln('All ess crafted! Next player.')
           esscrafted:=0
           nextplayer(true)
       end else
     
       wait(2000+random(500))
      end;

    end;

    procedure walkback;
    begin
      if esscrafted >= esstocraft then
      begin
        writeln('All ess crafted! Next player.')
        esscrafted:=0
        nextplayer(true)
      end else
      if findobj(x,y,'Portal',8037804,6) then
      begin
        mouse(x,y,2,2,true)
        flag;
        wait(1500+random(500))
        mouse(674,22,5,5,true)
        wait(4000+random(600))
        randoms;
        flag;
     
        if (findsymbol(x,y,'tree')) then
        begin
          mouse(x,y,0,0,true)
          randoms;
          flag;
          mouse(710,51,0,0,true)
          randoms;
          wait(5000+random(500))
          flag;
          //mouse(647,11,0,0,true)
          RadialRoadWalk(findfallyRoadColor, 338, 360, 70, 1, 1);
          randoms;
          wait(5000+random(500))
          flag;
         // mouse(671,34,0,0,true)
         makecompass('S')
         RadialRoadWalk(findfallyRoadColor, 172, 200, 70, 1,1);
         randoms;
          wait(5000+random(500))
          flag;
          makecompass('n')
          randoms;
        end;
      end else
      begin
        writeln('Could not find portal')
        nextplayer(true)
        esscrafted:=0
      end;
    end;

    procedure depositrunes;
    begin
      if esscrafted >= esstocraft then
      begin
        writeln('All ess crafted! Next player.')
        esscrafted:=0
      //  nextplayer(true)
      end else
     if findcolortolerance(x,y,5498367,570,16,726,151,5) then
     begin
      mouse(x,y + 15,0,0,true)
      randoms;
      flag;
      makecompass('n')
      bankopener;
      writeln('bank opener done')
      flag;
      wait(2000+random(400))
      if pinscreen then
      begin
        writeln('Detected pin screen, please remove pin')
     //   nextplayer(true)
      end else
        depositall;
        fixbank;
        withdraw(1,1,28)
        closebank;
        highestangle
        perfectnorth;
      end else
      begin
        writeln('Could not find bank symbol. More than likley covered by people.')
        writeln('Go to less busy world.')
     //   nextplayer(True)
        esscrafted:=0
      end;
    end;

    begin
      setupsrl;
      DeclarePlayers;
      DisguiseScar('Notepad')
      LoginPlayer;
      activateclient;

      repeat
      depositrunes;
      walkto2;
      walkback;
      progressreport;
      until(false)
    end.

  2. #2
    Join Date
    Oct 2006
    Location
    I'm a figment of your imagination
    Posts
    422
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Weird error. I got one of those too, but I really don't see any reason why you should get an error.

    I think it's a problem with SCAR. Try using less memory by reducing the ammount of variables you have in your script.

    It's been a while... but I'm BACK!!!

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

    Default

    Access violations are caused when you don't call for SetupSRL; in your script (which you did.. so thats kind of odd)

  4. #4
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    Access violations are caused when you don't call for SetupSRL; in your script (which you did.. so thats kind of odd)
    not quite correct. Access violation errors occur when you try calling a bitmap / DTM you haven't defined / loaded into the memory yet
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


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

    Default

    Oh, sorry starblaster thanks for correcting me. But I was correct though right? they can be caused by not setting up SRL correct?

  6. #6
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    Oh, sorry starblaster thanks for correcting me. But I was correct though right? they can be caused by not setting up SRL correct?
    tat is correct, because in SetupSRL; we have th prodecure SeupSRLBitmaps Without laoding the SRL bitmaps, errors will occur
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  7. #7
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, I edited my extremly sexy bank procedure :P and Im not getting violations now. Thanks guys

  8. #8
    Join Date
    Sep 2006
    Posts
    206
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I had this problem too when find yellow bankers and npc....I was using the procedure "autocolorthis" and the bitmap hadn't been loaded yet...whats peculiar is sometimes it worked, sometimes it didn't :P

    O well, thanks starblaster100
    “Life is a goldmine, exploit it.” ~M. K. Soni
    www.sea4yourselves.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Access violation...
    By mikevskater in forum OSR Help
    Replies: 3
    Last Post: 02-06-2008, 07:28 AM
  2. More Access Violation
    By Mute in forum OSR Help
    Replies: 2
    Last Post: 11-19-2007, 08:00 PM
  3. Access Violation
    By Mute in forum OSR Help
    Replies: 5
    Last Post: 11-18-2007, 01:32 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
  •