Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Stopping the execution of a script from another script

If you have a question or need help, this is the place to be.
Post Reply
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Stopping the execution of a script from another script

Post by krambriw »

Hello,

I try to stop a running script from another script but no success.

Start the first script and when it is running/sleeping, start the second script.

Sample below
Best regards, Walter

First script

Code: Select all

eg.globals.StopTheScript = False

ind = 1
while ind < 5:
    if eg.globals.StopTheScript == True:
        eg.Exit()
    remain = int(time.strftime("%S", time.localtime()))
    if remain > 30:
        remain = remain - 30
    print 30-remain
    time.sleep(30-remain)
    ind += 1
 

The second script

Code: Select all

eg.globals.StopTheScript = True
eg.Exit()
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Stopping the execution of a script from another script

Post by Bartman »

The macros and therefore the two scripts will not run simultaneously. EG will run each macro after an other.
You have to use threads to run multiple scripts in time shared way.
Post Reply