Jump to content

Recommended Posts

Posted (edited)

Im trying to make a simple chicken for if my life gets to low leave game. (diablo2)

so im trying to do if not this color then goto my leave function.

Any helpful tips would be nice.

Thanks

$life = PixelSearch(53,540,65,547,0x890000,50)
      if not $life = 0x890000 then    
Gleave()    
EndIf
Edited by implite
Posted

Im trying to make a simple chicken for if my life gets to low leave game. (diablo2)

so im trying to do if not this color then goto my leave function.

Any helpful tips would be nice.

Thanks

$life = PixelSearch(53,540,65,547,0x890000,50)
      if not $life = 0x890000 then    
Gleave()    
EndIf

Hi,

just a little look in helpfile PixelSearch:

Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y)

Failure: Sets @error to 1 if color is not found.

This should give a massive hint, how to change the if statement.

;-))

Stefan

Posted (edited)

Hi,

just a little look in helpfile PixelSearch:

Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y)

Failure: Sets @error to 1 if color is not found.

This should give a massive hint, how to change the if statement.

;-))

Stefan

I know how to use pixelsearch. I dont know how to use if not statements on here or true false tables, any examples please? Edited by implite
Posted

I know how to use pixelsearch. I dont know how to use if not statements on here or true false tables, any examples please?

The solution is still in helpfile:

change:

if not $life = 0x890000 then ; PixelSearch doesn't return a color value

to

If @error Then ; Failure: Sets @error to 1 if color is not found

or

If Not IsArray ($life) ; Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y)

;-))

Stefan

Posted

$life = PixelSearch(53,540,65,547,0x890000,25)

If Not $life = "0x890000" Then

Gleave()

Solved my own problem, lol forgot the "quotes"...

cool.

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