Sign in to follow this  
Followers 0
go0b3r

send u a alert?

6 posts in this topic

ok i know how to use the pixle search, but how can i get it to when a color shows up in the area given, it'll make a sound, or maybe open a msg box?

this is as far as i got.

$color = PixelSearch( 223, 514, 562, 606, 0x84EFF7)

i started the

While

IF

send

wend

but i dont know what id put after IF, i want it to make it so that if the color is there, to send a msg box, or possibly a sound. help plz

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

While 1
sleep(10)
$color = PixelSearch( 223, 514, 562, 606, 0x84EFF7)
if @error then continueloop
msgbox(0,'',"Color Found at X:" & $color[0] & " Y:" & $color[1])
WEnd

that should work... i think

~cdkid

Edited by cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

give this a try

find a color... get a color... get mouse position... check if color has changed with a message box

;*********** Use **************
; Press Esc to terminate script
; Press F8 to open a color dialog box and choose a color
; Or
; Press F9 to get the color under the mouse pointer
; Then press F7 to watch for color change
;
; by Valuater...... Enjoy!!!  
;******************************
#include <GuiConstants.au3>
#include <Misc.au3>
Global $var, $Color_win, $pos, $my_color, $check

HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "Get_Color") 
HotKeySet("{F8}", "Color_Box")
HotKeySet("{F7}", "Check_Color") 

ToolTip('Get Color - is Running',0,0)
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func Color_Box()
    $var = _ChooseColor (2)
    $pos = MouseGetPos()
    Show_Color()
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func Get_Color()
    $pos = MouseGetPos()
    $Svar = PixelGetColor(  $pos[0] , $pos[1])
    $var = "0x" & Hex($Svar,6)
    Show_Color()
EndFunc
Func Show_Color()
    GUIDelete($Color_win)
    ClipPut($var)
    $my_color = $var
    $Color_win = GUICreate("RGB Color = " & $var, 290, 150, -1, -1)
    GUISetBkColor($var)
    GUISetFont(9, 400, -1, "MS Sans Serif")
    GUICtrlCreateLabel(" This Color has been Copied to the ClipBoard  " & @CRLF & @CRLF & "  Just Paste it wherever you would like"& @CRLF & @CRLF & @CRLF & " Mouse position X=" & $pos[0] & "  Y=" & $pos[1]   , 10, 10, 270, 100)
    GUICtrlSetFont(-1, 9, 650)
    If $var = 0x000000 Then GUICtrlSetColor( -1, 0xFFFFFF) 
    $OK_Btn = GUICtrlCreateButton("&OK", 100, 110, 80, 30)
    GUISetState()
    While 2
        $msg1 = GUIGetMsg()
        If $msg1 = $OK_Btn Or $msg1 = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete($Color_win)   
EndFunc
Func Check_Color()
    $check = NOT $Check
    If $check Then ToolTip('Get Color - is Checking Color',0,0)
    While $check
        $var2 = PixelGetColor(  $pos[0] , $pos[1])
        If $my_color <> $var2 Then
            MsgBox(262208, "Color Check", " the Color has changed   ")
            ExitLoop
        EndIf
    WEnd
    ToolTip('Get Color - is Running',0,0)
EndFunc

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ty, i tried the first one, but 1 morething, id like it do it would only do it like 1 time, and how can i make this run if the game is minimized?

Edited by go0b3r

Share this post


Link to post
Share on other sites

ty, i tried the first one, but 1 morething, id like it do it would only do it like 1 time, and how can i make this run if the game is minimized?

PixelGetColor/PixelCheckSum/PixelSearch do not work on minimized windows, the window must have focus.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

PixelGetColor/PixelCheckSum/PixelSearch do not work on minimized windows, the window must have focus.

dang i was afraid of that lol. well now this whole thing does me no good :) ty for tring though.

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