Question on utilizing Battery status in a LUA script Implementation
Quick rant, why in gods name doesn't Logitech put their LUA api documentation somewhere on the internet. If anyone finds this in future here is an imgur album to help you follow along to these steps (For reference I am on version 2020.1.31155)
- Install Logitech G Hub on your computer.
- From the main screen click on Active Profiles button
- Under the Profiles section click on the button with the hover-text "Scripting"
- Create a new Active LUA script, and then click on Edit Script
- From within the internal IDE click on "Help" and then "Scripting API" which will open a local PDF of their scripting API documentation
On to my question. Does anybody know if there is a function to extract a devices Battery State or other information, as seen on this screen? I want to dump this to a json and then read that in Rainmeter to create a desktop widget which will track my devices battery life. I really don't want to have to reinvent the wheel using C+. If anyone knows how to contact their dev support team that would be cool too.
Posted Feb 1, 2020, 8:51 PM UTC
Hey
Yeah, Logitech really hasn't made it easy.
Someone has previously used CheatEngine to pointerscan all adresses and extract the battery life value directly from there.
I got this working for the same headset he mentions, the G933, but I haven't given it a try with any other device yet.
Check out their GitHub here: https://github.com/Snipeon/LGSbatt-rainmeter
Did you get your LUA script working? Looks like the picture in your album is cut off, so I'm not sure if that's all of your code.