Jooshxp Posted March 25, 2016 Share Posted March 25, 2016 (edited) Hello, Sorry for the past. i want to know how to running program on a background. so i can running another program again. so like this : Run "Notepad" Send ("Hello") but, i want to running it and still can browsing on a website. also, how to WinWait or WinExist or WinActive if a program can't detected with autoit. i make like this : #include <MsgBoxConstants.au3> example () Func Example () Run (""C:\Program Files\Mozilla Firefox\firefox.exe"") WinWait ( "Mozilla Firefox", "", 10 ) If WinExists ( "Mozilla Firefox") Then MsgBox($MB_SYSTEMMODAL, "", "Mozilla Firefox is Running") Else MsgBox($MB_SYSTEMMODAL, "", "Mozilla Firefox Not Running") EndIf EndFunc But, when i try to Running it, msgbox is always showing Mozilla Firefox not Opened. can anyone help ? Thank's Edited March 25, 2016 by Jooshxp Link to comment Share on other sites More sharing options...
AutoBert Posted March 25, 2016 Share Posted March 25, 2016 "Mozilla Firefox(x86)" isn't a path to a runable EXE, also the syntax of the run function is wrong. I suggest to study helpfile for getting basic understanding of the AutoIt syntax. Link to comment Share on other sites More sharing options...
Jooshxp Posted March 25, 2016 Author Share Posted March 25, 2016 10 minutes ago, AutoBert said: "Mozilla Firefox(x86)" isn't a path to a runable EXE, also the syntax of the run function is wrong. I suggest to study helpfile for getting basic understanding of the AutoIt syntax. it just an example. and i already edit it... Link to comment Share on other sites More sharing options...
InunoTaishou Posted March 25, 2016 Share Posted March 25, 2016 ControlSend and ControlClick. If you're wanting to do stuff on the web in the background then look at The FireFox UDF, Chrome UDf, or IE UDF. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 25, 2016 Developers Share Posted March 25, 2016 10 minutes ago, Jooshxp said: it just an example. and i already edit it... The current path&program in the run() statement is still wrong as it contains 2 double quotes at start and end which gives you an error. What about you first try the script and try correcting it before posting other questions? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Jooshxp Posted March 26, 2016 Author Share Posted March 26, 2016 (edited) 21 hours ago, Jos said: The current path&program in the run() statement is still wrong as it contains 2 double quotes at start and end which gives you an error. What about you first try the script and try correcting it before posting other questions? Jos already make it, lol can i have another question here ?? So, if i'm make infinite loop, and after 5 minutes it will do another things like this : Func Start () While 1 = 1 MouseMove ( 1024, 768 ) MouseClick ("Left", 1024, 768) Sleep (5000) WEnd EndFunc So, after the Func Start is Running, then after 5 minutes later it do another. it can ? lol Sorry if i can't ask here or ask that 21 hours ago, InunoTaishou said: ControlSend and ControlClick. If you're wanting to do stuff on the web in the background then look at The FireFox UDF, Chrome UDf, or IE UDF. Can it using for Mouse Movement and Click ? Edited March 26, 2016 by Jooshxp Link to comment Share on other sites More sharing options...
InunoTaishou Posted March 26, 2016 Share Posted March 26, 2016 Using a timer you can dictate how long a function can run, like this example. Global Const $TIMEOUT = 1 ; Timeout in minutes Example() Func Example() Local $iTimeoutInMilis = ($TIMEOUT * 60) * 1000 ; Multiple timeout by 60 to get the seconds, then by 1000 to the miliseconds. Since the difference returned from TimerDiff is miliseconds Local $iDifference = 0 Local $iTimer = TimerInit() While ($iDifference < $iTimeoutInMilis) $iDifference = TimerDiff($iTimer) Local $iMilis = ($iTimeoutInMilis - $iDifference) Local $iSecsRemain = Mod($iMilis / 1000, 60) Local $iMinsRemain = Mod($iMilis / 1000 / 60, 60) ToolTip("Current in loop for " & StringFormat("%02i:%02i:%02i", Floor($iDifference / 60000), Floor($iDifference / 1000), Mod($iDifference, 1000)) & @CRLF & _ "Time remaining until Example ends: " & StringFormat("%02i:%02i:%02i", $iMinsRemain, $iSecsRemain, Mod($iMilis, 1000)), 0, 0) Sleep(200) WEnd MsgBox("", "Exited", "Reached the " & $TIMEOUT & " minute timeout. Example() has exited") EndFunc ;==>Example Link to comment Share on other sites More sharing options...
Developers Jos Posted March 26, 2016 Developers Share Posted March 26, 2016 Or simply an AdlibRegister() statement to perform a UDF after the specified time? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Jooshxp Posted March 27, 2016 Author Share Posted March 27, 2016 (edited) On 3/26/2016 at 9:19 PM, InunoTaishou said: Using a timer you can dictate how long a function can run, like this example. Global Const $TIMEOUT = 1 ; Timeout in minutes Example() Func Example() Local $iTimeoutInMilis = ($TIMEOUT * 60) * 1000 ; Multiple timeout by 60 to get the seconds, then by 1000 to the miliseconds. Since the difference returned from TimerDiff is miliseconds Local $iDifference = 0 Local $iTimer = TimerInit() While ($iDifference < $iTimeoutInMilis) $iDifference = TimerDiff($iTimer) Local $iMilis = ($iTimeoutInMilis - $iDifference) Local $iSecsRemain = Mod($iMilis / 1000, 60) Local $iMinsRemain = Mod($iMilis / 1000 / 60, 60) ToolTip("Current in loop for " & StringFormat("%02i:%02i:%02i", Floor($iDifference / 60000), Floor($iDifference / 1000), Mod($iDifference, 1000)) & @CRLF & _ "Time remaining until Example ends: " & StringFormat("%02i:%02i:%02i", $iMinsRemain, $iSecsRemain, Mod($iMilis, 1000)), 0, 0) Sleep(200) WEnd MsgBox("", "Exited", "Reached the " & $TIMEOUT & " minute timeout. Example() has exited") EndFunc ;==>Example how about like this : Func > Timer > back to Func again and repeat again again and again ?? can like that ? On 3/26/2016 at 10:15 PM, Jos said: Or simply an AdlibRegister() statement to perform a UDF after the specified time? Jos Yes, after the specified time like > Function running on 5 minutes > after 5 minutes it is do another function sleep 1s / more then back to the function 1st. So Like This an Example i have 2 Func Hotkeyset [{"F1"}] "Start" Func Start () While 1 = 1 MouseMove ( 700, 600 ) MouseClick ("Left" 700, 600) WEnd EndFunc Func B () MouseMove ( 500, 500 ) Send ({"ESC"}) MouseClick ("Left", 500, 300 ) EndFunc So What i mean is First Running Function Start after 5 Minutes Run Func B one time then back again to Function Start. It Can ?? Thank's Edited March 27, 2016 by Jooshxp 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