Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- DayZ auto run and auto sprint script for Logitech G510 keyboard.
- Version: 1.0
- Created by Durux, admin on EU13 Spongebob Squarepants server.
- Info:
- The script uses M1-G8 for auto run and M1-G7 for auto sprint.
- If needed to change the key setup, change the 8 or 7 in:
- if (event == "G_PRESSED" and arg == 8) then
- or
- if (event == "G_PRESSED" and arg == 7) then
- If you want to change the time the information is diplayed on the LCD, change:
- iLCDTimer = 5000;
- The time is in Miliseconds, so 5000 is 5 seconds.
- ]]
- bAutoRun = false;
- bAutoSprint = false;
- sAutoRun = "OFF";
- sAutoSprint = "OFF";
- iLCDTimer = 5000;
- function OnEvent(event, arg)
- current_mkey = GetMKeyState();
- if (current_mkey == 1) then
- if (event == "G_PRESSED" and arg == 8) then
- AutoRun();
- end
- if (event == "G_PRESSED" and arg == 7) then
- AutoSprint();
- end
- end
- end
- function AutoRun()
- local outputLCD;
- if (bAutoSprint == true) then
- ReleaseKey("w");
- bAutoSprint = false;
- sAutoSprint = "OFF";
- end
- if (bAutoRun == false) then
- sAutoRun = "ON";
- bAutoRun = true;
- outputLCD = string.format("Auto run: %s\nAuto Sprint: %s", sAutoRun, sAutoSprint);
- ClearLCD();
- OutputLCDMessage(outputLCD, iLCDTimer);
- PressKey("w");
- else
- sAutoRun = "OFF";
- bAutoRun = false;
- outputLCD = string.format("Auto run: %s\nAuto Sprint: %s", sAutoRun, sAutoSprint);
- ClearLCD();
- OutputLCDMessage(outputLCD, iLCDTimer);
- ReleaseKey("w");
- end
- end
- function AutoSprint()
- local outputLCD;
- if (bAutoRun == true) then
- ReleaseKey("w");
- bAutoRun = false;
- sAutoRun = "OFF";
- end
- if (bAutoSprint == false) then
- sAutoSprint = "ON";
- bAutoSprint = true;
- outputLCD = string.format("Auto run: %s\nAuto Sprint: %s", sAutoRun, sAutoSprint);
- ClearLCD();
- OutputLCDMessage(outputLCD, iLCDTimer);
- PressAndReleaseKey("w");
- Sleep(50);
- PressKey("w");
- else
- sAutoSprint = "OFF";
- bAutoSprint = false;
- outputLCD = string.format("Auto run: %s\nAuto Sprint: %s", sAutoRun, sAutoSprint);
- ClearLCD();
- OutputLCDMessage(outputLCD, iLCDTimer);
- ReleaseKey("w");
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement