Search the Community
Showing results for tags 'not'.
-
so right now i have a small project and i wanted to print this text out every second. i have made a random number for the sleep function. but when i want to print out with the while loop it just doesn't work. Run("notepad.exe") Sleep(1000) Local $rndSleep = Int (Random(180000,240000,1000)) While $rndSleep <> 0 $rndSleep - 1 If Mod ( $rndSleep, 1000 ) == 0 Then Send("This note will show the sleeptime before closing the tabs, you got " & $rndSleep & " seconds left.") EndIf WEnd plis halp me
-
Basically i am trying to make a script that detects if the currently active window is 1920 x 1080 or bigger. If it detects a window that is active, that is indeed that size. It will do some stuff. The problem i am having is that it is detecting my desktop whenever i click on my desktop, so it's doing stuff when i don't want it to. So all i need to know, is how can i do a simple check to see if a window = a title. Here is what i have so far $wintitledesktop = WinGetTitle("[ACTIVE]") If not $wintitledesktop = "Program Manager" Then ;does stuff endif Program Manager is what my desktop is called btw. The problem with that code is that the script is still detecting the desktop and doing the code. In case you need the whole section of the code, here it is. $winsizecheck1 = WinGetClientSize("[ACTIVE]") $wintitledesktop = WinGetTitle("[ACTIVE]") If WinActive("[ACTIVE]") Then sleep(100) If $winsizecheck1[0] >= 1920 Then If $winsizecheck1[1] >= 1080 Then If not $wintitledesktop = "Program Manager" Then $gamesfolderstate = WinGetState($gamesfolder) If WinExists($gamesfolder) Then If Not BitAND($gamesfolderstate, 16) Then WinSetState($gamesfolder,"",@SW_MINIMIZE) EndIf EndIf EndIf EndIf EndIf EndIf
- 6 replies
-
- if
- wingettitle
-
(and 3 more)
Tagged with:
-
Don't you just love it when a regular expression comes out on top?! I know I do.. Local $hTimer = 0 $hTimer = TimerInit() For $i = 1 To 10000 _IsSystemDrive_Test_1('C') Next ConsoleWrite(TimerDiff($hTimer) & @CRLF) $hTimer = TimerInit() For $i = 1 To 10000 _IsSystemDrive_Test_2('C') Next ConsoleWrite(TimerDiff($hTimer) & @CRLF) Func _IsSystemDrive_Test_1($sDrive) Local $aArray = [@HomeDrive, _ @ProgramFilesDir, _ @SystemDir, _ @WindowsDir] For $sFilePath In $aArray If StringLeft($sFilePath, 1) = $sDrive Then Return True EndIf Next Return False EndFunc ;==>_IsSystemDrive Func _IsSystemDrive_Test_2($sDrive) Return StringRegExp(@HomeDrive & '|' & @ProgramFilesDir & '|' & @SystemDir & '|' & @WindowsDir, '(?<=^|\|)(?:' & $sDrive & ')') = 1 EndFunc ;==>_IsSystemDrive I am no expert at regular expressions, but what I have managed to learn has proved very useful over the last couple of years.
-
I´m getting mixed up! What´s the difference between: While NOT Func1() AND Func2() and While NOT Func1() AND NOT Func2() ?? I´m using lots of these and it works find, but now that I´m rewriting my script I´m mixing things up and getting unsure.
- 3 replies
-
- operators
- silly questions
-
(and 1 more)
Tagged with:
-
Instead of hijacking the other topic any further, I decided to create a new topic for the discussion of the "Not" operator. Here is the previous topic for reference: '?do=embed' frameborder='0' data-embedContent>> How is it that this works perfectly (tested and part of one of my toolsets that hundreds of techs use daily): $Authentication = InetGetSize("http://wouldntyouliketoknow.com/DeleteThisNow.txt") If Not $Authentication = 0 Then MsgBox(16, "ERROR", "The license for this product has expired.", 5) Self_Destruct() Exit EndIf As we can see, there are no parenthesis there, but it still functions as I expected. This also works as expected, but I feel that the 2 contradict each other: #include <Constants.au3> Local $vVar = 'SomeTest' ; This expression before Then is Not True, as $vVar = 'SomeTest' evaluates to True, hence Not True. If Not ($vVar = 'SomeTest1') Then MsgBox($MB_SYSTEMMODAL, '1', 'This MsgBox won''t display, as $vVar = SomeTest.') ; AutoIt looks at this as (Not $vVar) = 'SomeTest'. If Not $vVar = 'SomeTest1' Then MsgBox($MB_SYSTEMMODAL, '2', 'This MsgBox won''t display, as $vVar = SomeTest.') In this second example, the MsgBox with title '2' does not launch, proving that parenthesis are a necessary part of the statement. My question is: What it is about my first example script that makes it work differently than the second example by FireFox?