Results 1 to 4 of 4

Thread: Can't find Bitmap

  1. #1
    Join Date
    Feb 2010
    Location
    England
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Can't find Bitmap

    hey guys,
    so I'm still working on a script of mine but I've came to a halt

    what I'm basically wanting to do is open inv_Magic and then check for my HomeBMP, if it's visible then click it (if I get the message saying that we've already done it then Result is false )

    my bitmap function is..

    SCAR Code:
    function HomeTele: Boolean;
    var
      HomeBMP, x, y: Integer;
    begin
      GameTab(tab_Magic);
     
      HomeBMP := BitmapFromString(7, 9, 'beNpjYFi48Vpl46Ka2KVAVFa' +
           '7ZN66GwwMDEnRxVHuhbVJC4Eo2r0QyAUKhtvWfX33Tc/IC4iADCAX' +
           'KOhrkP7mwWtxfhEgAjKAXKCgk2zkpBmHpiw9AERABpALFLSSiFq67' +
           'iorAy8QARlALlBQl9+ts3WHPLsBEAEZugJuQEEHs0xRBlkXtUwgAj' +
           'JsdDIZsAIA3wk60g=='
      );
     
      if FindBitmapToleranceIn(HomeBMP, x, y, MIX1, MIY1, MIX2, MIY2, 4) then
      begin
        Mouse(x, y, 3, 3, true);
      end else
      begin
        Result := false;
        Exit;
      end;
     
      Wait(RandomRange(750, 1500));

      Result := not FindTextTPA(clBlack, 30,  MCX1, MCY1, MCX2, MCY2, 'ait', SmallChars, Nothing);
      FreeBitmap(HomeBMP);
    end;

    then I composed another method using TPAs:

    SCAR Code:
    function HomeTele: Boolean;
    var
      x, y: Integer;
      TPA: TPointArray;
    begin
      GameTab(inv_Magic);

      FindColorsTolerance(TPA, 10832730, MIX1, MIY1, MIX2, MIY2, 10);
      SortTPAFrom(TPA, Point(MIX1, MIY1));

      MMouse(TPA[0].x, TPA[0].x, 3, 3);

      if WaitUpText('umb', 250) then
      begin
        GetMousePos(x, y);
        Mouse(x, y, 0, 0, true);
      end else
      begin
        Result := false;
        Exit;
      end;

      Wait(RandomRange(750, 1500));

      Result := not FindTextTPA(clBlack, 30,  MCX1, MCY1, MCX2, MCY2, 'ait', SmallChars, Nothing);
    end;

    ... and then I came up with another way using (A)TPAs, so i'm not sure which would be better to use (feedback on which to use would be appreciated!)

    any ways, here's the (A)TPA version, it just checks for a blue-ish color and clicks [0][0]

    SCAR Code:
    function HomeTele: Boolean;
    var
      x, y: Integer;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      GameTab(tab_Magic);

      FindColorsTolerance(TPA, 10832730, MIX1, MIY1, MIX2, MIY2, 10);
      ATPA := TPAToATPAEx(TPA, 20, 20);

      MiddleTPAEx(ATPA[0], x, y);

      MMouse(x, y, 3,3 );

      if WaitUpText('umb', 250) then
      begin
        GetMousePos(x, y);
        Mouse(x, y, 0, 0, true);
      end else
      begin
        Result := false;
        Exit;
      end;

      Wait(RandomRange(750, 1500));
      Result := not FindTextTPA(clBlack, 30,  MCX1, MCY1, MCX2, MCY2, 'ait', SmallChars, Nothing);
    end;

    thanks in advance for anyone that helps

    void_hatred
    Last edited by void_hatred; 02-19-2010 at 10:20 AM.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Instead of a bitmap, try using a color with tolerance. In box where it should be. (The blue color).
    There used to be something meaningful here.

  3. #3
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    It's Probs just you bitmap this works fine for me
    SCAR Code:
    function HomeTele: Boolean;
    var
      HomeBMP, x, y: Integer;
    begin
      //GameTab(tab_Magic);

      HomeBMP := BitmapFromString(5, 7, 'beNo78ujv37+mLsFJvh1A8i8YWFta' +
                 'hdsXAkkIV09TH4KA7E1HHqEhOUl9CIJwJVjlTeQCgCQ6FwBIXjW9');

      if FindBitmapToleranceIn(HomeBMP, x, y, MIX1, MIY1, MIX2, MIY2, 4) then
      begin
        Mouse(x, y, 3, 3, true);
      end else
      begin
        Result := false;
        Exit;
      end;

      Wait(RandomRange(750, 1500));

      Result := not FindTextTPA(clBlack, 30,  MCX1, MCY1, MCX2, MCY2, 'ait', SmallChars, Nothing);
      FreeBitmap(HomeBMP);
    end;
    Commented out the gametab bit cus i ned it was already on the correct gametab

  4. #4
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Well since the symbol never moves, why not just do a GetColor. If the GetColor is right, then MouseBox.
    SCAR Code:
    if (GetColor(234, 432, ColorHere) then
      MouseBox(x1, y1, x2, y2, 1);

    If you wanted more, you could replace MouseBox with a MMouse, followed by an uptext check, etc.

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
  •