Bread
Bread

Reputation: 1

lghub lua script presskey

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 doesnt 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 doesnt work for some reason, i tried using mouse button instead of numlock but no luck

Upvotes: 0

Views: 181

Answers (0)

Related Questions