Jump to content
Sign in to follow this  
loki1982

questions hex color:holdkey

Recommended Posts

I just started using autoit last night. I caught on pretty quick and have already made a script using do's, if, pixelgetcolor,send and more.

My questions are first I know that a certain area of my screen will always turn a shade of red and I need that to be the trigger. I know I need to pixelsearch(x,y,shade,shade difference) etc but how do I go about finding out the hex value of the color im looking for. Can I copy the color and put it into aprogram to see what the hex value is? Or could I do somthing like $var= pixelgetcolor(x,y) then send($var) just to get the exact hex I need?

And second question. I know send("x") will send an individual key stroke but what fuction or how do I go about holding the key down?

And third I need to be able to shift and right click mouse at the same time how do I go about doing this?

would this work>

send("shift"+mouseclick("right"))

or

mouseclick("shift+right")

or

send("shift+mouseclick("right")")

Thanks I really appreciate anyone who can give me some help.

Edited by loki1982

Share this post


Link to post
Share on other sites

send("{lshift down}")

mouseclick(<put stuff here>)

send("{lshift up}")

this will hold the left shiift (lshift if u want right shift change to rshift) ten click somewhere and then release the shift...

Edited by Jammer

Share this post


Link to post
Share on other sites

I just started using autoit last night. I caught on pretty quick and have already made a script using do's, if, pixelgetcolor,send and more.

first I know that a certain area of my screen will always turn a shade of red and I need that to be the trigger. I know I need to pixelsearch(x,y,shade,shade difference) etc but how do I go about finding out the hex value of the color im looking for.  Can I copy the color and put it into aprogram to see what the hex value is? Or could I do somthing like $var= pixelgetcolor(x,y) then send($var) just to get the exact hex I need?

And second question. I know send("x") will send an individual key stroke but what fuction or how do I go about holding the key down?

<{POST_SNAPBACK}>

Third's been answered....so's the second. :lmao: but I'll use your "x" key as an example too.

We'll take the easiest one first, and that's the second question.

To hold a key down, try this.

Send("{x down}")
Sleep(3000)
Send("{x up}")

That will hold the lowercase "x" key down for 3 seconds and then release it.

Now to tackle your questions on pixelgetcolor.

Converting to hex is defined in the helpfile with this script:

$var = PixelGetColor( 10 , 100 )
MsgBox(0,"The decmial color is", $var)
MsgBox(0,"The hex color is", Hex($var, 6))

Note the function Hex($var,6). It converts decimals to hexidecimal numbers, and the number tells how many places after the 0x to hold.

If your decimal color was 255, it would return 0x0000FF.

Hope that helps.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...