daily pastebin goal
90%
SHARE
TWEET

Para querido samuelzinho

a guest Jan 20th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --------------------------------------------------------------------------
  2. ----------------        Basic Variable       -----------------------------
  3. ----------------         Do not edit                 ---------------------
  4. --------------------------------------------------------------------------
  5. local current_weapon = "none"
  6.  
  7. --------------------------------------------------------------------------
  8. ----------------        Basic Setting       ------------------------------
  9. --------------------------------------------------------------------------
  10.  
  11. ---- key bind ----
  12.  
  13. local ump9_key = 7
  14. local akm_key = 5
  15. local m16a4_key = nil
  16. local m416_key = 4
  17. local scarl_key = 8
  18. local qbz_key = nil
  19. local uzi_key = nil
  20. local set_off_key = 6
  21.  
  22. ---- keyboard ---- Only Support logitech G Keyboard
  23. local fire_key = "F8"
  24.  
  25. local ump9_gkey = nil  ---1 is use F1.
  26. local akm_gkey = nil
  27. local m16a4_gkey = nil
  28. local m416_gkey = nil
  29. local set_off_key = 6
  30. local scarl_gkey = nil
  31. local uzi_gkey = nil
  32. local set_off_gkey = nil
  33.  
  34. ---- fire key ----
  35. local ump9_key = 7
  36.  
  37.  
  38. ---- can use "lalt", "ralt", "alt"  "lshift", "rshift", "shift"  "lctrl", "rctrl", "ctrl"
  39.  
  40. local ignore_key = "lalt" --- ignore key
  41. local hold_breath_key = "lshift"
  42.  
  43. ---- only can use "numlock", "capslock", "scrolllock"
  44.  
  45. local full_mode_key = "numlock"   ---numlock lamp on,recoil is full_mode.
  46. local mode_switch_key = "capslock"
  47. local lighton_key = "scrolllock"  ---start script,scrolllock lamp will be on.close script ,scrolllock lamp will be off.
  48.  
  49. --- fastloot setting---
  50. --- Press fast_loot_key and click Left mouse button ---
  51.  
  52. local fastloot = false ---if you don't need it, you can close it by true to false.
  53. local fast_loot_key = "lctrl"
  54. local move = 40 ----1920*1080
  55.  
  56. --- Your Sensitivity in Game
  57.  
  58. local vertical_sensitivity = 1.0 --- default is 0.7
  59. local target_sensitivity = 50 --- default is 50.0
  60. local scope_sensitivity = 50 --- default is 50.0
  61. local scope4x_sensitivity = 50 --- default is 50.0
  62.  
  63. ---- function ----
  64. -- if auto_mode = true ,the guns need to switch automatic shooting mode,except m16 single.
  65.  
  66. local auto_mode = true
  67.  
  68. -- you can close these by true to false
  69.  
  70. local hold_breath_mode = true
  71. local full_mode = true
  72.  
  73. ---- Obfs setting
  74. ---- Two firing time intervals = weapon_speed * interval_ratio * ( 1 + random_seed * ( 0 ~ 1))
  75. local weapon_speed_mode = false
  76. -- local obfs_mode = false
  77. local obfs_mode = false
  78. local interval_ratio = 0.75
  79. local random_seed = 1
  80.  
  81. --------------------------------------------------------------------------
  82. ----------------        Recoil Table        ------------------------------
  83. ---------------- You can fix the value here ------------------------------
  84. --------------------------------------------------------------------------
  85. --- recoil times
  86. --- if the Recoil compensation is Large or small,You can modify the value of all_recoil_Times or recoil_table{times}
  87. local all_recoil_times = 1
  88.  
  89. local recoil_table = {}
  90.  
  91. recoil_table["ump9"] = {
  92.     basic={33.5,19.2,30.5,35.7,39.3, 39.0,38.7,40.2,41.8,44.0, 43.8,43.8,46.5,44.5,47.5},
  93.     basictimes = 0.80,
  94.    
  95.     full={33.5,19.2,30.5,35.7,39.3, 39.0,38.7,40.2,41.8,44.0, 43.8,43.8,46.5,44.5,47.5},
  96.     fulltimes = 0.75*0.9,
  97.    
  98.     holdbreathtimes = 1.25,
  99.    
  100.     quadruple={33.5,19.2,30.5,35.7,39.3, 39.0,38.7,40.2,41.8,44.0, 43.8,43.8,46.5,44.5,47.5},
  101.     quadrupletimes = 4*1*0.97,
  102.    
  103.     fullof4x={33.5,19.2,30.5,35.7,39.3, 39.0,38.7,40.2,41.8,44.0, 43.8,43.8,46.5,44.5,47.5},
  104.     fullof4xtimes = 4*0.75,
  105.    
  106.     speed = 90,
  107.  
  108.     maxbullets = 40,
  109. }
  110.  
  111. recoil_table["akm"] = {
  112.     basic={60.5,40.5,47.5,51.0,55.5, 64.0,67.5,69.5,70.5,71.0, 72.5,75.6,76.3,77.0,78.9,
  113.     80.6,70.5,},
  114.     basictimes = 1.01,
  115.    
  116.     full={60.5,40.5,47.5,51.0,54.5, 64.0,67.5,69.0,70.5,71.0, 71.5,75.6,76.3,77.0,78.9,
  117.     80.6,70.5,},
  118.    
  119.     holdbreathtimes = 1.25,
  120.    
  121.     quadruple={60.5,40.5,47.5,51.0,54.5, 64.0,67.5,69.0,70.5,71.0, 71.5,75.6,76.3,77.0,78.9,
  122.     80.6,70.5,},
  123.     quadrupletimes = 4*1.01,
  124.    
  125.     fullof4x={60.5,40.5,47.5,51.0,54.5, 64.0,67.5,69.0,70.5,71.0, 71.5,75.6,76.3,77.0,78.9,
  126.     80.6,70.5,},
  127.     fullof4xtimes = 4*1*0.75,
  128.    
  129.     speed = 100,
  130.  
  131.     maxbullets = 40,
  132. }
  133.  
  134.  
  135. recoil_table["m16a4"] = {
  136.     basic={41.9,36.5,37.1,50.5,55.9, 62.9,66.9,69.5,69.5,70.0, 71.2,},
  137.     basictimes = 1.05,
  138.        
  139.     full={41.9,36.5,37.1,50.5,55.9, 62.9,66.9,69.5,69.5,70.0, 71.2,},
  140.     fulltimes = 1*0.77,
  141.    
  142.     holdbreathtimes = 1.25,
  143.    
  144.     quadruple={41.9,36.5,37.1,50.5,55.9, 62.9,66.9,69.5,69.5,70.0, 71.2,},
  145.     quadrupletimes = 1*4,
  146.    
  147.     fullof4x={41.9,36.5,37.1,50.5,55.9, 62.9,66.9,69.5,69.5,70.0, 71.2,},
  148.     fullof4xtimes = 4*1*0.75,
  149.  
  150.     speed = 75,
  151.  
  152.     maxbullets = 40,
  153. }
  154.  
  155. recoil_table["m416"] = {
  156.     basic={49.5,36.0,41.9,44.3,49.4, 51.1,53.4,53.9,54.1,55.6, 56.5,58.5,62.3,60.4,60.8,
  157.     60.3,},
  158.     basictimes = 0.90,
  159.    
  160.     full={50.2,39.0,41.3,43.4,48.0, 50.0,52.2,52.5,53.5,50.5, 51.5,53.8,59.6,59.8,60.8,
  161.     60.3,},
  162.     fulltimes = 1.08*0.75, 
  163.    
  164.     holdbreathtimes = 1.25,
  165.    
  166.     quadruple={50.2,39.0,41.3,43.4,48.0, 50.0,52.2,52.5,53.5,50.5, 51.5,53.8,59.6,59.8,60.8,
  167.     60.3,},
  168.     quadrupletimes = 4*1*0.8,
  169.    
  170.     fullof4x={50.2,39.0,41.3,43.4,48.0, 50.0,52.2,52.5,53.5,50.5, 51.5,53.8,59.6,59.8,60.8,
  171.     60.3,},
  172.     fullof4xtimes = 4*1.08*0.75,
  173.    
  174.     speed = 90,
  175.  
  176.     maxbullets = 40,
  177. }
  178.  
  179. recoil_table["scarl"] = {
  180.     basic={59.0,28.5,33.5,42.0,45.9, 47.9,50.0,54.2,56.8,57.4, 57.9,57.5,57.7,58.8,59.4},
  181.     basictimes = 0.80,
  182.  
  183.     full={59.0,28.5,33.5,42.0,45.9, 47.9,50.0,54.2,56.8,57.4, 57.9,57.5,57.7,58.8,59.4},
  184.     fulltimes = 1*0.75,
  185.    
  186.     holdbreathtimes = 1.25,
  187.    
  188.     quadruple={59.0,28.5,33.5,42.0,45.9, 47.9,50.0,54.2,56.8,57.4, 57.9,57.5,57.7,58.8,59.4},
  189.     quadrupletimes = 4*1,
  190.    
  191.     fullof4x={59.0,28.5,33.5,42.0,45.9, 47.9,50.0,54.2,56.8,57.4, 57.9,57.5,57.7,58.8,59.4},
  192.     fullof4xtimes = 4*1*0.75,
  193.    
  194.     speed = 100,
  195.  
  196.     maxbullets = 40,
  197. }
  198.  
  199. recoil_table["uzi"] = {
  200.     basic={16.0,16.0,16.0,17.6,18.6, 20.4,22.4,22.9,25.8,27.6, 32.6,36.9,38.0,38.8,39.8,40.5},
  201.     basictimes = 1.15,
  202.    
  203.     full={16.0,16.0,16.0,17.6,18.6, 20.4,22.4,22.9,25.8,27.6, 32.6,36.9,38.0,38.8,39.8,40.5},
  204.     fulltimes = 1.15*0.75*0.75,
  205.    
  206.     holdbreathtimes = 1.25,
  207.    
  208.     quadruple={16.0,16.0,16.0,17.6,18.6, 20.4,22.4,22.9,25.8,27.6, 32.6,36.9,38.0,38.8,39.8,40.5},
  209.     quadrupletimes = 1.15,
  210.    
  211.     fullof4x={16.0,16.0,16.0,17.6,18.6, 20.4,22.4,22.9,25.8,27.6, 32.6,36.9,38.0,38.8,39.8,40.5},
  212.     fullof4xtimes = 1.15*0.75*0.75,
  213.  
  214.     speed = 48,
  215.  
  216.     maxbullets = 35,
  217. }
  218.  
  219. recoil_table["qbz"] = {
  220.     basic={52.0,25.0,28.7,38.2,42.4, 44.0,46.0,46.0,45.6,45.1, 48.0,51.3,52.0,54.0,56.0, 59},
  221.     basictimes = 1.06,
  222.    
  223.     full={51.2,24.5,28.7,38.2,42.4, 43.3,45.2,45.2,45.6,45.1, 48.0,50.3,51.0,53.0,55.0},
  224.     fulltimes = 1.06*0.75,
  225.    
  226.     holdbreathtimes = 1.25,
  227.    
  228.     quadruple={51.2,24.5,28.7,38.2,42.4, 43.3,45.2,45.2,45.6,45.1, 48.0,50.3,51.0,53.0,55.0},
  229.     quadrupletimes = 4*1.06,
  230.    
  231.     fullof4x={51.2,24.5,28.7,38.2,42.4, 43.3,45.2,45.2,45.6,45.1, 48.0,50.3,51.0,53.0,55.0},
  232.     fullof4xtimes = 4*1.06*0.75,
  233.    
  234.     speed = 90,
  235.  
  236.     maxbullets = 40,
  237. }
  238.  
  239.  
  240. --------------------------------------------------------------------------
  241. ----------------          Function          ------------------------------
  242. --------------------------------------------------------------------------
  243.  
  244.  
  245. function convert_sens(unconvertedSens)
  246.     return 0.002 * math.pow(10, unconvertedSens / 50)
  247. end
  248.  
  249. function calc_sens_scale(sensitivity)
  250.     return convert_sens(sensitivity)/convert_sens(50)
  251. end
  252.  
  253. local target_scale = calc_sens_scale(target_sensitivity)
  254. local scope_scale = calc_sens_scale(scope_sensitivity)
  255. local scope4x_scale = calc_sens_scale(scope4x_sensitivity)
  256.  
  257. function recoil_mode()
  258.     if not IsKeyLockOn(mode_switch_key) then
  259.         if IsKeyLockOn(full_mode_key) and full_mode then
  260.            return "full";
  261.            else
  262.            return "basic";
  263.         end
  264.     end
  265.    
  266.     if IsKeyLockOn(mode_switch_key) then
  267.         if IsKeyLockOn(full_mode_key) and full_mode then
  268.            return "fullof4x"
  269.            else
  270.            return "quadruple"
  271.         end
  272.     end    
  273. end
  274.            
  275. function recoil_value(_weapon,_duration)
  276.     local _mode = recoil_mode()
  277.     if weapon_speed_mode then
  278.         weapon_speed = recoil_table[_weapon]["speed"]
  279.     end
  280.     -- OutputLogMessage("weapon_speed = %s\n", weapon_speed)
  281.  
  282.     local weapon_basictimes = recoil_table[_weapon]["basictimes"]
  283.     local weapon_fulltimes = recoil_table[_weapon]["fulltimes"]
  284.     local weapon_quadrupletimes = recoil_table[_weapon]["quadrupletimes"]
  285.     local step = (math.floor(_duration/100)) + 1
  286.     if step > #recoil_table[_weapon][_mode] then
  287.         step = #recoil_table[_weapon][_mode]
  288.     end
  289.    
  290.     local weapon_recoil = recoil_table[_weapon][_mode][step]
  291.     -- OutputLogMessage("weapon_recoil = %s\n", weapon_recoil)
  292.    
  293.     local weapon_speed = 30
  294.     local weapon_fullof4xtimes = recoil_table[_weapon]["fullof4xtimes"]
  295.     local weapon_holdbreathtimes = recoil_table[_weapon]["holdbreathtimes"]
  296.     local weapon_intervals = weapon_speed    
  297.    
  298.     if obfs_mode then
  299.         local coefficient = interval_ratio * ( 1 + random_seed * math.random())
  300.         weapon_intervals = math.floor(coefficient  * weapon_speed)
  301.     end
  302.     -- OutputLogMessage("weapon_intervals = %s\n", weapon_intervals)
  303.  
  304.     recoil_recovery = weapon_recoil * weapon_intervals / 100
  305.     recoil_times = all_recoil_times * 0.7 / vertical_sensitivity
  306.  
  307.     if recoil_mode() == "basic" and not IsModifierPressed(hold_breath_key) then
  308.     recoil_recovery = recoil_recovery * recoil_times * weapon_basictimes
  309.     end
  310.     if recoil_mode() == "basic" and hold_breath_mode and IsModifierPressed(hold_breath_key) then
  311.     recoil_recovery = recoil_recovery * weapon_holdbreathtimes * recoil_times * weapon_basictimes
  312.     end
  313.  
  314.     if recoil_mode() == "full" and not IsModifierPressed(hold_breath_key) then
  315.     recoil_recovery = recoil_recovery * recoil_times * weapon_fulltimes
  316.     end
  317.     if recoil_mode() == "full" and hold_breath_mode and IsModifierPressed(hold_breath_key) then
  318.     recoil_recovery = recoil_recovery * weapon_holdbreathtimes * recoil_times * weapon_fulltimes
  319.     end
  320.  
  321.     if recoil_mode() == "quadruple" then
  322.     recoil_recovery = recoil_recovery * recoil_times * weapon_quadrupletimes
  323.     end
  324.    
  325.     if recoil_mode() == "fullof4x" then
  326.     recoil_recovery = recoil_recovery * recoil_times * weapon_fullof4xtimes
  327.     end
  328.    
  329.     -- issues/3
  330.     if IsMouseButtonPressed(2) then
  331.         recoil_recovery = recoil_recovery / target_scale
  332.     elseif recoil_mode() == "basic" then
  333.         recoil_recovery = recoil_recovery / scope_scale
  334.     elseif recoil_mode() == "full" then
  335.         recoil_recovery = recoil_recovery / scope_scale
  336.     elseif recoil_mode() == "quadruple" then
  337.         recoil_recovery = recoil_recovery / scope4x_scale
  338.     elseif recoil_mode() == "fullof4x" then
  339.         recoil_recovery = recoil_recovery / scope4x_scale
  340.     end
  341.  
  342.     return weapon_intervals,recoil_recovery
  343. end
  344.  
  345.  
  346. --------------------------------------------------------------------------
  347. ----------------          OnEvent          ------------------------------
  348. --------------------------------------------------------------------------
  349.  
  350.  
  351. function OnEvent(event, arg)
  352.     OutputLogMessage("event = %s, arg = %d\n", event, arg)
  353.     if (event == "PROFILE_ACTIVATED") then
  354.         EnablePrimaryMouseButtonEvents(true)
  355.     elseif event == "PROFILE_DEACTIVATED" then
  356.         current_weapon = "none"
  357.         shoot_duration = 0.0
  358.         ReleaseKey(fire_key)
  359.         ReleaseMouseButton(1)
  360.     end
  361.  
  362.     if (event == "MOUSE_BUTTON_PRESSED" and arg == set_off_key)
  363.     or (event == "G_PRESSED" and arg == set_off_gkey) then
  364.         current_weapon = "none"
  365.     elseif (event == "MOUSE_BUTTON_PRESSED" and arg == akm_key)
  366.     or (event == "G_PRESSED" and arg == akm_gkey) then
  367.         current_weapon = "akm"
  368.     elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m16a4_key)
  369.     or (event == "G_PRESSED" and arg == m16a4_gkey) then
  370.         current_weapon = "m16a4"
  371.     elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m416_key)
  372.     or (event == "G_PRESSED" and arg == m416_gkey) then
  373.         current_weapon = "m416"
  374.     elseif (event == "MOUSE_BUTTON_PRESSED" and arg == ump9_key)
  375.     or (event == "G_PRESSED" and arg == ump9_gkey) then
  376.         current_weapon = "ump9"
  377.     elseif (event == "MOUSE_BUTTON_PRESSED" and arg == uzi_key)
  378.     or (event == "G_PRESSED" and arg == uzi_gkey) then
  379.         current_weapon = "uzi"
  380.     elseif (event == "MOUSE_BUTTON_PRESSED" and arg == scarl_key)
  381.     or (event == "G_PRESSED" and arg == scarl_gkey) then
  382.         current_weapon = "scarl"
  383.     elseif (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and not IsModifierPressed(fast_loot_key)) then
  384.         -- button 1 : Shoot
  385.         if ((current_weapon == "none") or IsModifierPressed(ignore_key)) then
  386.             PressKey(fire_key)
  387.             repeat
  388.                 Sleep(30)
  389.             until not IsMouseButtonPressed(1)
  390.             ReleaseKey(fire_key)
  391.         elseif((current_weapon == "m16a4") and not IsModifierPressed(ignore_key)) then
  392.             local shoot_duration = 0.0
  393.             repeat
  394.                 local intervals,recovery = recoil_value(current_weapon,shoot_duration)
  395.                 PressAndReleaseKey(fire_key)
  396.                 MoveMouseRelative(0, recovery )
  397.                 Sleep(intervals)
  398.                 shoot_duration = shoot_duration + intervals
  399.             until not IsMouseButtonPressed(1)
  400.         else
  401.             if auto_mode then
  402.                 PressKey(fire_key)
  403.                 local shoot_duration = 0.0
  404.                 repeat
  405.                 local intervals,recovery = recoil_value(current_weapon,shoot_duration)
  406.                 MoveMouseRelative(0, recovery )
  407.                 Sleep(intervals)
  408.                 shoot_duration = shoot_duration + intervals
  409.                 until not IsMouseButtonPressed(1)
  410.             else
  411.                 local shoot_duration = 0.0
  412.                 repeat
  413.                 local intervals,recovery = recoil_value(current_weapon,shoot_duration)
  414.                 PressAndReleaseKey(fire_key)
  415.                 MoveMouseRelative(0, recovery )
  416.                 Sleep(intervals)
  417.                 shoot_duration = shoot_duration + intervals
  418.                 until not IsMouseButtonPressed(1)
  419.             end
  420.         end
  421.     elseif (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then
  422.         ReleaseKey(fire_key)
  423.     end
  424.     while (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and IsModifierPressed(fast_loot_key) and fastloot) do
  425.         ReleaseMouseButton(1)
  426.         PressMouseButton(1)
  427.         for i = 0, 14 do
  428.         MoveMouseRelative(move, 0)
  429.         Sleep(2)
  430.         end
  431.         ReleaseMouseButton(1)
  432.         for i = 0, 14 do
  433.         MoveMouseRelative(-move, 0)
  434.         Sleep(2)
  435.         end
  436.         Sleep(10)
  437.     end
  438.     if (current_weapon == "none") then
  439.         if IsKeyLockOn(lighton_key) then
  440.         PressAndReleaseKey(lighton_key)
  441.         end
  442.     else
  443.         if not IsKeyLockOn(lighton_key) then
  444.         PressAndReleaseKey(lighton_key)
  445.         end
  446.     end
  447. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top