Sign in to follow this  
Followers 0
implite

If not this color then...

6 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

can I do?

if not $life = 0x890000 then gleave()

is this possible?

Share this post


Link to post
Share on other sites

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

If Not $life = "0x890000" Then

Gleave()

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

cool.

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