Results 1 to 5 of 5

Thread: RunTime Error

  1. #1
    Join Date
    Mar 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default RunTime Error

    [Runtime Error] : Exception: Access violation at address 0065478C in module 'scar.exe'. Read of address 00000000 in line 196 in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Text.scar

    If anyone could help me to fix this, also, when im at the yeww trees, it tries the normal trees rather than the yew trees, how do i make it so if it checks one tree, and its not it, it wont go back to that one?

    Thanks in advance

    My Unfinished Code

    SCAR Code:
    //This Script Made By Marneus901
    //First Script Made By Me, And Tanks To Communities
    //Such As Sythe.org And SRL-forums.com For Tutorials
    //And Inspiration


    //NOTE:: Does Not Do Randoms Yet

    //(FOR PROGRAMMING PURPOSES) Then Make -Y CORD Directly Abouve Shope Inside Castle Garden
    //Then More Up But To The Left (-X)
    //Then Directly Abouve Again (-Y)
    //If Cannot Find Tree, Then Head East (X)
    //If Already Moved East, And Cannot Find Tree, Move West (-X)
    //If West, Full Load, Head To Bank
    //If East, Full Load, Head West, Then Move To Bank
    //Use Shotcut Symbol
    //Then Directly South
    //Repeat
    //Repeat (Should Be Out Of Varrock Gardens After This)
    //Click On BankSymbol

    program AutoYewCutter;
    {.include SRL/SRL.scar}
    var
    myx,myy:Integer;
    InfoManSymbol:Integer;
    SmithSymbol:Integer;
    AbleToFindBmps:Integer;
    SmithPlace:Integer;
    TreeMini:Integer;
    YewTree:Integer;

    const
    Username='username';
    Password='password';
    BankIconColor= 4048866; //Get The Yellow Part Of Symbol In Mini-Map
    //InfoGuySymbol= 7755818; //The Blue Color Of Information Guide Below Bank (On Mini-Map)
    StaffShopIcon= 1200010; //Brown Color Of Staff Shop Symbol In MiniMap
    ShortcutSymbol= 2395905; //On MiniMap
    YewTreeSymbol= 95746;//WellGee?
    YewTreeColor= 1986624;

    procedure WalkToTrees;
    begin
    HighestAngle;
    Wait(2000);
    {MakeCompass('S');
    MakeCompass('N');    }

       //Wait(1500);
       //Well, Your Character Is Always At The Cordinate 268, 170
       //North Square Is 270, 150 = y cord - 20
       //West 230, 185
       //South 265, 225 = y cord + 40
       //East 305, 185
       {     repeat
     if (FindBitmap(InfoManSymbol, myx, myy)) then
      begin
        AbleToFindBmps := 1;
      end else
        AbleToFindBmps := 0;
      if (FindBitmap(SmithSymbol, myx, myy)) then
      begin
        AbleToFindBmps := 1;
      end else
        AbleToFindBmps := 0;
        if (FindBitmap(TreeMini, myx, myy)) then
      begin
        AbleToFindBmps := 2;
      end else
        AbleToFindBmps := 0;
        Writeln('Unable To Find SmithSymbol Or InfoManSymbol');
        wait(2000);
        until(AbleToFindBmps=1);
      Mouse(myx, myy -10, 0, 0, True);
                if(not(AbleToFindBmps=2))then
                begin
              repeat
     if (FindBitmap(SmithPlace, myx, myy)) then
      begin
        AbleToFindBmps := 1;
      end else
        AbleToFindBmps := 0;
        wait(2000);
        Writeln('Unable To Find SmithPlace');
        until(AbleToFindBmps=1);
        Mouse(myx+26, myy-86, 0, 0, true);
        end;            }

        Wait(500);
        Mouse(269+420, 156-119, 0, 0, true);
        Wait(20000);
        Mouse(642, 19, 0, 0, true);
        Wait(30000);
        Mouse(642, 19, 0, 0, true);
        Wait(15000);
        Mouse(655, 19, 0, 0, true);
        Wait(15000);
        repeat
     if (FindBitmap(YewTree, myx, myy)) then
      begin
        AbleToFindBmps := 1;
      end else
        AbleToFindBmps := 0;
        wait(2000);
        Writeln('Unable To Find YewTree');
        until(AbleToFindBmps=1);
        Writeln('Found Yew Tree');
        Mouse(myx, myy, 0, 0, true);
        Wait(10000);
        { FindColor(x,y,YewTree,0,0,518,340)
         repeat
         if(IsUpText('Chop Down Yew')=true) then
         begin
         end else
         Writeln('Sorry Cannot Find Yew Tree ATM, Trying Again...');
         until(IsUpText('Chop Down Yew')=false)
         Mouse(myx, myy, 0, 0, false);}

         
    end;


    Procedure ChoptheTrees; // Thanks To Skys Shadows Edgeville Yew Cutter Code
    begin
      repeat
        if (FindMSColor(x,y,3438704))or
        (FindMSColor(x,y,3887184))or
        (FindMSColor(x,y,1925200))then
         MMouse(x,y,1,1)
          If IsUpText('Chop') then
           Mouse(x,y,1,1,true)
           wait(5000+Random(5000)+Random(5000)+Random(5000))
      until (invfull = true)
    end;



    procedure LetsLogin;
    begin
    Mouse(457, 290, 0, 0, true);
    Wait(2000);
    SendKeys(Username+chr(13));
    SendKeys(Password);
    Wait(2000);
    Mouse(304,325,0,0,true);
    Wait(6000);
    Mouse(392, 338, 0, 0, true);
    Wait(3000);
    end;

    procedure LetsLogout;
    begin
    Wait(1000);
    Mouse(645, 485, 0, 0, true);
    Wait(3000);
    Mouse(629, 377, 0 ,0 ,true);
    end;

    procedure GetAllBmps;
    begin
    InfoManSymbol := BitmapFromString(7, 10, 'z78DA333040006347' +
           '33370B3364D2000310238E4B8D010EBB885149891AEADA45AA4AE' +
           '2012E330185155263');
    SmithSymbol := BitmapFromString(9, 7, 'z78DA33300001130B132' +
           '76337032436B548030C80DF2E03A201A9EAC9D345AA0B890F0D00' +
           '16CA4D55');
      SmithPlace := BitmapFromString(20, 21, 'z78DA33353531377435' +
           '0593AEE66E666EE6A64822D42521E69BBB989B19B998D2CC5E886' +
           '998242E7B7191B84C26D9BFE6E646C616A6F40FE7517B47ED1DB5' +
           '7708DA0B2147ED1DAEF68EE47C84BFCE2586A4967FCDCDCD5C8C2' +
           'D68490EA4BD007C502882');
      TreeMini := BitmapFromString(1, 26, 'z78DA33753277367435059' +
           '326AEE62EC626986C086966446F1200DF4E2342');
      YewTree := BitmapFromString(17, 17, 'z78DAE5944112C3200845A' +
           'FF445D39025439AFB1FA9D3B8314331D4B49B9605E3E8F0DFF811' +
           '81FF0A655575F3679513CD193911AF90368F110F55F769061DF46' +
           '5D99E3B5DD682157489E264615109517C7D87B2DF8B481929EEDE' +
           '18C57AF82EE5C4318752DD1BA544BB13A75856AD2D25035B5D7BF' +
           'A91576D59AD424BB1A7F1A9E94FBAA55CF90D5ED4EE535029B752' +
           '98E47BBF4DEB4FBFCBBF1A0F883166A0');
    end;



    begin
    GetAllBmps;
    //LetsLogin;
    //Wait(4000);
    WalkToTrees;
    ChoptheTrees;
    Wait(1000);
    //LetsLogout;
    FreeBitmap(InfoManSymbol);
    end.

  2. #2
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Add SetupSRL; in main loop:
    SCAR Code:
    begin
    SetupSRL; // <-- HERE
    GetAllBmps;
    //LetsLogin;
    //Wait(4000);
    WalkToTrees;
    ChoptheTrees;
    Wait(1000);
    //LetsLogout;
    FreeBitmap(InfoManSymbol);
    end.

    That should get rid of that error...
    Huehuehuehuehue

  3. #3
    Join Date
    Mar 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That did it, thank you
    If You are going to read this,
    do you have any suggestions at how to make the ChoptheTrees acually target the yews instead of the reg. trees?
    i changed If IsUpText('Chop') then to
    If IsUpText('Chop down Yew') then

  4. #4
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've heard FindObjMultiText is a very nice way of finding/clicking objects such as trees.
    Huehuehuehuehue

  5. #5
    Join Date
    Jun 2006
    Posts
    366
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by marneus901 View Post
    That did it, thank you
    If You are going to read this,
    do you have any suggestions at how to make the ChoptheTrees acually target the yews instead of the reg. trees?
    i changed If IsUpText('Chop') then to
    If IsUpText('Chop down Yew') then
    That is too big.. Use things like
    SCAR Code:
    if isuptext ('hop') and isuptext ('own') and isuptext ('Yew') then ....

    I personally just use if isuptext ('Yew'), works pretty fine..
    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly. - put this in your sig (I did, so should u )

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
  •