Do you have questions about writing plugins or scripts in Python? Meet the coders here.
-
DranDane
- Posts: 18
- Joined: Mon Dec 08, 2008 2:23 pm
Post
by DranDane » Fri Feb 20, 2009 4:50 pm
Hello,
It's the first time I code in python. Could you just explain me how I can use a timer (from the timer module) in custom script. I would like to be able to retrieve the timer counter to say a specific message.
Something like
Code: Select all
Speech.TextToSpeech(u'Microsoft Sam', 0, u'The timer already did {var} loops', 0, 100)
Thank you,
-
topix
- Experienced User
- Posts: 441
- Joined: Sat May 05, 2007 3:43 pm
- Location: Germany
-
Contact:
Post
by topix » Sun Feb 22, 2009 7:26 pm
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="851">
<Folder Name="Timer_Test" Expanded="True">
<Macro Name="Timer Start" Expanded="True">
<Action>
Timer.TimerAction(u'test', 0, 10, 3.0, u'testtimer', False, False, 0, u'00:00:00')
</Action>
</Macro>
<Macro Name="Python Script" Expanded="True">
<Event Name="Timer.testtimer" />
<Action>
EventGhost.PythonScript(u'print "This is the %d. loop." % (eg.event.payload[0] + 1)')
</Action>
</Macro>
</Folder>
</EventGhost>