Hey everyone,
I have designed 2 anti recoil scripts for my G900 which are activated/deactivated by 2 different buttons and was wondering could I combine them? I have implemented the use of G-Max as well to play a sound when they are turned on and off, but cannot figure out how to put the 2 codes together. I tried a simple cut and paste, one into another but that did not work. I am guessing some sort of statement is needed to join the 2? Any help would be greatly appreciated. If it cannot be done and I need to keep it separate, please do let me know.
Script 1
Code:
EnablePrimaryMouseButtonEvents(true)
local recoil = not true;
OutputLogMessage("PROFILE LOADED ")
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
mb1_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then
mb1_pressed = false
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then
mb2_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then
mb2_pressed = false
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 6 and recoil then
recoil = not true
OutputLogMessage("NR-OFF ")
OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/Shell.wav" )]])
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 6 then
recoil = not recoil
OutputLogMessage("NR-ON ")
OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/M4A1.wav" )]])
end
--
if mb1_pressed and recoil then
repeat
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(3,31)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-11,32)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(13,42)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-17,47)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-9,53)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(32,31)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(21,25)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(43,10)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-8,22)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-35,12)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-60,-9)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-48,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-52,-12)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(0,8)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(18,10)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-22,1)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-30,-6)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(6,4)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(69,1)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(20,13)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(53,5)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(18,4)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(23,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(-22,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(11,10)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(8,10)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(6,1)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(9,-2)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
MoveMouseRelative(0,1)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(44)
ReleaseKey("M")
Sleep(44)
if not IsMouseButtonPressed(1) then break end
until not IsMouseButtonPressed(1)
--
--
end
end
Script 2
Code:
EnablePrimaryMouseButtonEvents(true)
local recoil = not true;
OutputLogMessage("PROFILE LOADED ")
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
mb1_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then
mb1_pressed = false
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then
mb2_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then
mb2_pressed = false
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 7 and recoil then
recoil = not true
OutputLogMessage("NR-OFF ")
OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/Shell.wav" )]])
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 7 then
recoil = not recoil
OutputLogMessage("NR-ON ")
OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/AK47.wav" )]])
end
--
if mb1_pressed and recoil then
repeat
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(7,51)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-5,58)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-2,61)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(25,65)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(16,55)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(26,39)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-33,29)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-84,-8)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-44,5)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(26,22)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-31,12)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-52,-17)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-6,10)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(80,3)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(38,14)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(28,21)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(54,-3)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(66,-18)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-41,-5)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(12,6)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-12,19)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-18,7)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(38,-6)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(13,10)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-42,-1)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-65,-6)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-91,-42)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(-28,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,0)
MoveMouseRelative(0,-1)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
MoveMouseRelative(0,1)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
if not IsMouseButtonPressed(1) then break end
PressKey("M")
Sleep(49)
ReleaseKey("M")
Sleep(49)
if not IsMouseButtonPressed(1) then break end
until not IsMouseButtonPressed(1)
--
--
end
end