r6.lua

an anonymous user · January 13, 2022
print 'hello world!'
     -- ////////////////////////////////////////////////
     -- ////////////// IMPORTANT README  //////////////
     -- //////////////////////////////////////////////
     
    -- ////  EVERYONES COMPUTER IS DIFFERENT, WITH DIFFERENT RESOLUTIONS AND MOUSE SENSITIVITIES
    -- ////  this probably wont work perfect for you OUT OF THE BOX. You need to set this up. 
     
    -- //// This script is enabled by NUMLOCK, and you can change guns via CAPSLOCK                 ////
    -- //// you can change the controls, or download autohotkey and move those controls anywhere    ////
     
     
    -- /////////// How it works /////////
     
    -- //// This script moves the mouse down (x) pixels, then sleeps for (x) number of miliseconds, then repeats
    -- //// There are only so many pixels, Changing how many pixels the mouse moves is a broad adjustment
    -- //// to REFINE the recoil, you need to adjust the SLEEP Settings, or miliseconds between mouse movements
     
    -- //// this script also has a MINIMUM and MAXIMUM to create a random generator between the two
    -- //// Lets say you want the recoil mouse movement to be (14). Probably set MIN at 13 and MAX at 15
     
     
     -- /////////////////////////////////////////////////
     -- ////////////// Recoil  Settings  ///////////////
     -- ///////////////////////////////////////////////
     
     
     
     HighRecoilGunmMouseMoveMin=6            --Change this	// Minimum and Maximum Pixel distance the mouse will be pulled down, assisting recoil.    
     HighRecoilGunmMouseMoveMax=6            --             // NO decimals. Use SLEEP (different setting) for fine adjustments
     
     HighRecoilSleepMin=4	                 --Change this	// Delay in miliseconds between each time Recoil min/Max moves your mouse           
     HighRecoilSleepMax=6		             --             // see explanation in recoil control section at the top for details
     
     
     
     LowRecoilGunMouseMoveMin=2              --Change this   // Minimum and Maximum Pixel distance the mouse will be pulled down, assisting recoil.    
     LowRecoilGunMouseMoveMax=4              --              // NO decimals. Use SLEEP (different setting) for fine adjustments
     
     LowRecoilSleepMin=2	                    --Change this	// Delay in miliseconds between each time Recoil min/Max moves your mouse           
     LowRecoilSleepMax=4		                --              // see explanation in recoil control section at the top for details
     
     
     HorizontalRecoilModifier=0	            --Change this   // If your recoil pulls to the left by default, use "-1". If your recoil moves right, try 1. 
     --                                                      // most guns in R6 have vertical recoil only or pull to the left 
                             
    -- ////////////////////////////////////////
    -- ////////////// Controls ///////////////
    -- ///////////////////////////////////////
     
    LockKey="scrolllock"                        --Change this   // Options for binding include "scrolllock" "capslock" and "numlock" 
                                             --              // This will turn on/off the script
     
    HighRecoilToggle="capslock"                 --Change this   // Options for binding include "scrolllock" "capslock" and "numlock" 
                                             --              // This toggles between High Powered Lots of recoil guns (ON) and guns with not a lot of recoil
                                             --              // When ON this will pull the mouse down more
     
     
    --  ///////////// Mouse Buttons, only change if you dont shoot with LeftClick and aim with Right Click /////////////
     
    LC=1		                                --Change this   // 1 = Left Click, 2= Middle Mouse, 3= Right Click, 4 = X1 Mouse Button, 5= X2 Mouse Button
    RC=3	                                    --              // LC = Fire button, RC = Aim Button
                                 
     
     
    -- /////////////// editing this section without experiance will break the code ////////////////
    DelayMouseMovementsMin=0		 		
    DelayMouseMovementsMax=0
    MoveMouseMin=0				 
    MoveMouseMax=0		
    -- /////////////// editing this section without experiance will break the code ////////////////
     
    function GunSelection()
     if IsKeyLockOn(HighRecoilToggle)then
         MoveMouseMin=HighRecoilGunmMouseMoveMin
         MoveMouseMax=HighRecoilGunmMouseMoveMax
         DelayMouseMovementsMin=HighRecoilSleepMin
         DelayMouseMovementsMax=HighRecoilSleepMax
    	Sleep(5)
     else
     MoveMouseMin=LowRecoilGunMouseMoveMin
     MoveMouseMax=LowRecoilGunMouseMoveMax
     DelayMouseMovementsMin=LowRecoilSleepMin          
     DelayMouseMovementsMax=LowRecoilSleepMax
    Sleep(5)
     end
     end
     
    -- /////////////// editing this section without experiance will break the code ////////////////
     
     function NoRecoil()
        if IsMouseButtonPressed(LC) then 
                 repeat                 
                         MoveMouseRelative(HorizontalRecoilModifier,math.random(MoveMouseMin,MoveMouseMax))
                         Sleep(math.random(DelayMouseMovementsMin,DelayMouseMovementsMax))
                 until not IsMouseButtonPressed(LC)
             end
            end
     
     
    -- /////////////// editing this section without experiance will break the code ////////////////
     
    EnablePrimaryMouseButtonEvents(true);
    function OnEvent(event,arg)
     if IsKeyLockOn(LockKey)then
                if IsMouseButtonPressed(RC) then 
                    repeat 
                        if IsMouseButtonPressed(LC)then
                                GunSelection()
                                NoRecoil()  
                            else
                                    Sleep(2)
                            end
                     until not IsMouseButtonPressed(RC)
                    end
    end
    end
Output

Comments

Please sign up or log in to contribute to the discussion.