[Blackout.Lua] ScreenSaver/OLED Protection

Eorzea Time
 
 
 
Language: JP EN FR DE
Version 3.1
New Items
5744 users online
Forum » Windower » General » [Blackout.Lua] ScreenSaver/OLED protection
[Blackout.Lua] ScreenSaver/OLED protection
 Fenrir.Jinxs
Offline
Server: Fenrir
Game: FFXI
User: Jinxs
Posts: 1215
By Fenrir.Jinxs 2026-05-27 09:50:14
Link | Quote | Reply
 
Blackout
Blackout is a lightweight utility addon designed to prevent screen burn-in, and manage your game client when you step away from the keyboard.

https://github.com/State-Null

old:
[+]
 Valefor.Keylesta
Offline
Server: Valefor
Game: FFXI
User: Keyser
Posts: 208
By Valefor.Keylesta 2026-05-27 10:59:18
Link | Quote | Reply
 
Oh man, great minds eh? I just recently upgraded to a new Alienware OLED monitor and started working on a screensaver addon on the side too lol. I got a good chunk of work done on it before I hit a snag and decided to sit on it for a while and work on other stuff (new Bar in the works, don't tell anyone), so this'll be good to have in the meanwhile :D
 Valefor.Keylesta
Offline
Server: Valefor
Game: FFXI
User: Keyser
Posts: 208
By Valefor.Keylesta 2026-05-27 11:05:48
Link | Quote | Reply
 
If I may, I suggest adding a setting for the bg_alpha scale. Keep default at 255 but open it up to be adjusted in the settings.xml file.
[+]
Offline
Posts: 8
By Nuckinfuts 2026-05-27 12:24:26
Link | Quote | Reply
 
Going to test this out when I get home. Upgrading to a 5th gen tandem oled this year... definitely going to need this. Thank you!
 Fenrir.Jinxs
Offline
Server: Fenrir
Game: FFXI
User: Jinxs
Posts: 1215
By Fenrir.Jinxs 2026-05-27 12:26:55
Link | Quote | Reply
 
I wish I knew about the minimize command before I started on this.
added custom bg scale
This has been mostly antigravity built.
old:
[+]
Offline
Posts: 1401
By DaneBlood 2026-05-27 12:50:02
Link | Quote | Reply
 
Fenrir.Jinxs said: »
Blackout
Blackout is a lightweight utility addon designed to prevent screen burn-in, and manage your game client when you step away from the keyboard.

What It Does & When
Screen Saver Overlay (Default: 5 minutes idle)
After 5 minutes of inactivity, Blackout displays a full-screen solid black overlay to act as a screensaver.


What is the use case of this over just... os regular screensaver ?
also what defines inactivity here? is it local to that character/session or global in activity ?
[+]
 Fenrir.Jinxs
Offline
Server: Fenrir
Game: FFXI
User: Jinxs
Posts: 1215
By Fenrir.Jinxs 2026-05-27 13:21:27
Link | Quote | Reply
 
DaneBlood said: »
Fenrir.Jinxs said: »
Blackout
Blackout is a lightweight utility addon designed to prevent screen burn-in, and manage your game client when you step away from the keyboard.

What It Does & When
Screen Saver Overlay (Default: 5 minutes idle)
After 5 minutes of inactivity, Blackout displays a full-screen solid black overlay to act as a screensaver.


What is the use case of this over just... os regular screensaver ?
also what defines inactivity here? is it local to that character/session or global in activity ?

So I frequently would leave my game running and now being a active parent its worse because sometimes I'll leave for unknown periods.

I am weird I use it as bordless window centered in my screen without using the full resolution.
If I don't minimize the game or click somewhere else windows never activates the screen saver.
Don't know if anyone else has this problem but this is designed to be as lightweight as possible as an insurance measure.

I now have a nice burn in of "Weapons:" because it was set to 255 default.

Smart Inactivity Detection
The idle timer automatically resets upon any keyboard input or mouse movement.
It tracks character coordinates ($X$, $Y$, $Z$) and camera facing direction, so auto-running, getting moved, or panning the camera will keep you marked as active.
So this catches gamepads.
It automatically halts idle timers if you are in combat or dead (so the screen won't go black in the middle of a fight or while waiting for a raise).
It checks in every 10 seconds to try and minimize polling as much as possible
When its active (the screen saver/minimized) it does it every 3 seconds, so that its responsive.

Addon only applies to the character the lua is running on.
 Shiva.Thorny
Offline
Server: Shiva
Game: FFXI
User: Rairin
Posts: 3908
By Shiva.Thorny 2026-05-27 13:25:25
Link | Quote | Reply
 
DaneBlood said: »
What is the use case of this over just... os regular screensaver ?
About what I'm thinking here. Why would you want to black out a single ffxi instance while leaving the rest of your desktop on? Why wouldn't you just configure windows to still be able to use screensaver with FFXI running? If you *must* give FFXI exclusive access to the device and trigger from within FFXI, you could just as easily send a signal to turn off the monitor using any of dozens of existing utilities.

I know you said OLED, but keep in mind that people may not always know the difference. Many kinds of monitors (not true OLED) will still leave the backlight on when run this way, while they wouldn't when using a more standard method.

Probably also something to be said about AI slop, given it's taking 400 lines to do a basic task like this.

3 second poll interval for activation is horrible UX. Poll should be designed to be cheap enough to occur once a frame so it instantly snaps on when the user returns. You're not even powering down hardware and your delay is worse than many monitor turnon times.
[+]
 Fenrir.Jinxs
Offline
Server: Fenrir
Game: FFXI
User: Jinxs
Posts: 1215
By Fenrir.Jinxs 2026-05-27 13:54:56
Link | Quote | Reply
 
I started writing this when I didn't know about the minimize command available.
I left in the blackout overlay just because, the real benefit for me is the minimize command someone told me about today.

Truly turning off the monitor triggers a resize which is not ideal.
As for why the screen saver never activates for me with the game up I never really figured out. Having a webpage open as the active window does, so lazy ai slop is getting the job done in this case.

I have removed the 3 second poll
That is a great suggestion, once I understood it lol
Thank you
old:
Offline
Posts: 1401
By DaneBlood 2026-05-27 16:09:29
Link | Quote | Reply
 
Fenrir.Jinxs said: »
So I frequently would leave my game running and now being a active parent its worse because sometimes I'll leave for unknown periods.

You didnt answer the question.
How does the screensaver we have had available for decades not solve this problem already?
Offline
Posts: 1401
By DaneBlood 2026-05-27 16:16:03
Link | Quote | Reply
 
yes fyi i use one line of ahk code

SendMessage, 0x112, 0xF170, 2,, Program Manager ; 0x112 is WM_SYSCOMMAND, 0xF170 is SC_MONITORPOWER

This tells windows to shut off the signal to monitor
no resizing.

---

From my perspective (and i could be wrong)
It seems that instead of configuring you computer correctly to just work like its supposed to you are making a patch solution inside ffxi, for a broken computer setup
Just fix your computer. It had screensavers built in into it for decades
 Fenrir.Jinxs
Offline
Server: Fenrir
Game: FFXI
User: Jinxs
Posts: 1215
By Fenrir.Jinxs 2026-05-27 16:20:29
Link | Quote | Reply
 
DaneBlood said: »
Fenrir.Jinxs said: »
So I frequently would leave my game running and now being a active parent its worse because sometimes I'll leave for unknown periods.

You didnt answer the question.
How does the screensaver we have had available for decades not solve this problem already?

Game active window = no screen saver

Idk how much clearer I can make that

That is a cool line though definitely saving that for future use.
Offline
Posts: 1401
By DaneBlood 2026-05-27 17:11:09
Link | Quote | Reply
 
Fenrir.Jinxs said: »
Game active window = no screen saver

Idk how much clearer I can make that

That is a cool line though definitely saving that for future use.

I didnt catch this the first time
and I just tested and I can verify the behavior on windows 11.

Im pretty sure it worked on windows 7 but..thats just by memory


This most likely means the process is pulling a power flag to preserve access to monitor. i use this for my my programs that takes alot of time to run iu pull the require system flag so the system will NOT go stand by while my program is doing its task (only the screen)
This might have set requirements to screen.

This might be something that the Windower teams might want to "fix" then to handle it more directly. Because that seems like an unwanted behavior

is this happening with windower or also just regular pol ?
[+]
Offline
Posts: 1401
By DaneBlood 2026-05-27 17:18:06
Link | Quote | Reply
 
I can confirm this happens for screenstandby as well.
making me believe even more its one of the powerstates/requirments flags.
[+]
Offline
Posts: 1401
By DaneBlood 2026-05-27 17:30:59
Link | Quote | Reply
 
adding in some documentation

https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate

Tgis is what i belive is the issue
The game set its SetThreadExecutionState to 0x80000002 where maybe we really just want 0x80000001, as long as the window is the active window

--- BUT ---
I ran a quick check

C:\Windows\System32>timeout /t 10

Waiting for 0 seconds, press a key to continue ...

C:\Windows\System32>Powercfg /requests
DISPLAY:
None.

no pol is requesting the display prevention. only system.
so it must be doing something else to prevent standby
[+]
Offline
By Draylo 2026-05-27 19:29:53
Link | Quote | Reply
 
I usually just alt tab to chrome and it goes to the screen saver after a bit
Offline
Posts: 1608
By Chimerawizard 2026-05-27 20:35:20
Link | Quote | Reply
 
I have a black background for my desktop.
I just win+tab, Desktop2. everything is black except the mouse and taskbar.
click anywhere on the Desktop2 for the taskbar to auto-hide, then drag the mouse off the right side of the screen.

am i doing it wrong?

I have come into a completely dark room at night, grab the remote, turn on the OLED and oops, that turned it off: has happened multiple times.
Offline
Posts: 1401
By DaneBlood 2026-05-27 23:14:46
Link | Quote | Reply
 
Chimerawizard said: »
I have a black background for my desktop.
I just win+tab, Desktop2. everything is black except the mouse and taskbar.
click anywhere on the Desktop2 for the taskbar to auto-hide, then drag the mouse off the right side of the screen.

am i doing it wrong?

I have come into a completely dark room at night, grab the remote, turn on the OLED and oops, that turned it off: has happened multiple times.

i would argue if you are alt tabbing then why not just have a hotkey to turn of the monitor ?
saves power/heat
Offline
By Dodik 2026-05-28 06:49:21
Link | Quote | Reply
 
Don't all video card using games in foreground cause screensaver to be disabled? All my games do this.

Acting like there is some special sauce making windower stop screensaver or w/e. What are you even on about.
Offline
Posts: 1401
By DaneBlood 2026-05-28 10:11:13
Link | Quote | Reply
 
Dodik said: »
Don't all video card using games in foreground cause screensaver to be disabled? All my games do this.

Acting like there is some special sauce making windower stop screensaver or w/e. What are you even on about.

Im not sure if you missed this but there IS literally "secret sauce" to handle standby prevention
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate
and it has nothing to do with the videocard.

This is often used by media players to let windows know not to use screenstandby while its playing a movie.
Offline
By Dodik 2026-05-28 10:30:36
Link | Quote | Reply
 
I'm aware. What does that have to do with games.

All games as a foreground process stop screensaver from running.

The issue isn't windower or pol. Just more poor understanding of basic functionality.

I'm sure there's some Ms resource you could cite.
Offline
Posts: 1401
By DaneBlood 2026-05-28 22:07:02
Link | Quote | Reply
 
Dodik said: »
I'm aware. What does that have to do with games.

All games as a foreground process stop screensaver from running.

The issue isn't windower or pol. Just more poor understanding of basic functionality.

I'm sure there's some Ms resource you could cite.

Last time I tried to explain the underlying mechanics of what we where talking about you had a temper tantrum.
Is this going to be the same this time or are you actually asking to understand why looking into how things works might help solve it?
Offline
Posts: 1401
By DaneBlood 2026-05-28 22:16:56
Link | Quote | Reply
 
For Jinx

Since the worry is OLED burnin, I think (opinion) that blacking out ffxi is not the optimal solution since it only takes care off FFXI.

So I made this for you in Autohotkey
https://gofile.io/d/xFe9Mz

Called it Gsaver (Because everything with gaming has to have G in it)

Bassicaly it just sit and monitor for kb/mouse idle time and when its over the set time interval either shutdown you monitors or call the windows built in blank screensaver




I have fixed my computer so nothing changes when they are powered down aka no resizing not dekstop icons moving around.
However it does not appears that that s the case for you so i put in the blackout option as well

once I can remember the fix for the resizing when monitor are powered off. I will dump that here as well

OH and it can also be trigger with the Hotkey Win + Z
[+]
 Fenrir.Jinxs
Offline
Server: Fenrir
Game: FFXI
User: Jinxs
Posts: 1215
By Fenrir.Jinxs 2026-05-29 16:43:26
Link | Quote | Reply
 
I actually started using your code you posted earlier as well with a hotkey, though muscle memory hasn't caught up yet.

https://github.com/State-Null/Monitor-off-script/tree/main


While this script wont capture gamepad input it will capture my keyboard hotkeys on the controller resetting the time.

About to redo all my code posts.
[+]
Offline
Posts: 1401
By DaneBlood 2026-05-29 19:57:24
Link | Quote | Reply
 
Fenrir.Jinxs said: »
I actually started using your code you posted earlier as well with a hotkey, though muscle memory hasn't caught up yet.

https://github.com/State-Null/Monitor-off-script/tree/main


While this script wont capture gamepad input it will capture my keyboard hotkeys on the controller resetting the time.

About to redo all my code posts.

nevermind this comment. I misread the ahk code