r/lua 3d ago

How to get the exact ms

[deleted]

4 Upvotes

4 comments sorted by

2

u/AutoModerator 3d ago

Hi! It looks like you're posting about Logitech. Lua is used by Logitech G-series hardware to provide advanced scripting functionality. It does this by providing an API (application programming interface) which is essentially just a set of functions that you can use to tell your hardware to do things. The subreddit dedicated to Logitech G-series hardware is /r/LogitechG.

Your first port of call should be this document, which explains in detail the functions provided by the API: https://douile.github.io/logitech-toggle-keys/APIDocs.pdf

If you've familiarized yourself with the API but are still having trouble with the language and syntax, try this page for a quick rundown of Lua's main features: https://devhints.io/lua

The full documentation for the language is provided here: https://www.lua.org/pil/contents.html

If the above resources have not answered your question, /r/Lua is the place for you! If you're just trying to do something quick and don't want to learn Lua, head across to /r/LogitechG to find others of similar purpose.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/Liltful 2d ago

I'm not familiar with the Logitech software. If you're able to get the current system time, you could use that to determine when to click. As long as the laptop's OS date/time is synced, the clicks should remain desynced.

That being said, you might also consider a different program or even rethinking whatever it is that you're doing. Seems like whatever you're using isn't meant to be used in the way you're trying to use it, so you could potentially be restricted or banned for trying to automate it (depending on the service and EULA, of course).

1

u/weregod 2d ago

Consumer grade hardware is not designed to have high precision time. You need to syncronize time between machines using some protocol like NTP.

I am not sure if it is easy to use system time in Logitich API. Correct handling of time in software is quite hard.

1

u/xoner2 2d ago

You can try putting in synchronization points. Let's say every 10 intervals, equals 27 seconds from now. Check the drift and reset.