AlienStar Posted January 5, 2010 Share Posted January 5, 2010 (edited) hello everybody I made a script like this :while ProcessExists("explorer.exe") = True sleep(50) WEnd ;------------------------------------------------------------------ func goingon() MsgBox(4096, "Test", "This box will time out in 10 seconds", 10) EndFuncI used that loop to make the script running only and its name is file.exehow can I call this function via another script ??I did this :Run("file.exe /goingon()")but nothing happened and also file.exe run again (the second script is near file.exe) but I don't wanna that .please help me Edited January 5, 2010 by AlienStar Link to comment Share on other sites More sharing options...
no1Gun Posted January 5, 2010 Share Posted January 5, 2010 Unless I'm mistaken - you can include other scripts with this: #include "123456789.AU3" Anyone correct me if I'm wrong, but that's the way I've included scripts into others and so far - no bugs.. Just make sure the path of the files are the same Link to comment Share on other sites More sharing options...
jvanegmond Posted January 5, 2010 Share Posted January 5, 2010 You should pass command line arguments to your script, and based on the command line argument you can call the function in a proper way. github.com/jvanegmond Link to comment Share on other sites More sharing options...
AlienStar Posted January 5, 2010 Author Share Posted January 5, 2010 can you explain more about this ? Link to comment Share on other sites More sharing options...
JohnOne Posted January 5, 2010 Share Posted January 5, 2010 (edited) This is my lesson learned for the day if Im right on this. Am to understand that, based on the code in the OP post I could get the msgbox to appear from command line with something like "c:\path\file.exe /goingon()" ? EDIT: Booooo No I cant. Thought it sounded to easy to be true Edited January 5, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted January 5, 2010 Share Posted January 5, 2010 Yay, lesson lerned while ProcessExists("explorer.exe") = True If $CmdLine[0] >0 Then If $CmdLine[1] = "goingon" Then goingon() EndIf sleep(50) WEnd ;------------------------------------------------------------------ func goingon() MsgBox(4096, "Test", "This box will time out in 10 seconds", 10) EndFunc C:\Path\File.exe goingon AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
AlienStar Posted January 6, 2010 Author Share Posted January 6, 2010 (edited) thanks so so much teacher JohnOne but there is one thing not OK I used While loop to let my script running all time waiting for calling but when I call it in this way it runs again but closing after doing the function I wanna call it from processes not from location just not to run the script again and thanks so much for help Edited January 6, 2010 by AlienStar Link to comment Share on other sites More sharing options...
LaNiZ Posted January 6, 2010 Share Posted January 6, 2010 Add a Return 1 to the end of your goingon() function, that should return the script to it's former position when the function quits. while ProcessExists("explorer.exe") = True If $CmdLine[0] >0 Then If $CmdLine[1] = "goingon" Then goingon() EndIf sleep(50) WEnd ;------------------------------------------------------------------ func goingon() MsgBox(4096, "Test", "This box will time out in 10 seconds", 10) Return 1 EndFunc Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 6, 2010 Share Posted January 6, 2010 You shouldn't have the If statement inside the While loop. That should have been obvious. If you loop something, it gets called over and over. Link to comment Share on other sites More sharing options...
AlienStar Posted January 6, 2010 Author Share Posted January 6, 2010 @LaNiZ , @Richard Robertson thanks for you but I wanna it as I wrote now please : how can I call it without running the script again ??? Link to comment Share on other sites More sharing options...
Mat Posted January 6, 2010 Share Posted January 6, 2010 #AutoIt3Wrapper_Change2CUI=y ConsoleWrite("Compiled: " & @TAB & @COMPILED & @CRLF & "CMDLine: " & @TAB & $CMDLineRaw & @CRLF) Execute($CMDLineRaw) Func HitTest() ConsoleWrite("Success!" & @CRLF) Sleep (1000) EndFunc ;==>HitTest Compile that using au3Wrapper and then run something like this: Run (@ScriptDir & "\Example.exe HitTest()") AutoIt Project Listing Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 6, 2010 Share Posted January 6, 2010 @LaNiZ , @Richard Robertson thanks for you but I wanna it as I wrote now please : how can I call it without running the script again ???Search for Inter-process communication or something like that. I usually use CoProc.au3 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
AlienStar Posted January 7, 2010 Author Share Posted January 7, 2010 (edited) @MatI used JohnOne's code and that's I wanna @AdmiralAlkexI've downloaded CoProc.au3 and read its topic but I couldn't use it in my purpose can you help me with that ??? Edited January 8, 2010 by AlienStar Link to comment Share on other sites More sharing options...
AlienStar Posted January 10, 2010 Author Share Posted January 10, 2010 no problem if it's not possible to do that thanks so much for everybody help or try to help me 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