Jump to content
Sign in to follow this  
rylorg

simple PixelGetColor question

Recommended Posts

rylorg

How do I tell it to get the pixel color and if its not the certain color do somthing? Thanks

Share this post


Link to post
Share on other sites
Valuater

maybe...

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused, $Runner
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "Run_myScript")

;;;; Body of program would go here ;;;;
While 1
    
    If $Runner Then
        ToolTip('Script is "Running"', 0, 0)
        For $x = 50 To 70 Step 2
            If PixelGetColor($x, 36) = 6510897 Then
                Send("{PAUSE}")
                ; $runner = 0 ; ?????????
                ExitLoop
            EndIf
        Next
    EndIf
    ToolTip("")
    Sleep(500)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Func Run_myScript()
    ; to stop AND Start your script
    $Runner = Not $Runner
EndFunc   ;==>Run_myScript

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
rylorg

Thanks, but I dont understand how this would work, im making a bot and I need to scan the health bar and if its not green do some stuff. Im still geting the hang of autoit.

Share this post


Link to post
Share on other sites
Zedna

Thanks, but I dont understand how this would work, im making a bot and I need to scan the health bar and if its not green do some stuff. Im still geting the hang of autoit.

RTFM - read the fucking manual

Sorry for these bad words at Christmas days

but this person is typical for RTFM :D

EDIT: quick help: For Help press F1 in Scite :P

Edited by Zedna

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.