Results 1 to 4 of 4

Thread: Check Client Targeted?

  1. #1
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default Check Client Targeted?

    Is there a way to check if the user has targeted the client? Would be nice to check and gracefully exit if no client targeted.

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    If you use SMART then it will automatically be targeted. I dont know why you wouldnt be using it for an rs script. Maybe for something else? If so, you could check for a colour that will always be there, because the coords will be different if the right client isn't targeted.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    procedure FindWindow(Title: string);
    Finds Client window with specified title. Character case of Title must match that in window title exactly.


    I believe you are looking for. Maybe FindWindowBySize could be used too.

    Here is a list of all the client control functions though:

    SCAR Code:
    procedure FindWindow(Title: string);
    Finds Client window with specified title. Character case of Title must match that in window title exactly.

    function FindWindowTitlePart(Title: string; CaseSensitive: Boolean): Boolean;
    Finds window that contains text specified by Title parameter in window caption.

    function FindWindowBySize(Width, Height: Integer): Boolean;
    Finds window with specified size.

    procedure ActivateClient;
    Activate client window.

    function GetClientWindowHandle: Integer;
    Get Windows handle value of active client window.

    procedure SetClientWindowHandle(H: Integer);
    Set active client window to handle H.
    Example:
    H:= GetClientWindowHandle;
    //specify another client window
    FindWindow('Debug Image');
    ...
    //return to previous client
    SetClientWindowHandle(H);

    procedure SetDesktopAsClient;
    Sets the desktop (default window) as selected client.

    procedure SetTargetBitmap(bitmap: Integer);
    Sets bitmap as target for all color/bitmap searching functions. After calling SetTargetBitmap all functions won't be working with client but with specified bitmap.
    Example:
    SetTargetBitmap(flagstaff);
    if(FindColor(x, y, $000066, 0, 0, 3, 2))then
     ...
    The sample above will not search on client screen but in bitmap "flagstaff" instead.

    procedure GetClientDimensions(var Width, Height: Integer);
    Get client width and height.

    procedure CopyClientToBitmap(bitmap: Integer; xs, ys, xe, ye: Integer);
    Copy client screen part to bitmap specified.

    procedure SetTargetDc(Dc: HDC);
    Sets and external device context as target for SCAR'
    s colorfinding functions.

    function GetTargetDC: HDC;
    Returns the DC of the currently selected window/bitmap.

    procedure ResetDc;
    Sets the device context of SCAR's selected window as target for SCAR's colorfinding functions.

    function GetBitmapDc(Bmp: Integer): HDC;
    Returns the device contect of the entered bitmap.
    Last edited by JAD; 08-28-2009 at 08:07 AM.

  4. #4
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    K. Thanks.

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
  •