Results 1 to 9 of 9

Thread: need a lil help again plz

  1. #1
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default need a lil help again plz

    ok when im trying to find DTM i find the bank dtm then when i go to find the tree dtm i get this error why plz..??

    SCAR Code:
    SRL Compiled in 20 msec
    found bank dtm
    [Runtime Error] : Exception: Access violation at address 006D691C in module 'scar.exe'. Read of address 00000000 in line 73 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/Color.scar

    thius is the color.scar

    SCAR Code:
    function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
    var
      t, s, AngleFound: Extended;
    begin
      if (FindDTM(DTM, x, y, x1, y1, x2, y2)) then//<------------Line73???
      begin
        Result := True;
        Exit;
      end;
      repeat
        s := 0.3;
        repeat
          if (FindDTMRotated(DTM, x, y, x1, y1, x2, y2, 0 - t, 0 + t, s, AngleFound)) then
          begin
            Result := True;
            Exit;
          end;
          s := s - 0.1;
        until (s <= 0.1);
        t := t + (Pi / 20);
      until (t >= Pi / 3);
    end;

    and my tree procedure..??

    SCAR Code:
    procedure gettotree;
    begin
      MakeCompass('N');
      wait(1000);
      if DTMRotated(Tree, x, y,  MMX1, MMY1, MMX2, MMY2) then
      begin
        Writeln ('found Tree dtm');
        wait(1000)
        Mouse(x, y, -5, -5, true);
        FFlag(0);
      end;
      FreeDTM(Tree);
    end;

    any help plz thanx in advance scaper

  2. #2
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you just need to set what your dtm, Tree, is somewhere in the script. So do somethin like this.

    SCAR Code:
    procedure gettotree;
    begin
      Tree := DTMFromString('78DA637CC7C4C0F089010504251A31FC07D28' +
           'C40FC1F0818AF02D5FC405593E0CACE20095503028C97806A1819' +
           '51D484F909A2AA790354C301E1C1C454E2B819E490D5DC00AA116' +
           '5C46B170052C50F5D');
      MakeCompass('N');
      wait(1000);
      if DTMRotated(Tree, x, y,  MMX1, MMY1, MMX2, MMY2) then
      begin
        Writeln ('found Tree dtm');
        wait(1000)
        Mouse(x, y, -5, -5, true);
        FFlag(0);
      end;
      FreeDTM(Tree);
    end;

  3. #3
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do you load the DTM before using it?


  4. #4
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    here this is what im doing..?? point me in the right direction plz..??

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    var x, y, Bankdtm, TreeDTM, bankers,Bank,tree: integer;

    procedure loadDTMs;
    begin
      BankDTM := DTMFromString('78DA637CCEC4C020CCC8800C5E1D6703D3305' +
           '1C6A74035DCA86A18191951D5BC04AA9124A0E61D508D2001350F' +
           '816A4409A8790054234040CD1BA01A71FC6A00749408C1');
       TreeDTM := DTMFromString('78DA637CCEC4C0F0840105309733826946289' +
           'FF12150CD0354358C8C686A40E6DC25A0E61D50CD63026A5E01D5' +
           'BC22A0E61150CD4BFC6A0094770B63');

    end;

    procedure GetInToBank;
    begin
      MakeCompass('S');
      wait(1000);
      if DTMRotated(Bankers, x, y,  MMX1, MMY1, MMX2, MMY2) then
      begin
        Writeln ('found bank dtm');
        wait(1000)
        Mouse(x, y, 5, 5, true);
        FFlag(0);
      end;
      FreeDTM(Bank);
    end;

    procedure gettotree;
    begin
      MakeCompass('N');
      wait(1000);
      if DTMRotated(Tree, x, y,  MMX1, MMY1, MMX2, MMY2) then
      begin
        Writeln ('found Tree dtm');
        wait(1000)
        Mouse(x, y, 766, 186, true);
        FFlag(0);
      end;
      FreeDTM(Tree);
    end;

    procedure SetUp;
    begin
      ActivateClient;
      setAngle(true);
      SetRun(True);
      LoadDTMs;
    end;



    begin
    SetUpSRL;
    SetUp;
     repeat
    GetInToBank;
    getToTree;
     until(True);
      begin
    Writeln('we are at bank')
    Terminatescript;
      end;
    end.
    thanx

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

    Default

    You need to call loadDTMs; before you try finding the tree. Plus, Bankers isn't a DTM in the script (you may have meant BankDTM instead?) so you won't find the bank either.
    :-)

  6. #6
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok im a lil stuck and tired so were would i call this b4..?

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

    Default

    Oh, nevermind. You actually did call loadDTMs in your Setup procedure. If that's the case, I'm not really sure why that would be happening other than you not naming the Bankers DTM right (Bankers vs. BankDTM).
    :-)

  8. #8
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also Tree vs TreeDTM.

  9. #9
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It should be TreeDTM not tree.

    EDIT: 900th post! W00t!

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
  •