Adblock breaks this site

mouse functions & color checker & running in background

Discussion in 'Programming General' started by drewboards77, Jan 16, 2008.

  1. drewboards77

    drewboards77 Guest

    Referrals:
    0
    mouse functions & color checker & running in background

    i am relatively skilled at C programming but not at making scripts for rs. i know how functions work and how to run programs and am simply looking for the simple necessary functions to create auto programs for rs. heres a list of functions i would like to find:
    1. moving mouse to coordinates, clicking at certain times, etc
    2. finding what color the mouse is currently on, searching for a color in the screen
    3. being able to minimize the program, making rs the "current open window" and still having the program run in the background. if you invoke a color checking function or a click, do you need to tell it to use the rs screen or can you just have it run normally?
     
  2. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    mouse functions & color checker & running in background

    Use mouse_event for mouse clicks/moving and GetPixel to determine whether or not a certain color is present.

    http://colorcop.net/download <- that helps when finding colors.
     
  3. Varreon

    Varreon Member

    Joined:
    Nov 23, 2007
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0
    mouse functions & color checker & running in background

    As for minimizing the window, use FindWindow() and SendMessage()
     
  4. drewboards77

    drewboards77 Guest

    Referrals:
    0
    mouse functions & color checker & running in background

    Thanks for the help,
    Are those all on stdlib.h or stdio.h??
    Anything else I could need or any other recommended functions??
     
  5. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    mouse functions & color checker & running in background

    #include <windows.h>
     
  6. Serajin

    Serajin Guest

    Referrals:
    0
    mouse functions & color checker & running in background

    Hi, I am attempting a similar program. I have successully been able to navigate my mouse to any coordinate i choose on my screen. However when i attempt to gather color information i am using this.

    GetPixel(NULL, 3901, 15604)

    However, every attempt, at changing any numbers, has resulted in this number.

    4294967295

    Any one have any idea what it is? Im working it out by writing 1 program to move a mouse, then another program to evaluate pixels and give back the RGB value. And when that rgb value has been found, grab the X and Y coordinates and move the mouse there. However the RGB values arent working.

    Thanks for the help.
     
  7. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    mouse functions & color checker & running in background

    The x and y coords are screen coordinates of the color. Unless you're using a 3901x15604 secreen resolution, that won't work at all.

    Correct usage:
    int color = GetPixel(GetDC(NULL),screenxcoord,screenycoord);

    The color value will be stored in color.
     
  8. Serajin

    Serajin Guest

    Referrals:
    0
    mouse functions & color checker & running in background

    Ok, scrap what i said earlier, you probably didnt see it. However i have managed to gather colors from coordinates that i give in. However they're comming out in numbers that im not sure what they are. they dont see like they're just 0x00rrggbb, or rrggbb, or some sort of hex number. they're numbers like.



    3955356 at 200x200
    62207 at 200x500
    also at 200x600 and 200x700


    However, 200x0 gives me the number 9934739

    Thats too many numbers to be a hex.

    Any clue what format this is in so i can break it up into something useable?

    Thanks for the help
     
  9. Serajin

    Serajin Guest

    Referrals:
    0
    mouse functions & color checker & running in background

    Anyone know how i can fix this or get the correct color information?

    Thanks
     
  10. Varreon

    Varreon Member

    Joined:
    Nov 23, 2007
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0
    mouse functions & color checker & running in background

    COLORREF x=GetPixel(GetDC(0),100,100);
    cout<<"Red Value: "<<GetRValue(x)<<endl;
    cout<<"Green Value: "<<GetGValue(x)<<endl;
    cout<<"Blue Value: "<<GetBValue(x)<<endl;
     
  11. Serajin

    Serajin Guest

    Referrals:
    0
    mouse functions & color checker & running in background

    I put that in there isntead of what i had. and i get this

    6332377
    Red Value: &#9496;
    Green Value: Æ’
    Blue Value: `

    as my output. Im not sure those are workable values =)

    Thanks for all your help =D
     
< help a noob... | [source]FindColorSpiral >


 
 
Adblock breaks this site