talss Posted November 27, 2008 Share Posted November 27, 2008 Here's my conditional: $pixel = PixelGetColor(1278,966); $pixel2 = PixelGetColor(1277,966); if <$pixel == 15790320 & $pixel2 == 15780320> Then MsgBox(0,"abc","abcde",2); MouseMove(1278,966,1); MouseClick("left"); Sleep(500); EndIf That condition is true,so why it won't show me message? Link to comment Share on other sites More sharing options...
GEOSoft Posted November 27, 2008 Share Posted November 27, 2008 Here's my conditional: $pixel = PixelGetColor(1278,966); $pixel2 = PixelGetColor(1277,966); if <$pixel == 15790320 & $pixel2 == 15780320> Then MsgBox(0,"abc","abcde",2); MouseMove(1278,966,1); MouseClick("left"); Sleep(500); EndIf That condition is true,so why it won't show me message?It can't possibly be true. if <$pixel == 15790320 & $pixel2 == 15780320> Then Not sure what you are attempting to do here (you don't explain that part) but I think what you are looking for is; If $pixel = 15790320 AND $pixel2 = 15780320 Then George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
talss Posted November 27, 2008 Author Share Posted November 27, 2008 It can't possibly be true. if <$pixel == 15790320 & $pixel2 == 15780320> Then Not sure what you are attempting to do here (you don't explain that part) but I think what you are looking for is; If $pixel = 15790320 AND $pixel2 = 15780320 ThenOk thx, and someone got beginners tutorials for AutoIt? BTW - How can i get the name of the window with the focus now?? (which function? give name please). Link to comment Share on other sites More sharing options...
November Posted November 27, 2008 Share Posted November 27, 2008 Ok thx,and someone got beginners tutorials for AutoIt?BTW - How can i get the name of the window with the focus now??(which function? give name please).Hi there m8,You should try by visiting this tutorial : TutorialThen read and train a lot with AutoIT Help file.For now :WinActivetake a lookCheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
talss Posted November 27, 2008 Author Share Posted November 27, 2008 How can I know how many elements do an array have? Link to comment Share on other sites More sharing options...
TehWhale Posted November 27, 2008 Share Posted November 27, 2008 Count them with Ubound($Array) - 1 Link to comment Share on other sites More sharing options...
talss Posted November 27, 2008 Author Share Posted November 27, 2008 And how do I stop For loop at the middle? (like break; in C++?) I can't find it in tutorials!! Link to comment Share on other sites More sharing options...
TehWhale Posted November 27, 2008 Share Posted November 27, 2008 Maybe your talking about ContinueLoop? ExitLoop? Link to comment Share on other sites More sharing options...
darzanmihai Posted November 27, 2008 Share Posted November 27, 2008 How can I know how many elements do an array have? look at this #include <array.au3> Dim $a[10][20] For $i = 0 to UBound($a)-1 For $j = 0 to UBound($a,2)-1 $a[$i][$j]=$i+$j Next Next _ArrayDisplay($a) MsgBox(0,UBound($a,0),(UBound($a))*(UBound($a,2))) I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
talss Posted November 27, 2008 Author Share Posted November 27, 2008 (edited) My script switches between windows,and i want him to switch - and go back(give focus) to the original window. so i tried this algorithem: $windows = WinList() for $i = 0 to Ubound($windows)-1 Step +1 $check = WinActive($windows[$i][0]) if $check == 1 Then ExitLoop EndIf Next Etc...Code... WinActivate($windows[$check][0]) and it's not working,what should I do? Sometimes when I check with MsgBox which window was active it writes :"Task Switching". Edited November 27, 2008 by talss Link to comment Share on other sites More sharing options...
darzanmihai Posted November 27, 2008 Share Posted November 27, 2008 (edited) My script switches between windows,and i want him to switch - and go back(give focus) to the original window. so i tried this algorithem: $windows = WinList() for $i = 0 to Ubound($windows)-1 Step +1 $check = WinActive($windows[$i][0]) if $check == 1 Then ExitLoop EndIf Next Etc...Code... WinActivate($windows[$check][0]) and it's not working,what should I do? Sometimes when I check with MsgBox which window was active it writes :"Task Switching". firs of all, when exiting the for loop, $check=1 or 0 so WinActivate($windows[$check][0]) will atempt to activate a number $windows[0[0]=number of windows or will atempt to activate the first found window if $check=1. It is not good. $windows = WinList() $a = 0 for $i = 0 to Ubound($windows)-1 Step +1 $check = WinActive($windows[$i][0]) if $check == 1 Then $a = $i ExitLoop EndIf Next Etc...Code... WinActivate($windows[$a][0]) this will work but it will not have a functionality: when the window is found active, it atempts to activate it (but is already active). What is is that you try to do? Edited November 27, 2008 by darzanmihai I do not like stupid and idiot people that write idiot things...If you are one, do not write. 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