this should do it
$cargocheck = PixelGetColor( 1629 , 896 )
$cargofullmin = 12000000
$cargofullmax = 12999999
$cargoemptymin = 6700000
$cargofullmax = 6999999
If $cargocheck > $cargoemptymin and $cargocheck < $cargoemptymax then
MsgBox(0,"Cargohold Status","empty.")
elseif $cargocheck > $cargofullmin and $cargocheck < $cargofullmax
then
Msgbox(0,"Cargohold Status","full.")
ElseIf $cargocheck < $cargofullmin or $cargocheck > $cargofullmax or
($cargocheck > $cargofullmax and $cargocheck < $cargoemptymin) then
msgbox(0,"WTF?", $cargo)
EndIf
On 5 Nov, 21:20, Gotrek65 <[EMAIL PROTECTED]> wrote:
> Or can I do it like this(if it is possible for a if statement to check
> a range of numbers in a variable without typing them all out):
>
> $cargocheck = PixelGetColor( 1629 , 896 )
> $cargofull = 12000000-12999999
> $cargoempty = 6700000-6999999
>
> If $cargocheck = $cargoempty then
> MsgBox(0,"Cargohold Status","empty.")
> elseif $cargocheck = $cargofull then
> Msgbox(0,"Cargohold Status","full.")
> ElseIf $cargocheck <> $cargofull or $cargofull then
> msgbox(0,"WTF?", $cargo)
> EndIf
>
> On Nov 5, 2:01 pm, Gotrek65 <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm not sure how to even begin to do that because this getpixelcolor
> > command is very new to me(as in i just found out about it last night)
>
> > On Nov 5, 6:50 am, Glenn <[EMAIL PROTECTED]> wrote:
>
> > > First of all, I'd highly recommend defining constants for you numerical
> > > values that you are testing against. It makes it easier if you ever
> > > change
> > > those values and also prevents against typos if you use those values
> > > elsewhere in your code.
>
> > > Secondly, try a case statement. Do the processing you want if it equals
> > > the
> > > desired values, then utilize a "default" case which will contain the
> > > processing if it doesn't equal any of your desired values.
>
> > > ...Glenn
>
> > > On Wed, Nov 5, 2008 at 3:15 AM, Gotrek65 <[EMAIL PROTECTED]> wrote:
>
> > > > I'm experimenting with a program called AutoIT and the language is
> > > > very similar to VB.net which I've taken several classes about.
> > > > I'm trying to incorporate a decimal PixelGetColor result with a if
> > > > then statement. Heres what I have so far.
>
> > > > sleep(2000)
> > > > $cargo = PixelGetColor( 1629 , 896 )
> > > > If $cargo = 6981005 then
> > > > MsgBox(0,"Cargohold Status","empty.")
> > > > elseif $cargo =12549944 then
> > > > Msgbox(0,"Cargohold Status","full.")
> > > > ElseIf $cargo <> 12549944 or 6981005 then
> > > > msgbox(0,"WTF?", $cargo)
> > > > EndIf
>
> > > > There are only two general colors that should show on this pixel an
> > > > orangeish color or silver/white but through out the macro the shading
> > > > of the pixel changes.
>
> > > > I'm not sure how to do a "Elseif $cargo doesn't=12549944 or 6981005
> > > > then" or Is there a way to do a "Elseif $cargo = 12000000-12999999
> > > > then"
>
> > > > Thanks- Hide quoted text -
>
> - Show quoted text -