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.

ShowOSD parameters

If you have a question or need help, this is the place to be.
Post Reply
openbox
Posts: 19
Joined: Wed Jun 21, 2006 4:10 pm

ShowOSD parameters

Post by openbox »

trying to get mm (mins) briefly displayed.
What's wrong with this here script?

import time
min = time.localtime()[3]
eg.plugins.EventGhost.ShowOSD(eg.globals.min, None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 0.5)
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

If you don't want to export "min" as a global you can do:

Code: Select all

import time
min = time.localtime()[3]
eg.plugins.EventGhost.ShowOSD(str(min), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 0.5)
If you want to export it you have to do:

Code: Select all

import time
eg.globals.min = time.localtime()[3]
eg.plugins.EventGhost.ShowOSD(str(eg.globals.min), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 0.5)
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

But if this is all you want to do, I would suggest to only do the calculation in the script, like this:

Code: Select all

import time
eg.result = str(time.localtime()[3])
and make a ShowOSD action directly afterwards with "{eg.result}" (without quotes) as parameter.
This way it is easier to configure the appearance of the OSD.
Last edited by Bitmonster on Tue Aug 01, 2006 6:17 pm, edited 1 time in total.
openbox
Posts: 19
Joined: Wed Jun 21, 2006 4:10 pm

Post by openbox »

Nicely. Thanks.
Post Reply