Insolence Posted December 11, 2003 Share Posted December 11, 2003 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 -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 More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 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 More sharing options...
CyberSlug Posted December 11, 2003 Share Posted December 11, 2003 (edited) 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 December 11, 2003 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 More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 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 More sharing options...
CyberSlug Posted December 11, 2003 Share Posted December 11, 2003 Check whether you mean OR or AND. There's always the nested-if option:If $health <> 92 Then If $mana <> 2624524 Then ; do stuff EndIf EndIf 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 More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 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 More sharing options...
sykes Posted December 11, 2003 Share Posted December 11, 2003 $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? We have enough youth. How about a fountain of SMART? Link to comment Share on other sites More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 (edited) expandcollapse popupIF $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 December 11, 2003 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 More sharing options...
-TS- Posted December 11, 2003 Share Posted December 11, 2003 hey whast the point of the double = ? Link to comment Share on other sites More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 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 More sharing options...
-TS- Posted December 11, 2003 Share Posted December 11, 2003 (edited) yea sometime i see peoples snuff == snuff (snuff = to the existence of) Edited December 11, 2003 by -TS- Link to comment Share on other sites More sharing options...
sykes Posted December 11, 2003 Share Posted December 11, 2003 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 We have enough youth. How about a fountain of SMART? Link to comment Share on other sites More sharing options...
-TS- Posted December 11, 2003 Share Posted December 11, 2003 $CheckRow1 = IniRead ( "pot.ini", "Pot_Location", "Pixelslot1x1", "0" ) wont that read it if its in the same dir.? Link to comment Share on other sites More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 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 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 More sharing options...
-TS- Posted December 11, 2003 Share Posted December 11, 2003 (edited) he means "c:\autoit\pot.ini" else wise i thik your get an error Edited December 11, 2003 by -TS- Link to comment Share on other sites More sharing options...
sykes Posted December 11, 2003 Share Posted December 11, 2003 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? Link to comment Share on other sites More sharing options...
sykes Posted December 11, 2003 Share Posted December 11, 2003 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 More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 I just double checked the pixel for $mana, and its apparently different, hopefully this will fix it.. heh "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 More sharing options...
-TS- Posted December 11, 2003 Share Posted December 11, 2003 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 Link to comment Share on other sites More sharing options...
Insolence Posted December 11, 2003 Author Share Posted December 11, 2003 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 "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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now