So I've got my first macro capable keyboard (Logitech G110), and would like to utilize it for my gaming. However, my education in programming ended halfway through C programming. I am looking for help with a very simple script, that sets a timer for a delayed macro, i.e. I press a button, and after N seconds it plays a macro. Here's what I've got:
function OnEvent(event, arg)
if(event == "G_PRESSED" and arg == 6) then
Sleep(360000);
PlayMacro("Dragon");
end
if(event == "G_PRESSED" and arg == 5) then
Sleep(300000);
PlayMacro("Buff");
end
if(event == "G_PRESSED" and arg == 12) then
Sleep(420000);
PlayMacro(Nashor);
end
if(event == "G_PRESSED" and arg == 10) then
Sleep(300000);
PlayMacro(FlashHeal);
end
if(event == "G_PRESSED" and arg == 4) then
Sleep(210000);
PlayMacro(IgniteExhaust);
end
end
The problem is that it seems to not sleep for the desired amount of time, and seems to be firing at random. If I start more than one timer, the script just completely collapses and randomly fires until I restart my computer.