lasse46 Posted August 27, 2006 Posted August 27, 2006 is it possible to script : when i hold the mouse over a 0x9ECBFF it makes a mouseclick? thanks for any help
PsaltyDS Posted August 27, 2006 Posted August 27, 2006 is it possible to script :when i hold the mouse over a 0x9ECBFF it makes a mouseclick?thanks for any help You want a loop that continuously reads the mouse position with MouseGetPos(), reads the pixel color at that position with PixelGetColor(), and clicks on a match with MouseClick().Give a shot and post your code if you need more help! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Azu Posted August 27, 2006 Posted August 27, 2006 while 1 $pos=mousegetpos() if pixelgetcolor($pos[0],$pos[1])=10406911 then mouseclick("left",$pos[0],$pos[1],1,0) sleep(10) wend
micor Posted August 28, 2006 Posted August 28, 2006 10406911 is the decimal value for 0x9ECBFF. Use windows calc in scientific mode.
Paulie Posted August 28, 2006 Posted August 28, 2006 10406911 is the decimal value for 0x9ECBFF. Use windows calc in scientific mode.or, you could say $HexVaue = "0x"&StringTrimLeft(Hex($DecimalValue),2)
Moderators SmOke_N Posted August 28, 2006 Moderators Posted August 28, 2006 or, you could say $HexVaue = "0x"&StringTrimLeft(Hex($DecimalValue),2) oÝ÷ Ûú®¢×®;¬¶z-©z÷«ÊØb(v'ßË¥µ«-¯(§ÚyÈ©êÝyȦj[ììZºÚ"µÍÓÜ ÌÎNÔ^[ÛÛÜ[ÙIÌÎNËHÈÜ[Û[ÜÛY[ÛÛÜÂÓÜ ÌÎNÓ[ÝÙPÛÛÜ[ÙIÌÎNËHÈÜ[Û[ÜÛY[ÛÛÜÂÚ[HBIÌÍÜÜÈH[ÝÙQÙ]ÜÊ BRY ^[Ù]ÛÛÜ ÌÍÜÜÖÌK ÌÍÜÜÖÌWJHOHQPÐH[[ÝÙPÛXÚÊ ][ÝÛY ][ÝË ÌÍÜÜÖÌK ÌÍÜÜÖÌWKK BTÛY L BÑ[Brackets around it and a double = for exact match will help here. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Paulie Posted August 28, 2006 Posted August 28, 2006 (edited) Or just not make everything so difficult as trying to decipher decimal vs hex;Opt('PixelCoordMode', 2) ; Optional for client coords ;Opt('MouseCoordMode', 2) ; Optional for client coords While 1 $pos = MouseGetPos() If (PixelGetColor($pos[0],$pos[1]) == 0x9ECBFF) Then MouseClick("left", $pos[0], $pos[1], 1, 0) Sleep(10) WEndBrackets around it and a double = for exact match will help here. How can that work PixelGetColor returns decimal values, so comparing to hex can't work PixelGetColor Returns a pixel color according to x,y pixel coordinates. PixelGetColor ( x , y ) Parameters x x coordinate of pixel. y y coordinate of pixel. Return Value Success: Returns decimal value of pixel's color. Edited August 28, 2006 by Paulie
Moderators SmOke_N Posted August 28, 2006 Moderators Posted August 28, 2006 How can that work PixelGetColor returns decimal values, so comparing to hex can't workYou should really search things or test them before you post such a thing... That's like saying that MsgBox(64, 'Info', 0xFF0000)Should show the hex value, and not the decimal... but if you run it, what do you get? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Paulie Posted August 28, 2006 Posted August 28, 2006 You should really search things or test them before you post such a thing... That's like saying that MsgBox(64, 'Info', 0xFF0000)Should show the hex value, and not the decimal... but if you run it, what do you get?lol, well thats news to me thats one shortcut i didn't know about :"> sorry :"> :">
lasse46 Posted August 28, 2006 Author Posted August 28, 2006 Thanks alot! but if i want 5 colors similar to 10406911.. how do i write then? if pixelgetcolor($pos[0],$pos[1])=10406911, 5 then ???
Moderators SmOke_N Posted August 28, 2006 Moderators Posted August 28, 2006 Thanks alot! but if i want 5 colors similar to 10406911.. how do i write then? if pixelgetcolor($pos[0],$pos[1])=10406911, 5 then ???You would either put those 5 colors in an array and do a For/Next 1 to 5, or do 5 "If" statements if you are looking for exactly those colors. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
PsaltyDS Posted August 28, 2006 Posted August 28, 2006 Thanks alot! but if i want 5 colors similar to 10406911.. how do i write then? if pixelgetcolor($pos[0],$pos[1])=10406911, 5 then ??? You would use PixelSearch() instead of PixelGetColor() if wanted shade variations (near matches). Check it out in the help file! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Moderators SmOke_N Posted August 28, 2006 Moderators Posted August 28, 2006 Hi, won't the code I posted work? :SIt's not that it won't work Azu, just more work than neccessary, take a look at the example I posted as to why. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now