Jump to content

and/or


Recommended Posts

have 2 questions

1. how do i combine these two into one..

While 1

$var = PixelSearch ( 642, 102, 646, 107, 0x181818 )

If not $var = 1 Then

Send("{o}")

EndIf

Sleep(250)

WEnd

and

While 1

$var = PixelSearch ( 642, 102, 646, 107, 0xAF8840 )

If not $var = 1 Then

Send("{o}")

EndIf

Sleep(250)

WEnd

2. How do i combine 2 independent codes into one file

Link to comment
Share on other sites

I believe this would do it..

While 1
$var1 = PixelSearch ( 642, 102, 646, 107, 0x181818 )
$var2 = PixelSearch ( 642, 102, 646, 107, 0xAF8840 )
If NOT $var1 OR $var2 Then
Send("{o}")
EndIf
Sleep(250)
WEnd
Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

I believe this would do it..

While 1
$var1 = PixelSearch ( 642, 102, 646, 107, 0x181818 )
$var2 = PixelSearch ( 642, 102, 646, 107, 0xAF8840 )
If NOT $var1 OR $var2 Then
Send("{o}")
EndIf
Sleep(250)
WEnd

The boolean logic in your example is not quite correct. It should be

While 1
$var1 = PixelSearch ( 642, 102, 646, 107, 0x181818 )
$var2 = PixelSearch ( 642, 102, 646, 107, 0xAF8840 )
If NOT ($var1 OR $var2) Then
Send("{o}")
EndIf
Sleep(250)
WEnd

Or

While 1
$var1 = PixelSearch ( 642, 102, 646, 107, 0x181818 )
$var2 = PixelSearch ( 642, 102, 646, 107, 0xAF8840 )
If NOT $var1 OR NOT $var2 Then
Send("{o}")
EndIf
Sleep(250)
WEnd

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
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
 Share

  • Recently Browsing   0 members

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