Jump to content

Recommended Posts

Posted

If pixel search see 0x5C0000 or 0x18480C , It will sleep wait 2secondes....

Something like that but it has to work xD! :

$Life = 0x5C0000 , 0x18480C

PixelSearch( 735, 585 , 735, 585 ,$life )
  If Not @Error Then 
  Sleep (2000)
 Endif
Posted

$Life = PixelGetColor(735, 585)
If $Life = 0x5C0000 Or $Life = 0x18480C Then
  _somefunction()
Else 
  Sleep (2000)
Endif

How can i do / If @Error / If it doesnt get the color

$Life = PixelGetColor(735, 585)
If $Life = 0x5C0000 Or $Life = 0x18480C [b]@error[/b] Then
  _somefunction()
Else 
  Sleep (2000)
Endif

I Have tried to add "@error" and it does not work too

Posted

You just have to use your first code but have say life2 as the second colour, as pixelgetcolor does not set @error according to helpfile, and you cannot declare a variable with two values as far as I know

$Life = 0x5C0000

$life2 = 0x18480C

PixelSearch( 735, 585 , 735, 585 ,$life )

If Not @Error Then

Sleep (2000)

Else

PixelSearch( 735, 585 , 735, 585 ,$life2 )

If Not @Error Then

Sleep (2000)

Endif

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

$Life = "0x" & Hex(PixelGetColor(735, 585), 6)

If $Life = 0x5C0000 Or $Life = 0x18480C Then
    Sleep(2000)
Else
    _DoSomethingElse()
EndIf

:D

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...