LGHUB Lua script

29 Views Asked by At

I dont really know how to code Lua, I made a script, when "Numlock" is on the script clicks "a" for a random time duration, then releases "a" and it presses "s" for random time. repeats the script until numlock is turned off. it doesn't work tho..

function OnEvent(event, arg)
   OutputLogMessage("wawa")
   if event == sKeyLockOn("Numlock") then
         repeat
            PressKey("a")
            Sleep(math.random(8700, 8900))
            ReleaseKey("a")
            Sleep(2)
            PressKey("s")
            Sleep(math.random(8700, 8900))
            ReleaseKey("s")
            Sleep(2)
            until not IsKeyLockOn("Numlock")
      end
   end

this code doesn't work for some reason, I tried using mouse button instead of numlock but no luck

0

There are 0 best solutions below