BobTheBuilder12 Posted July 31, 2017 Posted July 31, 2017 Hi DPIWizard, Just wondered what program you use to move the mouse a set distance (as in the explanation videos for mouse-sensitivity.com) Kind Regards (you're doing a great job!)
Wizard DPI Wizard Posted July 31, 2017 Wizard Posted July 31, 2017 Hi mate! To emulate mouse movement I mainly use Logitech's scripting through their G-series LUA API. This can be used with any Logitech G series mouse or keyboard with G-keys. The script can be something like this: if (event == "G_PRESSED" and arg == 1) and GetMKeyState() == 1 then for i = 0, 799 do MoveMouseRelative(10,0) Sleep(10) end end This will make the G1 button on the keyboard execute the code when also the M1 button is selected. The script will send 800 (0-799) packets to the operating system with a 10 ms delay between each. And each packet tells the OS to move the mouse 10 counts on the X+ axis (to the right). So in totalt the mouse will move 8000 counts to to right. I also use a Teensy USB board which can emulate a mouse. This is doing the exact same thing with a slightly different scripting language, but this device is emulating the mouse movement exactly like mouse hardware before sending it through the USB port, while the Logitech solution emulates it in software on the computer. In some cases using the Teensy might be advantageous because it fires less processes on the computer. In most cases though, using the Logitech solution works perfectly fine. I also have a machine that physically moves the mouse with 0.1 mm accuracy that I use to test equipment and verify that the theory matches the fact.
Sngop Posted August 1, 2017 Posted August 1, 2017 (edited) 19 hours ago, DPI Wizard said: Hi mate! To emulate mouse movement I mainly use Logitech's scripting through their G-series LUA API. This can be used with any Logitech G series mouse or keyboard with G-keys. The script can be something like this: if (event == "G_PRESSED" and arg == 1) and GetMKeyState() == 1 then for i = 0, 799 do MoveMouseRelative(10,0) Sleep(10) end end This will make the G1 button on the keyboard execute the code when also the M1 button is selected. The script will send 800 (0-799) packets to the operating system with a 10 ms delay between each. And each packet tells the OS to move the mouse 10 counts on the X+ axis (to the right). So in totalt the mouse will move 8000 keyboard, to to right. I also use a Teensy USB board which can emulate a mouse. This is doing the exact same thing with a slightly different scripting language, but this device is emulating the mouse movement exactly like mouse hardware before sending it through the USB port, while the Logitech solution emulates it in software on the computer. In some cases using the Teensy might be advantageous because it fires less processes on the computer. In most cases though, using the Logitech solution works perfectly fine. I also have a machine that physically moves the mouse with 0.1 mm accuracy that I use to test equipment and verify that the theory matches the fact. 5 I try the script, nothing move I try to change a key by changing arg == 1 to the number of the G key, still nothing work can u explain why, please btw i don't have Logitech keyboard, I have G600 mouse this is what is the code if (event == "G_PRESSED" and arg == 11) and GetMKeyState() == 1 then Edited August 1, 2017 by Sngop
Wizard DPI Wizard Posted August 1, 2017 Wizard Posted August 1, 2017 Sorry, that was just the code snippet, and not the entire script For keyboards this is the entire script: function OnEvent(event, arg) if (event == "G_PRESSED" and arg == 1) and GetMKeyState() == 1 then for i = 0, 99 do MoveMouseRelative(10,0) Sleep(10) end end end And for a mouse, use this (assigning to button 5): function OnEvent(event, arg) if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then for i = 0, 99 do MoveMouseRelative(10,0) Sleep(10) end end end The G keys on the mouse are targeted like this, and not with the G_PRESSED syntax. Sngop 1
WhoCares? Posted August 2, 2017 Posted August 2, 2017 Maybe this programm will work. But be warned, since it is an external program it might trigger VAC or stuff http://www.coksoft.com/mouse-emulator.htm
Wizard DPI Wizard Posted August 2, 2017 Wizard Posted August 2, 2017 I have tested that program, it does not work in-game as far as I know, just on the desktop. Unless you have to do some tricks, didn't play around much with it.
Fluffy Kalashnikov Posted April 7, 2020 Posted April 7, 2020 (edited) Hello, I experimented with a similar script and CS:GO doesn't like it :cccc 360DistanceScript.lua Edit: I fixed it, it automatically switched to profile to the game I played for, which ment that I played on a profile without the script enabled. Huge thanks anyway for this post! Edited April 7, 2020 by Fluffy Kalasjnikov
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now