Jump to content

[Request] A Few Problems Need Help.


Hyflex
 Share

Recommended Posts

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 by XxXGoD
Link to comment
Share on other sites

  • Developers

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

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 by XxXGoD
Link to comment
Share on other sites

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û¢Ýv­zë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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...