Sign in to follow this  
Followers 0
Hyflex

[Request] A Few Problems Need Help.

12 posts in this topic

#1 ·  Posted (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 by XxXGoD

Share this post


Link to post
Share on other sites



Bump!

Share this post


Link to post
Share on other sites

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 ...

:)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by XxXGoD

Share this post


Link to post
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))

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...

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

works fine for me: my hex color is: 004E98

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...

?huh?? Edited by CHRIS95219

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by XxXGoD

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Is this what you mean? So the Coords returned are relevant to the active window?(The game)

Opt("CaretCoordMode", 0)
Edited by CHRIS95219

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Check out Koda form designer which comes with SciTE4Au3 Tools>Koda

That should get you started

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  
Followers 0