Jump to content

how to get...


Recommended Posts

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.

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

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

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

MsgBox(0, "", "Color found @ 500,500 "&$color)

Edited by Aceguy
Link to comment
Share on other sites

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

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