Reputation: 1
I'm trying to put the following two scripts together so that they can run at the same exact time.
EnablePrimaryMouseButtonEvents (true);
function OnEvent(event,arg)
if IsKeyLockOn("Capslock")then
if IsMouseButtonPressed(3)then
repeat
if IsMouseButtonPressed(1) then
repeat
MoveMouseRelative(-1,29)
Sleep(9)
until not IsMouseButtonPressed(1)
end
until not IsMouseButtonPressed(3)
end
end
end
and
MoveAmount = 2094
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(4) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
for x=1,10,1
do
MoveMouseRelative(MoveAmount, 0)
Sleep(5)
end
end
end
I've tried combining the scripts by leaving a space between them and placing the second one under it but had no luck.
It doesn't result in the scripts being executed simultaneously.
Right now only the second script works but I want them both to work at the same time.
So my goal is to have both LUA scripts running at the same time in Logitech GHUB.
Upvotes: -5
Views: 43