PDA

View Full Version : Quick timer question



Mastiff
January 15th, 2015, 04:56 PM
I would like a timer to start a program directly. So I tried this:


Timere.Varme.Temperaturstyring_Testrom_modus_1 = scheduler.Create(win.ShellExecuteEx ("C:\\Program Files (x86)\\EventGhost\\EventGhost.exe", '-event Timertest',nil,nil))
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 1, 17, 00, scheduler.INFINITE) --mandag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 2, 17, 00, scheduler.INFINITE) --tirsdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 3, 17, 00, scheduler.INFINITE) --onsdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 4, 23, 20, scheduler.INFINITE) --torsdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 5, 05, 00, scheduler.INFINITE) --fredag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 6, 17, 00, scheduler.INFINITE) --lørdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 0, 17, 00, scheduler.INFINITE) --søndag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Sta rt()
Timere.Varme.temperaturstyring_Testrom_modus_1 = Timere.Varme.Temperaturstyring_Testrom_modus_1:Lis tProperties()


But this fires the EventGhost command a soon as I run the script, not at the designated time. I don't know if it will fire at the designated time, but I can se that it is at least created in the variable inspector.

This is what I have been used to before:


Timere.Varme.Temperaturstyring_Testrom_modus_1 = scheduler.Create('Timertest',18)
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 1, 17, 00, scheduler.INFINITE) --mandag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 2, 17, 00, scheduler.INFINITE) --tirsdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 3, 17, 00, scheduler.INFINITE) --onsdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 4, 23, 20, scheduler.INFINITE) --torsdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 5, 05, 00, scheduler.INFINITE) --fredag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 6, 17, 00, scheduler.INFINITE) --lørdag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Day OfWeekTask(1, 0, 17, 00, scheduler.INFINITE) --søndag
Timere.Varme.Temperaturstyring_Testrom_modus_1:Sta rt()
Timere.Varme.temperaturstyring_Testrom_modus_1 = Timere.Varme.Temperaturstyring_Testrom_modus_1:Lis tProperties()


This fires the event at the scheduled time and nothing when I run the script. Is it possible to do it directly, as in the first example. I'm guessing that I have to use the event method and create an extra action that's triggered by the event. Or is it possible to do it in the same script, somewhat like the first example? I'm trying to simplify my setup so I'll only have to spend a week explaning stuff to whoever I sell this house to as a smarthouse next spring! So I want to get it all running smooth now, remove all rough edges and then have it running for a year to see that nothing goes wrong.