mouse functions & color checker & running in background

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

mouse functions & color checker & running in background
  1. Unread #1 - Jan 16, 2008 at 1:35 PM
  2. drewboards77
    Referrals:
    0

    drewboards77 Guest

    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?
     
  3. Unread #2 - Jan 16, 2008 at 2:18 PM
  4. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    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.
     
  5. Unread #3 - Jan 16, 2008 at 4:54 PM
  6. Varreon
    Joined:
    Nov 23, 2007
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0

    Varreon Member

    mouse functions & color checker & running in background

    As for minimizing the window, use FindWindow() and SendMessage()
     
  7. Unread #4 - Jan 17, 2008 at 1:44 PM
  8. drewboards77
    Referrals:
    0

    drewboards77 Guest

    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??
     
  9. Unread #5 - Jan 17, 2008 at 4:23 PM
  10. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    mouse functions & color checker & running in background

    #include <windows.h>
     
  11. Unread #6 - Jan 17, 2008 at 10:33 PM
  12. Serajin
    Referrals:
    0

    Serajin Guest

    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.
     
  13. Unread #7 - Jan 17, 2008 at 10:44 PM
  14. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    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.
     
  15. Unread #8 - Jan 17, 2008 at 10:58 PM
  16. Serajin
    Referrals:
    0

    Serajin Guest

    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
     
  17. Unread #9 - Jan 19, 2008 at 3:26 PM
  18. Serajin
    Referrals:
    0

    Serajin Guest

    mouse functions & color checker & running in background

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

    Thanks
     
  19. Unread #10 - Jan 19, 2008 at 8:10 PM
  20. Varreon
    Joined:
    Nov 23, 2007
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0

    Varreon Member

    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;
     
  21. Unread #11 - Jan 19, 2008 at 9:44 PM
  22. Serajin
    Referrals:
    0

    Serajin Guest

    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 >

Users viewing this thread
1 guest


 
 
Adblock breaks this site