로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

EnablePrimaryMouseButtonEvents(true)

function OnEvent(event, arg)
    --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
  if (event == "MOUSE_BUTTON_PRESSED" and arg == 11) then
    repeat
      PressAndReleaseMouseButton(1)
      Sleep(1,2)
    until not MOUSE_BUTTON_PRESSED("11")
  end  
end

I did this, but an error appears on the first line, but I'm not sure what the problem is.

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

asked Feb 25 at 16:55

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

1

There are two mistakes:

  • Sleep(1,2) is incorrect:
    Sleep expects a single argument - an integer amount of milliseconds.
    For example, use Sleep(10)
  • MOUSE_BUTTON_PRESSED("11") is unknown function

If you want to determine whether button #11 is down:

  1. Assign a command "Back" to the mouse button #11 in the user interface of G Hub;
  2. Use IsMouseButtonPressed(4) in the script:
function OnEvent(event, arg)
    --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
  if event == "MOUSE_BUTTON_PRESSED" and arg == 11 then
    repeat
      PressAndReleaseMouseButton(1)
      Sleep(10)
    until not IsMouseButtonPressed(4)
  end  
end

answered Feb 25 at 18:05

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Egor SkriptunoffEgor Skriptunoff

22.7k2 gold badges34 silver badges62 bronze badges

0

Next steps are to install our script

Check your windows version. Press WindowsIcon+R and write winver.

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Choose the folder which is for your  Windows version.
(Note: It can happen that the other version works better for you. 
So first try the correct folder. If it's not work correct try the other version)

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Copy the script (Script folder) and paste it to a local drive.
(If you have only one local drive it's ok.)

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Now rename the file to world.
(or what ever you want but do not use words like hack, script, cheat)

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Now open the file with notepad and change the nil value from the weapon you want to use to a mouse button number.
(If you have a logitech g keyboard please click here for keyboard assignment)

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

After you have done the weapon assignment save the script and  Copy the code line below:

data = dofile[[D:\world.lua]] 

Open Logitech G-Hub as administrator and Click on "Profile" section (See picture below)

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Go the bottom left and click on "Scripting"

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

For creating a new Lua Script account press the blue button.

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Delete all codes and paste the code line which we have copied.

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu

Now change the code line if you add the script to a different local drive letter. For example if you copy-paste the script local drive C:
Change from the code line the D: to C: like below

data = dofile[[C:\world.lua]]

Same for the file name. If you give a different file name change it as well. (.lua is the file format do not delete it)

Now save with ctrl+s
With pressing the mouse button you have assign you can
Activate now the weapon.

Last step is to check that our profile is set as persistant. Go to Details of your profile and if not press the button to set it as Persistant. That's it! Enjoy!

로지텍 G Hub Lua 스크립트 - lojiteg G Hub Lua seukeulibteu