Results 1 to 3 of 3

Thread: DTM question?

  1. #1
    Join Date
    Jul 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Question DTM question?

    Using findDtm is it possible to have multiple DTM strings for different items or colors without having to make a new procedure?
    Learning one step at a time.

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Place them in an array and loop through them.

    Simba Code:
    function blabla:Boolean;
    var
      i,x,y:Integer
      dtms:Array of Integer;
    begin
      setLength(dtms,3);
      dtms[0] := DTMFromString('blablabla');
      dtms[1] := DTMFromString('blablabla');
      dtms[2] := DTMFromString('blablabla');

      for i := 0 to 2 do
      begin
        Result := FindDTM(dtms[i],x,y,100,100,200,200);
        if Result then
          Exit;
      end;
    end;
    Working on: Tithe Farmer

  3. #3
    Join Date
    Jul 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you but after doing this how do i use the function with this procedure
    procedure FrogFinder;
    var
    x, y, Frog: Integer;
    begin//Begins program.
    Frog := DTMFromString('mQwAAAHicY2aAAGYgZoTSrFAx12IVBvtMRQ bTCGkGNiAfhhmRMBAAAFSaAnI=');
    //With the above, we Defined our DTM with the code the DTM Editor gave us.
    if FindDTM(Frog, x, y, MSX1, MSY1, MSX2, MSY2) then
    //FindDTM(DTMname, x, y, xs, ys, xe, ys):Boolean;
    begin
    Mouse(x, y, 4, 4, False);
    ChooseOption('ake');
    Wait(3000+random(250));
    Writeln('We have picked up a toad!');

    FreeDTM(Frog);
    end;
    end;
    Learning one step at a time.

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
  •