Jump to content

IF NOT()


 Share

Recommended Posts

IF NOT($h = 92 OR $ = 2624524) Then

Theres my code, I could not find the *Doesn't Equal* sign for AutoIT, but I saw some code using this, but I don't think its working..

I have tried IF $h !=, but that gives me an error..

Help :whistle:

-BTW, since it is my first post, thank you for making such a GREAT language, it is insanely usefull, and easy to use.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

That doesn't seem to work either, I'll keep trying though.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

Don't forget the second $h

If NOT ($h = 92 OR $h = 2624524) Then

Um, Larry shouldn't that be

If $h <> 92 AND $h <> 2624524 Then

This test works for me:

Let $h = 2624524 ;also try other numbers

If $h <> 92 AND $h <> 2624524 Then
    MsgBox(0,"","first branch")
Else
    MsgBox(0,"","second branch")
EndIf
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

The IF statement is actually 2 variables..

IF $health <> 92 OR $mana <> 2624524 Then

Wrote them out, to make it simpler, heh, In the first post i neglected to include the $m variable, and just put $.

Anyway, thanks for your incrediably fast help, although I still have the problem using the above IF statement

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

Well, I want it to do whats inside the IF when 1 of the 2 events happens, so it should be OR..

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

$health = 92

$mana = 2624524

If $health <> 92 or $mana <> 2624524 then

msgbox(0, "Results", "One or both of the criteria has\have been met")

else

Msgbox(0, "Results", "Health = " & $health & " and Mana = " & $mana)

EndIf

The above worked for me.

How are you setting the $health and $mana variables? :whistle:

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

IF $health <> 92 OR $mana <> 2624524 Then

            $CheckRow1 = IniRead ( "pot.ini", "Pot_Location", "Pixelslot1x1", "0" )

            IF $CheckRow1 = 1 THEN

              Send("1")
              Sleep(100)
              
            ELSE
            
              $CheckRow2 = IniRead ( "pot.ini", "Pot_Location", "Pixelslot1x2", "0" )

              IF $CheckRow2 = 1 THEN

                Send("2")
                Sleep(100)

              ELSE
              
                $CheckRow3 = IniRead ( "pot.ini", "Pot_Location", "Pixelslot1x3", "0" )

                IF $CheckRow3 = 1 THEN

                  Send("3")
                  Sleep(100)

                ELSE
                
                  $CheckRow4 = IniRead ( "pot.ini", "Pot_Location", "Pixelslot1x4", "0" )

                  IF $CheckRow4 = 1 THEN

                    Send("4")
                    Sleep(100)

                  ENDIF
                  
                ENDIF

              ENDIF

            ENDIF

      ENDIF

That is the actual code I am using, I'm sure that I missed something ignorant, heh, but everywhere I look I sware I did it right

Edited by Insolence
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

Double ?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

You may want to put the full path where the "pot.ini" is located

Do you have he part of the code that sets the $health and $mana variables?

These must be defined before the rest of the code would work :whistle:

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

You may want to put the full path where the "pot.ini" is located

Do you have he part of the code that sets the $health and $mana variables?

These must be defined before the rest of the code would work :whistle:

You mean:
$health = PixelGetColor(90,562)
      $mana = PixelGetColor(739,588)

Right?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

It looks like it should work ... I don't have the same screen on my machine to test it fully, but as long as the pixelgetcolor is reporting the correct values it should work.

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

I just double checked the pixel for $mana, and its apparently different, hopefully this will fix it.. heh :whistle:

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

I have another question, if i wanted to make the main script sleep, how would i do this through an Adlib?

I put sleep in it, but it still is moving when this is activated, although it works perfect, thanks :whistle:

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
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...