Results 1 to 10 of 10

Thread: RunTime error

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default RunTime error

    Well. I get this error when testing a ddtm:
    SCAR Code:
    [Runtime Error] : Exception: Access violation at address 00721002 in module 'scar.exe'. Read of address 00000000 in line 56 in script C:\Program Files (x86)\SCAR 3.20\Scripts\dtm tester.scar

    in this test script taken from Bobbo's ddtm tut:
    SCAR Code:
    program NewScript;
    {.include SRL/SRL.scar}
    var
    x,y:integer;
    function LoadAllDTMWalks(WalkNumber: Integer): Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: array[0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      case WalkNumber of
        1: begin //Walk To mine Begins
    dtmMainPoint.Areashape := 0;
    dtmMainPoint.Areasize := 0;
    dtmMainPoint.Color := 6513258;
    dtmMainPoint.Tolerance := 0;
    dtmMainPoint.x := 675;
    dtmMainPoint.y := 92;

    dtmSubPoints[0].Areashape := 0;
    dtmSubPoints[0].Areasize := 0;
    dtmSubPoints[0].Color := 6513258;
    dtmSubPoints[0].Tolerance := 0;
    dtmSubPoints[0].x := 676;
    dtmSubPoints[0].y := 98;

    dtmSubPoints[1].Areashape := 0;
    dtmSubPoints[1].Areasize := 0;
    dtmSubPoints[1].Color := 6513258;
    dtmSubPoints[1].Tolerance := 0;
    dtmSubPoints[1].x := 673;
    dtmSubPoints[1].y := 88;

    dtmSubPoints[2].Areashape := 0;
    dtmSubPoints[2].Areasize := 0;
    dtmSubPoints[2].Color := 6513258;
    dtmSubPoints[2].Tolerance := 0;
    dtmSubPoints[2].x := 669;
    dtmSubPoints[2].y := 98;

    dtmSubPoints[3].Areashape := 0;
    dtmSubPoints[3].Areasize := 0;
    dtmSubPoints[3].Color := 6513258;
    dtmSubPoints[3].Tolerance := 0;
    dtmSubPoints[3].x := 684;
    dtmSubPoints[3].y := 94;
          end;
      end;
    end;

    function WalkToSomewhere: Boolean;
    var
      WalkDTM: integer; // Calls the WalkDTM making walking simpler.
    begin
      WalkDTM := LoadAllDTMWalks(1); //Load which DDTM you want to find.
      if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then // Find the DDTM using Find DTM
      begin
        Mouse(X, Y, 8, 8, True);
        WriteLn('Walk Main 1. - Complete.');
        FFlag(0);
        Result := True; // If succesfully finds it will click it and wait to flag is gone.
      end else // else it will do this...
        if RadialWalk(FindFallyRoadColor, 300, 220, 55, 1, 1) then
        begin
          Writeln(' Walk Backup 1. - Complete.');
          Result := True; //Will look for this if DDTM fails, if this fails then logsout, but you can change that.
        end else
        begin
          Result := False;// cant find the backup goes here...
          Writeln(' Walk Backup 1. - Failed. Logging Out.');
          FreeDTM(WalkDTM); // FREEs the DDTM so you dont have a memory overload :P
          if not (Result) then //if doesnt get results does this
          begin
            Logout; // logs out.
          end;
        end;
    end;
    Procedure Setup;
    begin
      SetupSRL;
      ActivateClient;
    end;

    begin
      Setup;
      Walktosomewhere;
    end.

    Anyone have any ideas on what the error is?
    ~Des

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    dtmSubPoints: array[0..4] of TDTMPointDef;

    ... the array is only [0..3], so it goes out of the range?

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    i know what it is
    1 sec

    ~shut

    EDIT:
    SCAR Code:
    program NewScript;
    {.include SRL/SRL.scar}
    var
    x,y:integer;
    function LoadAllDTMWalks(WalkNumber: Integer): Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: array [0..3] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      case WalkNumber of
        1: begin //Walk To mine Begins
    dtmMainPoint.Areashape := 0;
    dtmMainPoint.Areasize := 0;
    dtmMainPoint.Color := 6513258;
    dtmMainPoint.Tolerance := 0;
    dtmMainPoint.x := 675;
    dtmMainPoint.y := 92;

    dtmSubPoints[0].Areashape := 0;
    dtmSubPoints[0].Areasize := 0;
    dtmSubPoints[0].Color := 6513258;
    dtmSubPoints[0].Tolerance := 0;
    dtmSubPoints[0].x := 676;
    dtmSubPoints[0].y := 98;

    dtmSubPoints[1].Areashape := 0;
    dtmSubPoints[1].Areasize := 0;
    dtmSubPoints[1].Color := 6513258;
    dtmSubPoints[1].Tolerance := 0;
    dtmSubPoints[1].x := 673;
    dtmSubPoints[1].y := 88;

    dtmSubPoints[2].Areashape := 0;
    dtmSubPoints[2].Areasize := 0;
    dtmSubPoints[2].Color := 6513258;
    dtmSubPoints[2].Tolerance := 0;
    dtmSubPoints[2].x := 669;
    dtmSubPoints[2].y := 98;

    dtmSubPoints[3].Areashape := 0;
    dtmSubPoints[3].Areasize := 0;
    dtmSubPoints[3].Color := 6513258;
    dtmSubPoints[3].Tolerance := 0;
    dtmSubPoints[3].x := 684;
    dtmSubPoints[3].y := 94;

      TempTDTM.MainPoint := dtmMainPoint; //Forgot this line
      TempTDTM.SubPoints := dtmSubPoints; //And this
      Result := AddDTM(TempTDTM);         //And This
          end;
      end;
    end;

    function WalkToSomewhere: Boolean;
    var
      WalkDTM: integer; // Calls the WalkDTM making walking simpler.
    begin
      WalkDTM := LoadAllDTMWalks(1); //Load which DDTM you want to find.
      if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then // Find the DDTM using Find DTM
      begin
        Mouse(X, Y, 8, 8, True);
        WriteLn('Walk Main 1. - Complete.');
        FFlag(0);
        Result := True; // If succesfully finds it will click it and wait to flag is gone.
      end else // else it will do this...
        if RadialWalk(FindFallyRoadColor, 300, 220, 55, 1, 1) then
        begin
          Writeln(' Walk Backup 1. - Complete.');
          Result := True; //Will look for this if DDTM fails, if this fails then logsout, but you can change that.
        end else
        begin
          Result := False;// cant find the backup goes here...
          Writeln(' Walk Backup 1. - Failed. Logging Out.');
          FreeDTM(WalkDTM); // FREEs the DDTM so you dont have a memory overload :P
          if not (Result) then //if doesnt get results does this
          begin
            Logout; // logs out.
          end;
        end;
    end;
    Procedure Setup;
    begin
      SetupSRL;
      ActivateClient;
    end;

    begin
      Setup;
      Walktosomewhere;
    end.
    Last edited by Shuttleu; 05-15-2009 at 06:41 AM.

  4. #4
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Nope, this is the line that it moves to.
    SCAR Code:
    WalkDTM := LoadAllDTMWalks(1); //Load which DDTM you want to find.

    EDIT: Shut your quick?

  5. #5
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  6. #6
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    ya well what i posted is still an error because it will never find the dtm :P

  7. #7
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  8. #8
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    amg... i didn't even read the whole thing. lol he missed the actual dtm setting.

  9. #9
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Yes! My ddtm works Thank you so much Shut, Rep+ since your always helping me!

  10. #10
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by DeSnob View Post
    Yes! My ddtm works Thank you so much Shut, Rep+ since your always helping me!
    lol thanks no problem
    if ever you need any help from me just pm me or if you have msn you will probs get me on there
    or you could just make a post and i may see it

    ~shut

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
  •