Results 1 to 1 of 1

Thread: minimap.waitFindSymbol() and minimap.waitFindSymbols()

  1. #1
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default minimap.waitFindSymbol() and minimap.waitFindSymbols()

    Made these to aid me in waiting to move to a new location where the loading screen doesn't activate. For example if you're going up and down stairs, the loading screen won't always show up so I use these to look for the new symbols to tell if I'm there or not.

    Hope someone else can get some use out of them.

    example usage:
    Simba Code:
    if (minimap.waitFindSymbol(MM_SYMBOL_BANK, 5000)) then
      writeln('We found the bank!');

    if (minimap.waitFindSymbols([MM_SYMBOL_TREE, MM_SYMBOL_MINING], 5000)) then
      wrieln('We found the mining and tree symbols!');


    Simba Code:
    //By: HKbotz
    function TRSMinimap.waitFindSymbol(symbol, waitTime: integer): boolean;
    var
      p: TPoint;
      timer: TTimeMarker;
      sym: _TRSSymbol;
    begin
      result := false;

      sym := self._getSymbol(symbol);
      timer.start();
      repeat
        if (self.findSymbol(p, symbol, self.getBounds())) then
        begin
          print('Found ' + sym.name + ' symbol.');
          freeBitmap(sym.bmp);
          exit(true);
        end;
      until (timer.getTime() >= waitTime);
      print('Didn''t find ' + sym.name + ' symbol.');
      freeBitmap(sym.bmp);
    end;

    //By: HKbotz
    function TRSMinimap.waitFindSymbols(symbols: TIntegerArray; waitTime: integer; findOne: boolean = false): boolean;
    var
      found: TFoundSymbols;
      timer: TTimeMarker;
    begin
      result := false;

      timer.start();
      repeat
        if (self.findSymbols(symbols, self.getBounds(), found, findOne)) then
        begin
          print('We found all the symbols we are looking for.');
          exit(true);
        end;
      until (timer.getTime() >= waitTime);
      print('We didn''t find the symbols we are looking for.');
    end;
    Last edited by HKbotz; 01-26-2015 at 05:17 AM. Reason: Fixed waitFindSymbol() to prevent memory leak.

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
  •