Best4FREE Posted February 16, 2008 Share Posted February 16, 2008 I want a Script when im runing notepad.exe it counter it Im run Notepad and close it again and the script Counters +1 and im running 1 notepad more the script counters 1 more until $a > 4 Then it MSG box How much time i runned notepad anybody can help me Pls Link to comment Share on other sites More sharing options...
Best4FREE Posted February 16, 2008 Author Share Posted February 16, 2008 $a = 1 While 1 Sleep (300) WEnd if ProcessExists ( "notepad.exe" ) Then $a = $a +1 if $a > 3 Then MsgBox TEST how much TImes it was runned EndIf SOmething like this Link to comment Share on other sites More sharing options...
bogQ Posted February 16, 2008 Share Posted February 16, 2008 (edited) $a = "" While 1 if ProcessExists ( "notepad.exe" ) Then ProcessClose("notepad.exe" ) Sleep(300) $a = $a +1 EndIf if $a > 3 Then MsgBox(0,"",$a) Exit EndIf WEnd like this? or something like this? $a = "" While 1 if ProcessExists ( "notepad.exe" ) Then if $a > 2 Then MsgBox(0,"",$a+1) Exit EndIf Do Sleep(10) Until Not ProcessExists ( "notepad.exe" ) $a = $a +1 EndIf WEnd Edited February 16, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Xand3r Posted February 16, 2008 Share Posted February 16, 2008 #include<Array.au3> Dim $pids[1] $proc="notepad.exe" $times=0 While 1 $pid=ProcessList($proc) If Not @error Then For $i=1 To $pid[0][0] $ss=_ArraySearch($pids,$pid[$i][1]) If $ss=-1 Then _ArrayAdd($pids,$pid[$i][1]) $times+=1 ToolTip($times,0,0) EndIf Sleep(50) Next EndIf WEnd This can even see if you run multiple instances of notepad at the same time Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro 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