Jump to content

Recommended Posts

Posted (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)
EndFunc

I used that loop to make the script running only

and its name is file.exe

how 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 by AlienStar
Posted

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 ;)

Posted (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 by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

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.

Posted (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 by AlienStar
Posted

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
Posted

@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
Posted (edited)

@Mat

I used JohnOne's code and that's I wanna ;)

@AdmiralAlkex

I've downloaded CoProc.au3 and read its topic but I couldn't use it in my purpose

can you help me with that ???

Edited by AlienStar

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...