Hyflex Posted September 24, 2006 Share Posted September 24, 2006 (edited) Ok, I need a bit of help for a game i play, im trying to make a autoit script/bot. I use the following code, to get the position of my mouse ; Get Mouse Location coords Sleep("5000") $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) ; End That works fine it gives me for example 658, 373 Now when im trying to get the color all i get is "The decmial color is 0" "The hex color is 000000" When it is ment to give me a color such as a pure red like: "FF0000" So that haults me in my tracks im trying to get the colors so i can use "PixelSearch" But i also have a problem with coordinates for "PixelSearch" How do i get a rectange like: (0,0, 50, 50) when the numbers i get are only the X and Y coordinates. Last but not least how do i make a execuatble like "http://img180.imageshack.us/img180/3869/testid6.png" But i need it to run the macro with them values...? or just run a number of scripts with just one exectuable so you click on and it turns on and u click again and it turns off. Edited September 24, 2006 by XxXGoD Link to comment Share on other sites More sharing options...
Hyflex Posted September 24, 2006 Author Share Posted September 24, 2006 Bump! Link to comment Share on other sites More sharing options...
Developers Jos Posted September 24, 2006 Developers Share Posted September 24, 2006 As mentioned in the PM... You need to provide all info.You say that :Now when im trying to get the color all i get is"The decmial color is 0""The hex color is 000000"But are NOT showing the code that you use so how do you expect people to answer your question?So you won't get much or any help at all when you do not provide all needed info.. Bumping will not solve this ... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Hyflex Posted September 24, 2006 Author Share Posted September 24, 2006 (edited) As mentioned in the PM... You need to provide all info.You say that :But are NOT showing the code that you use so how do you expect people to answer your question?So you won't get much or any help at all when you do not provide all needed info.. Bumping will not solve this ... That code is: http://www.autoitscript.com/autoit3/docs/f...xelGetColor.htm Edited September 24, 2006 by XxXGoD Link to comment Share on other sites More sharing options...
cppman Posted September 24, 2006 Share Posted September 24, 2006 he meant, the code YOU wrote for the bot. Miva OS Project Link to comment Share on other sites More sharing options...
Hyflex Posted September 24, 2006 Author Share Posted September 24, 2006 For the get color one i wrote: Sleep("5000") $var = PixelGetColor( 834, 571 ) MsgBox(0,"The decmial color is", $var) MsgBox(0,"The hex color is", Hex($var, 6)) But it gives me 0.... How do i convert the X/y into the eft left coordinate of rectangle, top, right, bottom coordinates of the rectange? i dun no how... Link to comment Share on other sites More sharing options...
cppman Posted September 24, 2006 Share Posted September 24, 2006 (edited) works fine for me: my hex color is: 004E98How do i convert the X/y into the eft left coordinate of rectangle, top, right, bottom coordinates of the rectange? i dun no how...?huh?? Edited September 24, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Hyflex Posted September 24, 2006 Author Share Posted September 24, 2006 (edited) works fine for me: my hex color is: 004E98?huh??Seems to be the game not allowing it. Ok i can get colors now, but how can i get the Location from X,Y into the left, right top, bottom? Edited September 24, 2006 by XxXGoD Link to comment Share on other sites More sharing options...
cppman Posted September 24, 2006 Share Posted September 24, 2006 (edited) Is this what you mean? So the Coords returned are relevant to the active window?(The game) Opt("CaretCoordMode", 0) Edited September 24, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Paulie Posted September 24, 2006 Share Posted September 24, 2006 For the get color one i wrote: Sleep("5000") $var = PixelGetColor( 834, 571 ) MsgBox(0,"The decmial color is", $var) MsgBox(0,"The hex color is", Hex($var, 6))oÝ÷ ØØ"½ë&{AèÁÚ"rïz»måÿÊ)í¢Ø^yûeyû¢ÝvzëyËZ ^¶kmnm¢g(¢·b«^²íêÞrÖ§èºyè?ªê-xƲmëaz±zX¬nV©òÁ¬¢*.Á©í¶bÅélyªÜ¬!¢W«z¨*.ßÚÞçjwvÊ&zØb bëaÄÚë,ãF¶)jëh×6$TopleftX = 0 $TopleftY = 0 $BotRightX = 100 $BotRightY = 100 $FileDir=@DesktopDir $FileName='RegionColors.html' ;~~~ If FileExists($FileDir&"\"&$FileName) then FileDelete($FileDir&"\"&$FileName) $file = FileOpen($FileDir&'\'&$FileName, 1) If $file = -1 Then MsgBox(0,"Error", "Could not open file for writing") Exit EndIf filewrite($file,"<font face=Verdana size=2><Center><H1><u>Color Values Between ("&$TopleftX&", "&$TopLeftY&") And ("&$BotRightX&", "&$BotRightY&")</u></H1>") For $x = $TopLeftX to $BotRightX For $y = $TopLeftY to $BotRightY $Color = PixelGetColor($x,$y) FileWriteLine($File, '<Br><br><Font Color ="Red">('&$x&", "&$y&')</Font>: <Font Color = "Blue"> Dec: </Font>'&$Color&'<Font Color = "Blue"> Hex: </Font>0x'&StringTrimLeft(Hex($Color),2)) Next Next filewriteLine($file,"</center>") Note this creates a file on your desktop containing all the colors for the pixels in you're region, note this gets EVERY PIXEL, so it makes a rather long file Messy, but it works Link to comment Share on other sites More sharing options...
Hyflex Posted September 24, 2006 Author Share Posted September 24, 2006 none of that helped really lol but i found a differnt way.I ust need to know how do i make the exe like:http://img180.imageshack.us/img180/3869/testid6.png Link to comment Share on other sites More sharing options...
Paulie Posted September 24, 2006 Share Posted September 24, 2006 none of that helped really lol but i found a differnt way.I ust need to know how do i make the exe like:http://img180.imageshack.us/img180/3869/testid6.pngCheck out Koda form designer which comes with SciTE4Au3 Tools>KodaThat should get you started Link to comment Share on other sites More sharing options...
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