Results 1 to 6 of 6

Thread: Freeing a DTM

  1. #1
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Freeing a DTM

    Hi Guys/Girls,

    i have the following function that i use to load a dtm.

    SCAR Code:
    Function LoadDTM(what:String):Integer;
    begin
      case LowerCase(what) of
        'bank' : Result := DTMFromString('78DA639CC5C4C0B0910105FCF9C304A619A17' + 'CC64944AAD98A5F0D003D2909D0');
        'log' : Result := DTMFromString('78DA63DCC0C4C090C1C8800DC04419D700D5C' + '433629585AB990F549349400DC8AE42026A7602D5A4E2570300421E0' + '588');
      end;
    end;

    is it possible to also free a dtm using the same function?

    for example
    SCAR Code:
    procedure DTMWalk(whatDTM:string);
    begin
      Write('Trying DTM Walking')
      if FindDTM(LoadDTM(whatDTM), x, y, MMX1, MMY1, MMX2, MMY2)then
      begin
        Mouse(x+10, y, 5, 5, true);
        Flag;
      end;
      FreeDTM(LoadDTM(whatDTM));
    end;

    or will this result in two DTM's being loaded and only one being freed?

  2. #2
    Join Date
    Sep 2009
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why don't you just do FreeDTM(what);?

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    not sure tbh, but the best idea would be to add a variable DTM: Integer; then simply go

    SCAR Code:
    DTM := LoadDTM(whatDTM);
    FreeDTM(DTM);
    “Ignorance, the root and the stem of every evil.”

  4. #4
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Not possible. the FreeDTM frees a new DTM made with the LoadDTM, while the DTM you used in FindDTM is still in memory

  5. #5
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    Not possible. the FreeDTM frees a new DTM made with the LoadDTM, while the DTM you used in FindDTM is still in memory
    Confusing...

    Simple:
    The DTM resulted is never stored so you cant free it.

  6. #6
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok, thanks i will simply use a variable to store it then.

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
  •