Results 1 to 5 of 5

Thread: BitMap help

  1. #1
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default BitMap help

    Simba Code:
    function FindDot: Boolean;           //change to spiral or something
    begin
      Dot := BitmapFromString(9, 7, 'meJy7c0X4DiGkq/efgfE/VnFxCZAU' +
            'A8MXNCmQIFicgeEWmhQjAxDcYmA4DGRgmgkUxCqOFQEAHABfEw==');
     FindBitmapSpiralTolerance(Dot, x, y, 569, 93, 676,184, 15);
        DeBugBitMap(Dot);
        HumanMMouse(x, y, 2, 2);
        ClickMouse2(True);
        if DeBug then Writeln('Found dots, flag present');
          if WaitNotMoving(false) then
            repeat
              if DeBug then Writeln('Still Moving');
                Wait(500 +Random(750));
            until(WaitNotMoving(true) or not FlagPresent);
            if DeBug then Writeln('Not moving, should be on dot');
        Result := True;
        FreeBitMap(Dot);
        Exit;
    end;

    Everytime I try to run this my mouse just goes to the top left corner of RS.
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

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

    Default

    It's probably not finding the bitmap, so it's moving the mouse to position 0,0. Try changing it to this:

    Simba Code:
    function FindDot: Boolean;           //change to spiral or something
    begin
      Dot := BitmapFromString(9, 7, 'meJy7c0X4DiGkq/efgfE/VnFxCZAU' +
            'A8MXNCmQIFicgeEWmhQjAxDcYmA4DGRgmgkUxCqOFQEAHABfEw==');
      if FindBitmapSpiralTolerance(Dot, x, y, 569, 93, 676,184, 15) then
      begin
        DeBugBitMap(Dot);
        HumanMMouse(x, y, 2, 2);
        ClickMouse2(True);
        if DeBug then Writeln('Found dots, flag present');
        if WaitNotMoving(false) then
          repeat
          if DeBug then Writeln('Still Moving');
          Wait(500 +Random(750));
          until(WaitNotMoving(true) or not FlagPresent);
        if DeBug then Writeln('Not moving, should be on dot');
        Result := True;
        FreeBitMap(Dot);
      end;
    end;

    Edit: Fixed the formatting.

  3. #3
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Could also do something like this to test if you can find the bitmap or not!

    Simba Code:
    function foo(): boolean;
    var
      dot, x, y: integer;
    begin
      Dot := BitmapFromString(9, 7, 'meJy7c0X4DiGkq/efgfE/VnFxCZAU' +
            'A8MXNCmQIFicgeEWmhQjAxDcYmA4DGRgmgkUxCqOFQEAHABfEw==');

      result := findBitmapSpiralTolerance(Dot, x, y, 569, 93, 676, 184, 30);

      if (result) then
        writeln('-- We found the bitmap @ ' + toStr(point(x, y)))
      else
        writeln('-- Failed to find the bitmap!');

       freeBitmap(dot);
     end;

  4. #4
    Join Date
    Jun 2007
    Posts
    532
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Tried both and they still only work maybe 25 percent of the time. I am gonna need a back up, but not sure how to make it work. I have tired TPAs for the red dots on the MM but it never seems to work for me. Colors always change.

    I use this in my script

    Simba Code:
    WriteLn(ToStr(CountDots('red')) + ' Red dots present on Minimap.');

    It is always correct in giving me the number of red dots on the MM, anyway to take that and make it click them?
    Finished B.S. Program in Radiology!!

    Projects: A big one! Total secret! hehe

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

    Default

    Oh, yeah. Just use GetMiniMapDots('red'), which returns a TPA containing all the red dots. CountDots actually just calls Length on the result of GetMiniMapDots.

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
  •