Trigger event immediately
Posted: Thu Nov 05, 2009 9:31 am
Hi all.
This might be a really dumb question but i can't find the answer to it.
I'm writing a python script that will loop trying a certain action for 30s. Every 10 seconds or so i want to trigger an event.
Here is some basic code as its probably easier to understand
The print statements work exactly like i would like it to. However all the TriggerEvents get fired after the script has finished.
Eg
print
print
print
...
print
Trigger
Trigger
Trigger
Is there anyway to Trigger the event inline or call a macro from within my script and then return to the script after?
Or will i have to put all the plugin commands directly into the script?
Thanks.
This might be a really dumb question but i can't find the answer to it.
I'm writing a python script that will loop trying a certain action for 30s. Every 10 seconds or so i want to trigger an event.
Here is some basic code as its probably easier to understand
Code: Select all
while os.path.exists(eg.globals.driveLetter+":") == False:
if i == 1 or i == 10 or i == 20:
eg.TriggerEvent("Start_"+eg.globals.driveLetter.upper())
print " Start_"+eg.globals.driveLetter.upper()+" "+str(i)
elif i == 30:
print "Breaking "+str(i)
break
i = i + 1
print "Sleeping "+str(i)
time.sleep(1)
Eg
...
Trigger
Trigger
Trigger
Is there anyway to Trigger the event inline or call a macro from within my script and then return to the script after?
Or will i have to put all the plugin commands directly into the script?
Thanks.