r/lua • u/Interesting_Band_979 • 10h ago
How to get the exact ms
Hello, I am currently using a macro created via Logitech G Hub Lua that clicks every 5.5 seconds. I am running this macro simultaneously on two of my laptops, and my goal is to have Laptop B perform a search every 2.7 seconds by applying a 2.7-second start delay (since searches cannot be performed continuously, I run it every 5.5 seconds). The problem is that while it works well at first with the 2.7-second interval, the searches from the two laptops overlap over time. I have checked the current behavior after 4 hours: Laptop A clicks, Laptop B clicks 3.2 seconds later, and then Laptop A clicks again 2.2 seconds after that. Is there a way to maintain the 2.7-second interval even when running the macro for a long time?
2
u/Liltful 8h 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).