Results 1 to 4 of 4

Thread: DTM help

  1. #1
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default DTM help

    I was just testing out DTMs and I think something might be wrong.
    SCAR Code:
    program BitMapTEST;
    {.Include srl/srl.scar}
    var
    x, y, CopperOre : Integer;
    Procedure LoadDTMs;
    Begin
      CopperOre := DTMFromString('78DA639CC1C4C0F0840105DCA8B5645000D28' +
           'C40FC1F0818A703D5BC405573B2D4144C3342F98CB330D55CADB1' +
           '4055330DA8E601AA9A3529BAA86AA602D53C4255D317A48AAA662' +
           'E50CD535435070B8C51D40000CC261551');
    End;
    Procedure FindTheOre;
    Begin
    If FindDTM(x, y, CopperOre, 550, 202, 765, 502) Then
      Begin
      ClearDeBug;
      Writeln('Found the Copper Ore.');
      end else
      ClearDeBug;
      Writeln('Make a new DTM Pl0x');
    End;
    begin
      LoadDTMs;
      FindTheOre;
    end.

    [debug]
    Found the Copper Ore.
    Make a new DTM Pl0x
    Successfully executed
    [/debug]
    ????? Whats Wrong?

  2. #2
    Join Date
    Nov 2008
    Location
    Belgium
    Posts
    254
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Its not exactly the way how it should be done, but i think this should work...(unless theres something wrong with the DTM)
    Code:
    program BitMapTEST;
    {.Include srl/srl.scar}
    var
    x, y, CopperOre : Integer;
    
    Procedure LoadDTMs;
    Begin
      CopperOre := DTMFromString('78DA639CC1C4C0F0840105DCA8B5645000D28' +
           'C40FC1F0818A703D5BC405573B2D4144C3342F98CB330D55CADB1' +
           '4055330DA8E601AA9A3529BAA86AA602D53C4255D317A48AAA662' +
           'E50CD535435070B8C51D40000CC261551');
    End;
    
    Procedure FindTheOre;
    Begin
     If FindDTM(x, y, CopperOre, 550, 202, 765, 502) Then
      Begin
      ClearDeBug;
      Writeln('Found the Copper Ore.');
      end;
    If not(FindDTM(x, y, CopperOre, 550, 202, 765, 502)) Then
      begin
      ClearDeBug;
      Writeln('Make a new DTM Pl0x');
      end;
    End;
    begin
      LoadDTMs;
      FindTheOre;
    end.

  3. #3
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    You forgot a second begin/end pair. After the else, put a begin, then after the writeln, put an end;

  4. #4
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Senrath! It works now =D And thank you inpiwimpi too.

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
  •