Results 1 to 10 of 10

Thread: Runtimes!

  1. #1
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Runtimes!

    Ok, I'm "new" here, in other words I haven't scripted in 5 months (except for my newest one), and am having trouble with, you guessed it, runtime errors!!!!


    Quote Originally Posted by pomme
    Quote Originally Posted by Hey321
    Quote Originally Posted by pomme
    Just wondering i have to start at any particular place ? It keep giving couldnt find compass location Error message.

    hope to hear from you soon =]
    Start near the bank symbol in rogues' den and focus on the rs screen (drag the crosshairs in scar over the screen and let go).
    thanks for the reply .. it keep crashing after it took the food from the bank walk over to the wallsafe .. after that usually on the 1st crack or 2nd crack it will crash and prompt that.

    [Runtime Error] : Exception: Access violation at address 00531734 in module 'scar.exe'. Write of address 02263D88 in line 31 in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/Mouse.scar

    hope to hear from you soon.

    That's the pm in which I got the error, it was just from Pomme, a new person to the community I think, who needed some help. Anyways, I have NO CLUE WHATSOEVER at what it is. Any help?

  2. #2
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No-one?

  3. #3
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    dont u have to put the include callings in the right order?...maybenot i havent scripted in a long time either

    edit: nvm if the script actually runs first
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  4. #4
    Join Date
    Oct 2006
    Location
    MI USA
    Posts
    3,166
    Mentioned
    6 Post(s)
    Quoted
    11 Post(s)

    Default

    Hey and Welcome back....


    Sticky: Im getting SRL Errors! Help!
    Starblaster100


    • Exception: Access violation at address


    If you are trying to auto, you are using a bad script i'm afraid. Find a new one.

    If you are a scripter, You are trying to call a bitmap / DTM which you have not loaded into the memory yet. Remember to put SetupSRL at the top of your main loop and load all of your Bitmaps and DTMs
    The search button is still your best friend here ....Here is another post with someone having the same problems.... http://www.villavu.com/forum/showthread.php?t=18955


  5. #5
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That's not the problem, here, I'll post the script:

    SCAR Code:
    {.Script Info:
    # ScriptName  = Rogues' Den Thiever
    # Author      = Hey321
    # Description = Thieves... In the Rogues' Den... Duh
    # Version     = 0.2 BETA
    # Date        = Sunday, Sept. 23, 2007
    # Comments    = This is beta, expect bugs, don't complain about them! Just let me know! I'll fix em asap!
    /Script Info}


    {

    Credits:
    Pwnaz0r (You rock man!) for the walking to and from, and opening bank
    Wt-Fakawi for the base of my eat food function, had no idea how to do it, his script
    showed me how ;)
    N3ss3s for my colors of the safe :P}


    Program RoguesDenThief;
    {.include srl/srl.scar}

    var
      x, y, Unsuccesful, Thiefs, food : Integer;

    Const
     TheSRLId = '';
     TheSRLPassword = '';

    function bankEmerald: boolean;
    var
      hiscolor: array [0..1] of integer;
      ex, ey, i: integer;
    begin
      for i := 1 to 4 do
      begin
      case i of
        1: MakeCompass('N');
        2: MakeCompass('S');
        3: MakeCompass('E');
        4: MakeCompass('W');
      end;
        result:= false;
        ColorToleranceSpeed(2);
        hiscolor[0]:= 8234195;
        hiscolor[1]:= 5271929;
        if FindColorSpiralTolerance(ex, ey, hiscolor[0], MSX1, MSY1, MSX2, MSY2, 5)then
          if FindColorSpiralTolerance(ex, ey, hiscolor[1], ex - 20, ey - 20, ex + 20, ey + 20, 5)then
            begin
              Mouse(ex, ey, 0, 0, false);
              if chooseoption('ank')then
              begin
                MakeCompass('N');
                Flag;
                result:= true;
                exit;
              end;
            end;
      end;
      MakeCompass('N');
    end;

    function WalkTobank: boolean;
    var
      sx, sy: integer;
    begin
      SymbolAccuracy:= 0.8;
      if findsymbol(sx,sy,'bank')then
        begin
          if FindColorSpiralTolerance(sx, sy, 195836, MMX1, MMY1, MMX2, MMY2, 1)then
            begin
              mouse(sx, sy + 5, 2, 2, true);
              flag;
            end;
        end else
        begin
        sx:= 698;
        sy:= 39;
        if FindColorSpiralTolerance(sx, sy, 195836, MMX1, MMY1, MMX2, MMY2, 1)then
          begin
            Mouse(sx, sy + 2, 2, 2, true);
            flag;
            result:= bankEmerald;
          end;
        end;
    end;

    function MakeMiddleDDTM: integer;
    var
      DDTM: TDTM;
    begin
      DDTM.MainPoint.x := 654;
      DDTM.MainPoint.y := 78;
      DDTM.MainPoint.AreaSize := 0;
      DDTM.MainPoint.AreaShape := 0;
      DDTM.MainPoint.Color := 0;
      DDTM.MainPoint.Tolerance := 0;

      SetArrayLength(DDTM.SubPoints, 4);

      DDTM.SubPoints[0].x := 663;
      DDTM.SubPoints[0].y := 76;
      DDTM.SubPoints[0].AreaSize := 2;
      DDTM.SubPoints[0].AreaShape := 0;
      DDTM.SubPoints[0].Color := 0;
      DDTM.SubPoints[0].Tolerance := 0;

      DDTM.SubPoints[1].x := 667;
      DDTM.SubPoints[1].y := 97;
      DDTM.SubPoints[1].AreaSize := 2;
      DDTM.SubPoints[1].AreaShape := 0;
      DDTM.SubPoints[1].Color := 0;
      DDTM.SubPoints[1].Tolerance := 0;

      DDTM.SubPoints[2].x := 655;
      DDTM.SubPoints[2].y := 97;
      DDTM.SubPoints[2].AreaSize := 2;
      DDTM.SubPoints[2].AreaShape := 0;
      DDTM.SubPoints[2].Color := 0;
      DDTM.SubPoints[2].Tolerance := 0;

      DDTM.SubPoints[3].x := 648;
      DDTM.SubPoints[3].y := 87;
      DDTM.SubPoints[3].AreaSize := 2;
      DDTM.SubPoints[3].AreaShape := 0;
      DDTM.SubPoints[3].Color := 0;
      DDTM.SubPoints[3].Tolerance := 0;

      Result := AddDTM(DDTM);
    end;

    function WalkBack: boolean;
    var
      cx, cy: integer;
    begin
      MakeCompass('N');
      If DTMRotated(MakeMiddleDDTM,cx,cy,MMX1,MMy1,MMX2,MMY2)then
      begin
        Mouse(cx,cy - 5,0,0,true);
        Flag;
        result:= true;
      end;
    end;



    Procedure WithdrawFood;
    begin
     FixBank;
     DepositAll;
     If(FindColorTolerance(x, y, 1391016, MSX1, MSY1, MSX2, MSY2, 10)) Then
     Begin
     MMouse(x, y, 3, 3);
     GetMousePos(x, y)
     Mouse(x, y, 0, 0, false);
     ChooseOption('10');
     CloseBank;
     end;
    end;

    Procedure WaitToThief;
    var
     Waited : Integer;
    Begin
    Repeat
    Waited:=Waited+1
    Wait(2000);
    FindNormalRandoms;
    Status(IntToStr(Waited))
    If(InChat('trap!')) Or
      (InChat('loot.')) Then
    Begin
    Wait(1000)
    If(InChat('loot.')) Then
    ReportVars[3]:= 1;
    Break;
    End;
    Until(Waited=5)
    Waited:=0
    End;


    function IsUpTextEx(s: string): boolean;
    begin
      result:= Pos(s, rs_getuptext) <> 0;
    end;

    function FindSafe(var x, y: integer; Colors: array of integer): boolean;
    var
      cts: integer;
    begin
      cts:= GetColorToleranceSpeed;
      SetColorSpeed2Modifiers(0.5,0.5);
      ColorToleranceSpeed(2);
      if FindColorSpiralTolerance(x, y, Colors[0], MSX1, MSY1, MSX2, MSY2, 10) then
        if FindColorSpiralTolerance(x, y, Colors[1], MSX1, MSY1, MSX2, MSY2, 10) then
          if FindColorSpiralTolerance(x, y, Colors[2], MSX1, MSY1, MSX2, MSY2, 10) then
          begin
            MMouse(x, y, 0, 0);
            if IsUpTextEx('rack Wall') then
              begin
              result:= true;
              ColorToleranceSpeed(cts);
              GetMousePos(x, y);
              Mouse(x, y, 0, 0, true);
              WaitToThief;
              end else
              FindSafe(x, y, [1119509, 5405, 2510699, 1783627, 1583412])
            if result then exit;
          end;
    end;

    Procedure FoodEat;
    Var
     HealAmount, HPLeft, HPTotal: Integer;
    begin
    HPLeft  := GetSkillAmount('hitpoints');
    HPTotal  := GetSkillLevel('hitpoints');
    HealAmount:=9;
    GameTab(4)
    If(HPTotal>=HPLeft+HealAmount)Then
    Begin
    If(FindColorTolerance(x, y, 1391016, MIX1, MIY1, MIX2, MIY2, 10)) Then
    Mouse(x, y, 3, 3, true);
    End;

    End;

    Procedure Progress;
    Var
     GotThiefDone : Integer;
    Begin
    ClearDebug;
    WriteLn('Thieved ' + IntToStr(Thiefs) + ' times');
    WriteLn('Got Caught ' + IntToStr(Unsuccesful) + ' times');
    GotThiefDone:=Thiefs-Unsuccesful;
    WriteLn(IntToStr(GotThiefDone) + ' succesful thieves');
    WriteLn('Worked For: ' + TimeRunning);
    End;


    begin
    SetupSrl;
    ScriptId:= '329';
    SRLId:= TheSRLId;
    SRLPassword:= TheSRLPassword;
    ActivateClient;
    Repeat
    WalkToBank;
    FindNormalRandoms;
    MakeCompass('N');
    Repeat
    FindNormalRandoms;
    bankEmerald;
    Wait(100)
    Until(Bankscreen);
    Wait(50)
    WithdrawFood;
    FindNormalRandoms;
    Wait(1000+random(500))
    WalkBack;
    MakeCompass('s');
    Repeat
    Progress;
    Wait(1000)
    If(InChat('trigger'))Then
    Begin
    FoodEat();
    Unsuccesful:=Unsuccesful+1
    SRLRandomsReport;
    end;
    inc(Thiefs);
    FindNormalRandoms;
    FindSafe(x, y, [1119509, 5405, 2510699, 1783627, 1583412])
    ReportVars[0]:= 1;
    SRLRandomsReport;
    Wait(1000)
    If(InChat('get loot'))Then
    ReportVars[2]:= 1;
    FindNormalRandoms;
    Until(Not(FindColorTolerance(x, y, 1391016, MIX1, MIY1, MIX2, MIY2, 10)))
    FindNormalRandoms;
    Until(False)
    end.

  6. #6
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    SCAR Code:
    function WalkBack: boolean;
    var
      cx, cy: integer;
    begin
      MakeCompass('N');
      If DTMRotated(MakeMiddleDDTM,cx,cy,MMX1,MMy1,MMX2,MMY2)then
      begin
        Mouse(cx,cy - 5,0,0,true);
        Flag;
        result:= true;
      end;
    end;

    You've never loaded MakeMiddleDDTM into the memory, which could be why it's throwing that error.
    :-)

  7. #7
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Check the ddtm procedure above it. It walks there and then gives the error after 3-4 thieves dude.

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

    Default

    Still iso help.

  9. #9
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hey321 View Post
    Still iso help.
    .

  10. #10
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    What is the error line?

    EDIT: O, 31 lemme see

    EDIT EDIT: oh, this is weird its in Mouse, not in your script =/ Or atleast telling of the error..

    Meh, Ill let c0de handle, I can see he is viewing..

    EDIT EDIT EDIT: Anyways if he or anyone else neither can find the error, just try to think where about the error happens and then pinpoint it with Try - Except.

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
  •