Results 1 to 5 of 5

Thread: Broken Waitfunction? Or am I using it incorrectly?

  1. #1
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default Broken Waitfunction? Or am I using it incorrectly?

    Simba Code:
    Error: Exception: The given DTM Index[146] doesn't exist at line 819
    The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

    I get this when using the following code, and I do have the DTM defined withing the procedure so Im not thinking that's the error.

    Simba Code:
    If (FindNPCChatText('cert', Nothing)) Then
                Begin
                  TypeSendEx('1',False);
                  Wait(RandomRange(1005,1050));
                  TypeSendEx('26',True);
                  WaitFindDTM(LogToBurnDTM,x,y,RandomRange(9000,10000));
                End;
    Last edited by Hazzah; 04-01-2012 at 03:29 AM.

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Waiting has nothing to do with it.. I don't see you freeing the DTM anywhere in the above code.. You declare a DTM, then you have to free it when it's not going to be used.


    Simba Code:
    var
       Meh: Integer;
    begin
       Meh:=  DtmFromString('fdsgadsgsdgwsgsdhgsdghsdfhgsd');
       
       if (WaitFindDTM(Meh, X, Y, 1000)) then
          //do whatever with X, Y..

       FreeDTM(Meh);
    end;
    I am Ggzz..
    Hackintosher

  3. #3
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Simba Code:
    Function FindButler:Boolean;
    Var
      NotedLogDTM,DButlerDTM,LogToBurnDTM,X,Y,T: Integer;
    Begin
        LogToBurnDTM:= DTMFromString('m1gAAAHic42JgYHBiYmDwAWI/IA6Ess2B2BGIzYDYGohdgZiTkYHhH1A9E5DmAmIBIBYCYhEgZgdiBqi8ux4XSBUGNlBQQOH/ZyAOMBKJEQAARvoHJA==');
        NotedLogDTM := DTMFromString('mAAEAAHic42FgYOAFYhYgZmaAABDNBsTcQMwPxCJALArEwlDMClUH0sMJVccLxTxQPgdUnhGInbRBqpiIxv8ZSAOMJGJkAACCbgKF');
        DButlerDTM := DTMFromString('mQwAAAHicY2ZgYNBkhGAtIJ4O5C8E4pVAbCLGz7B6yWKG8qIiBn4gH4YZkTAQAADyswY6');
          if FindDTM(NotedLogDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
            begin
              Mouse(x,y,0,0,true);
              Wait(RandomRange(800,1000));
            end;
          If FindDTMRotated(DButlerDTM,X,Y,MSX1,MSY1,MSX2,MSY2,-Pi,Pi,Pi/30,aFound) Then
        Begin
          Mouse(X,Y,2,4,true);
            Begin
              MarkTime(T);
              Repeat
                Wait(Random(200));
              Until ((FindNPCChatText('coins',Nothing)) Or (FindNPCChatText('cert', Nothing)) Or (TimeFromMark(T) > 8000));
              If (FindNPCChatText('coins',Nothing)) Then
                Begin
                  ClickContinue(True, True);
                  TypeSendEx('1',False);
                  Wait(RandomRange(800,1000));
                  TypeSendEx('0', False);
                  Wait(randomRange(900, 1100));
                End;
              If (FindNPCChatText('cert', Nothing)) Then
                Begin
                  TypeSendEx('1',False);
                  Wait(RandomRange(1005,1050));
                  TypeSendEx('26',True);
                  WaitFindDTM(LogToBurnDTM,x,y,RandomRange(9000,10000));
                End;
            End;
        End;
         FreeDTM(DButlerDtm);
         FreeDTM(NotedLogDTM);
         FreeDTM(LogToBurnDTM);
    End;
    The DTM is being freed so I dont think that is the case.

    Simba Code:
    Error: Exception: The given DTM Index[152] doesn't exist at line 819
    The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

    and it pops open the timing code and says there is an error
    Simba Code:
    (*
    WaitColorGoneIn
    ~~~~~~~~~~~~~~~

    .. code-block:: pascal

        function WaitColorGoneIn(Colour, x1, y1, x2, y2, Tol, MaxTime: integer): Boolean;

    Waits until a colour is gone in an area with tolerance and a timeout.
    Results true if the colour disappeared in the area within the time cap.

    .. note::

      by TRiLeZ

    Example:

    .. code-block:: pascal

    *)

    function WaitColorGoneIn(Colour, x1, y1, x2, y2, Tol, MaxTime: integer): Boolean;
    var
      Time, CX, CY: Integer;
    begin
      Result := False;
      if Tol = 0 then Tol := 1;
      Time := GetSystemTime + MaxTime;
      while (Time > GetSystemTime) do
      begin
        if (not FindColorTolerance(cx, cy, Colour, x1, y1, x2, y2, Tol)) then
        begin
          Result := True;
          Exit;
        end;
        Wait(10);
      end;
    end;

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Your probably terminating the script before the function even frees it then.. OR you have other DTM's overlapping and not being freed.. Those are the only explanations.
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Feb 2012
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Wait(1050+random(1050));
    <--This is how I use the wait function, but that error does not have to do with the wait.

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
  •