Jump to content
Sign in to follow this  
frotek

how to get...

Recommended Posts

frotek

how to get this kind of "color code" or whatever it's name is? "0xFF000000"

im a total newbie in autoit sorry. :idea:

when i use photoshop eyedropper tool it gives me "bc1c10" and autoit dont accept it.

Share this post


Link to post
Share on other sites
water

how to get this kind of "color code" or whatever it's name is? "0xFF000000"

im a total newbie in autoit sorry. :idea:

when i use photoshop eyedropper tool it gives me "bc1c10" and autoit dont accept it.

"bc1c10" seems to be the RGB (red, green, blue) color notation with values from 0 to 255 for each color written in hex. bc (hex) means 188 (decimal) for red.

What AutoIt function that requires a color notation do you talk about?

AutoIt since version 3.0.102 uses RGB color format so just use "0xbc1c10" and everything should run fine (I hope).

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
StijnG

I'm not to sure what you are trying to do though..

But try adding two zero's at the beginning, if the color code is bc1c10, make it 00bc1c10.

I've tested it like this:

1) I made a plain in a paint.net with the fixed color bc1c10

2) Read the color with AutoIt and compair it with 00bc1c10 (using the hex() function)

Test script:

$color = PixelGetColor(500, 500) ; fixed pixels for my current computer screen, change these values if necessary


If "00bc1c10" = Hex($color) Then
    MsgBox(48, "", "OK")
Else
    MsgBox(48, "", "NOK")
EndIf
Edited by StijnG

Share this post


Link to post
Share on other sites
frotek

it's actually a flash game and i cant make it work so here

Posted Image

and here's my code

i tried both 322829,00322829 and 0x322829

i cant make it work really :idea:

im using google chrome browser

WinActivate( "Elven Land" )

$Monster = 0x322829

While 1

WEnd

Func MonsterClick()

$x = MouseGetPos( 0 )

$y = MouseGetPos( 1 )

$attack = PixelSearch( 40, 120, 780, 580, $Monster, 5, 0x322829 )

If Not @Error Then

MouseClick( "left", $attack[0], $attack[1], 1, 1 )

MouseMove( $x, $y )

EndIf

EndFunc

Func Terminate()

Exit 0

EndFunc

i tried this code and it gives me NOK result :)

$color = PixelGetColor(500, 500) ; fixed pixels for my current computer screen, change these values if necessary


If "00322829" = Hex($color) Then
    MsgBox(48, "", "OK")
Else
    MsgBox(48, "", "NOK")
EndIf
Edited by frotek

Share this post


Link to post
Share on other sites
frotek

you are stuck in the loop...

While 1

WEnd

will loop forever and do nothing.

then what should i do wit the loop? im confused :idea:

Share this post


Link to post
Share on other sites
frotek

i cant really make it work. i have win7 is there a problem in my OS?

Share this post


Link to post
Share on other sites
Neno

then what should i do wit the loop? im confused :idea:

First off, you really need to learn the basics of scripting before you tackle complex logical procedures.

Secondly, use Au3Info.exe that comes with autoit to get valid hex values (not to say you can't get them elsewhere, just simplifying the process).

Here's my attempt to do what you want:

WinActivate( "Elven Land" )
HotKeySet("{F1}","Terminate")

Global $Monster = 0x322829

While 1
    $pos = MouseGetPos()
    $attack = PixelSearch( 40, 120, 780, 580, $Monster, 15)
    If Not @Error Then
        MouseMove($attack[0],$attack[1],1)
        MouseClick( "left")
        Sleep(20)
        MouseMove($pos[0],$pos[1],1) ; set to 5 for smoothness, set to 1 for instant
        Sleep(500)
        ToolTip("Found Monster!",0,0)
    ElseIf @error Then
        ToolTip("Didn't find Monster!",0,0)
    EndIf
    Sleep (1000)
WEnd

Func Terminate()
    Exit 0
EndFunc
Edited by Neno

Share this post


Link to post
Share on other sites
frotek

WinActivate( "Elven Land" )

HotKeySet("{F1}","Terminate")

Global $Monster = 0x322829

While 1

$pos = MouseGetPos()

$attack = PixelSearch( 40, 120, 780, 580, $Monster, 15)

If Not @Error Then

MouseMove($attack[0],$attack[1],1)

MouseClick( "left")

Sleep(20)

MouseMove($pos[0],$pos[1],1) ; set to 5 for smoothness, set to 1 for instant

Sleep(500)

ToolTip("Found Monster!",0,0)

ElseIf @error Then

ToolTip("Didn't find Monster!",0,0)

EndIf

Sleep (1000)

WEnd

this doesnt work also neno but i already got the idea and my code is now working. thanks a lot! -frotek

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  

×