Jump to content
Sign in to follow this  
Insolence

IF NOT()

Recommended Posts

Insolence

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.

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
CyberSlug

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!

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
sykes

$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?

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
-TS-

yea sometime i see peoples snuff == snuff (snuff = to the existence of)

Edited by -TS-

Share this post


Link to post
Share on other sites
sykes

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?

Share this post


Link to post
Share on other sites
-TS-

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

wont that read it if its in the same dir.?

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
-TS-

he means

"c:\autoit\pot.ini"

else wise i thik your get an error

Edited by -TS-

Share this post


Link to post
Share on other sites
sykes

Yea As long as the script is in the same directory that the ini file is in it should read it fine


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

Share this post


Link to post
Share on other sites
sykes

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?

Share this post


Link to post
Share on other sites
Insolence

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.

Share this post


Link to post
Share on other sites
-TS-

some games will shift the viewing area over by one pixel soo you might have to add something extra

if $x = 25 then;dif. pixel found but will still work
  $x = 98;correct pixel
 endif;x is good to go

Share this post


Link to post
Share on other sites
Insolence

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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.