Resource icon

OBS Lua Advanced Timer 5.0.1

PMD-io

New Member
FYI -- small error in code is preventing %HH from having double zeroes as leading numbers. In the function set_time_text() under if string.match (text, "%%HH") the next line says "minutes_infinite" where it should say "hours_infinite"

I was also able to figure out my use case I mentioned before by adding the Countdown duration as an option in the Countup menu, then having the reset function pull that number, like it does in Countdown. Awesome code -- pretty much exactly what I was looking for.
Can you expand on how you solved the count up from a set time? Did you code it yourself and is it available? Thanks.
 

FerretBomb

Active Member
Just a bit of feedback, the formatting doesn't all work correctly. %mm does, but %m doesn't (if you don't want to fill a leading zero). Same with %ss working but %s does not, and %hh vs %h.

It would be VERY handy if there was some way to indicate the rollover from countdown to count-up. I'd like to use this for my AFK scene, but it'd be preferred if the counter gained a - or (better yet) changed the 'Countdown Final Text' box to be a second Format box.
This would allow changing the text from (for example) "Ferret will be back in: XX:XX" to "Ferret is overdue to return by: XX:XX". It would also allow eliminating the 'Countup When Done' checkbox entirely... if you don't want a countup, just don't include any string-replacements in the text you enter in the 'Count Complete Text' box.
 
Last edited:

Yurlyn

Member
Just a bit of feedback, the formatting doesn't all work correctly. %mm does, but %m doesn't (if you don't want to fill a leading zero). Same with %ss working but %s does not, and %hh vs %h.
To get rid of the leading 0 for the hours use a %HH instead of %hh. This basically just changes the time format from 24-hours to 12-AM/PM. But that doesn't work for minutes and seconds due to how time is formatted in LUA. A filter (if-statement) is needed for that in the coding of this script.
 

FerretBomb

Active Member
To get rid of the leading 0 for the hours use a %HH instead of %hh. This basically just changes the time format from 24-hours to 12-AM/PM. But that doesn't work for minutes and seconds due to how time is formatted in LUA. A filter (if-statement) is needed for that in the coding of this script.
And for minutes?
According to the tooltip, %HH should be "hours with leading zero, 00-infinity", but does appear to be a non zero-padded hours string replacement.
It'd also still be nice if the timer-delta was usable in the 'final text' box instead of hardcoding to '59' for each value, to provide a count-up along with an altered timer-completed message (to provide over-time information for viewers).
 

Yurlyn

Member
It's like I said in my previous message. This is due to the date/time formatting of LUA, the programming language. This script won't be able to show time differently unless the programmer makes use of some extra bit of programming to change any leading zero to a non-leading zero number. Unfortunately, the fix I mentioned above only works for hours and not for minutes and seconds for the same reason.
 

Antoto

New Member
Hi, nice script!

But I've got a problem: if I'm using studio mode my timer will showing only the moment I switched to the scene with the timer source. In my preview, the timer works normaly. It looks like it won't update the timer when the scene is active. Anyone else with a problem like this or is my obs broken?
Hello ThrottleLP.

Were you able to solve this problem? The same happens to me. I just started using OBS Studio and I don't know how to fix it. If anyone could help me, I would appreciate it.
 

cosmitz

New Member
Same as above, script log:

[advanced-timer.lua] Failed to call tick for lua_tick: D:/Software/obs-studio/data/obs-plugins/advanced-timer.lua:122: attempt to call field 'os_gettime_ns' (a nil value)
 

cosmitz

New Member
Actually both of these, which also eventually lead to OBS stalling out:

[advanced-timer.lua] Failed to call button_prop_clicked for button_prop_clicked: D:/Software/obs-studio/data/obs-plugins/advanced-timer.lua:148: attempt to call field 'os_gettime_ns' (a nil value)

[advanced-timer.lua] Failed to call tick for lua_tick: D:/Software/obs-studio/data/obs-plugins/advanced-timer.lua:122: attempt to call field 'os_gettime_ns' (a nil value)
 

lol87

New Member
I have a problem , when my set time finish he redirect to a new scene but my custom transition is repeated 2 times.How to fix?
 

JEJ

Member
@Yurlyn I expanded on it adding some of the functions I needed and thought I share it with the community. So, in a way I guess yes.
 

Yorkar

New Member
I get massive fps drops and render delays when using the script.
If I delete the text and the script is not used, everything works fine.
Any ideas?
 
Top