Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.25 KB | None | 0 0
  1. ------------------------------------- ---------------------
  2. --------------------------------------------------------------------------
  3. local current_weapon = "none"
  4.  
  5. --------------------------------------------------------------------------
  6. ---------------- Basic Setting ------------------------------
  7. --------------------------------------------------------------------------
  8.  
  9. ---- key bind ----
  10.  
  11. local ump9_key = 3
  12. local akm_key = 5
  13. local m16a4_key = nil
  14. local m416_key = 4
  15. ---------------- Basic Variable -----------------------------
  16. ---------------- Do not edit -------------------------------------
  17. local scarl_key = nil
  18. local uzi_key = nil
  19. local set_off_key = nil
  20.  
  21.  
  22. ---- fire key ----
  23.  
  24. local fire_key = "F8"
  25. local full_mode_key = "numlock"
  26. local mode_switch_key = "capslock"
  27.  
  28. ---- ignore key ----
  29. ---- can use "lalt", "ralt", "alt" "lshift", "rshift", "shift" "lctrl", "rctrl", "ctrl"
  30.  
  31. local ignore_key = "lalt"
  32.  
  33. --- Sensitivity in Game
  34. --- default is 50.0
  35.  
  36. local target_sensitivity = 53
  37. local scope_sensitivity = 53
  38. local full_sensitivity = 53
  39. local scope4x_sensitivity = 50
  40.  
  41. ---- Obfs setting
  42. ---- Two firing time intervals = weapon_speed * interval_ratio * ( 1 + random_seed * ( 0 ~ 1))
  43. local weapon_speed_mode = false
  44. -- local obfs_mode = false
  45. local obfs_mode = true
  46. local interval_ratio = 0.75
  47. local random_seed = 1
  48. -- local fullmode = false
  49. local fullmode = false
  50. --------------------------------------------------------------------------
  51. ---------------- Recoil Table ------------------------------
  52. ---------------- You can fix the value here ------------------------------
  53. --------------------------------------------------------------------------
  54.  
  55. local recoil_table = {}
  56.  
  57. recoil_table["ump9"] = {
  58. basic={28,30,30,30,37,30,31,36,37,37,37,40,40,39,39,41,41,42,44,42,43,40,41,44,40,40,41,42,43},
  59. full={0},
  60. quadruple={0},
  61. speed = 90
  62. }
  63.  
  64. recoil_table["akm"] = {
  65. basic={56,40,38,44,48,55,56,61,65,65,67,68,67,71,74,70,65,66,72,74,72,71,70,70,70,72,74,76,72},
  66. full={0},
  67. quadruple={0},
  68. speed = 100
  69. }
  70.  
  71. recoil_table["m16a4"] = {
  72. basic={47,35,38,44,58,61,70,67,73,74,72,69,72,71,72,70,72,70,69,71},
  73. full={0},
  74. quadruple={0},
  75. speed = 80
  76. }
  77.  
  78. recoil_table["m416"] = {
  79. basic={49,37,38,39,43,46,47,47,48,49,50,49,55,56,58,60},
  80. full={0},
  81. quadruple={},
  82. speed = 90
  83. }
  84.  
  85. recoil_table["scarl"] = {
  86. basic={44,28,32,40,44, 45,48,48,46,53, 54,56,58,57,56,62},
  87. full={0},
  88. quadruple={0},
  89. speed = 100
  90. }
  91.  
  92. recoil_table["uzi"] = {
  93. basic={18,18,18,19,19,21,24,24,30,26,30,30,34,34,38},
  94. full={0},
  95. quadruple={0},
  96. speed = 48
  97. }
  98.  
  99. recoil_table["none"] = {
  100. basic={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  101. quadruple={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
  102. speed = 60
  103. }
  104.  
  105.  
  106. --------------------------------------------------------------------------
  107. ---------------- Function ------------------------------
  108. --------------------------------------------------------------------------
  109.  
  110.  
  111. function convert_sens(unconvertedSens)
  112. return 0.002 * math.pow(10, unconvertedSens / 50)
  113. end
  114.  
  115. function calc_sens_scale(sensitivity)
  116. return convert_sens(sensitivity)/convert_sens(50)
  117. end
  118.  
  119. local target_scale = calc_sens_scale(target_sensitivity)
  120. local scope_scale = calc_sens_scale(scope_sensitivity)
  121. local full_scale = calc_sens_scale(full_sensitivity)
  122. local scope4x_scale = calc_sens_scale(scope4x_sensitivity)
  123.  
  124. function recoil_mode()
  125. if IsKeyLockOn(mode_switch_key) then
  126. return "quadruple";
  127. elseif IsKeyLockOn(full_mode_key) and fullmode then
  128. return "full"
  129. else
  130. return "basic";
  131. end
  132. end
  133.  
  134.  
  135. function recoil_value(_weapon,_duration)
  136. local _mode = recoil_mode()
  137. local step = (math.floor(_duration/100)) + 1
  138. if step > 40 then
  139. step = 40
  140. end
  141. local weapon_recoil = recoil_table[_weapon][_mode][step]
  142. -- OutputLogMessage("weapon_recoil = %s\n", weapon_recoil)
  143.  
  144. local weapon_speed = 30
  145. if weapon_speed_mode then
  146. weapon_speed = recoil_table[_weapon]["speed"]
  147. end
  148. -- OutputLogMessage("weapon_speed = %s\n", weapon_speed)
  149.  
  150. local weapon_intervals = weapon_speed
  151. if obfs_mode then
  152.  
  153. local coefficient = interval_ratio * ( 1 + random_seed * math.random())
  154. weapon_intervals = math.floor(coefficient * weapon_speed)
  155. end
  156. -- OutputLogMessage("weapon_intervals = %s\n", weapon_intervals)
  157.  
  158. recoil_recovery = weapon_recoil * weapon_intervals / 100
  159.  
  160. -- issues/3
  161. if IsMouseButtonPressed(2) then
  162. recoil_recovery = recoil_recovery / target_scale
  163. elseif recoil_mode() == "basic" then
  164. recoil_recovery = recoil_recovery / scope_scale
  165. elseif recoil_mode() == "full" then
  166. recoil_recovery = recoil_recovery / full_scale
  167. elseif recoil_mode() == "quadruple" then
  168. recoil_recovery= recoil_recovery / scope4x_scale
  169. end
  170.  
  171. return weapon_intervals,recoil_recovery
  172. end
  173.  
  174.  
  175. --------------------------------------------------------------------------
  176. ---------------- OnEvent ------------------------------
  177. --------------------------------------------------------------------------
  178.  
  179.  
  180. function OnEvent(event, arg)
  181. OutputLogMessage("event = %s, arg = %d\n", event, arg)
  182. if (event == "PROFILE_ACTIVATED") then
  183. EnablePrimaryMouseButtonEvents(true)
  184. elseif event == "PROFILE_DEACTIVATED" then
  185. current_weapon = "none"
  186. shoot_duration = 0.0
  187. ReleaseKey(fire_key)
  188. ReleaseMouseButton(1)
  189. end
  190.  
  191. if (event == "MOUSE_BUTTON_PRESSED" and arg == set_off_key) then
  192. current_weapon = "none"
  193. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == akm_key) then
  194. current_weapon = "akm"
  195. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m16a4_key) then
  196. current_weapon = "m16a4"
  197. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m416_key) then
  198. current_weapon = "m416"
  199. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == ump9_key) then
  200. current_weapon = "ump9"
  201. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == uzi_key) then
  202. current_weapon = "uzi"
  203. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == scarl_key) then
  204. current_weapon = "scarl"
  205. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
  206. -- button 1 : Shoot
  207. if ((current_weapon == "none") or IsModifierPressed(ignore_key)) then
  208. PressKey(fire_key)
  209. repeat
  210. Sleep(30)
  211. until not IsMouseButtonPressed(1)
  212. ReleaseKey(fire_key)
  213. else
  214. local shoot_duration = 0.0
  215. repeat
  216. local intervals,recovery = recoil_value(current_weapon,shoot_duration)
  217. PressAndReleaseKey(fire_key)
  218. MoveMouseRelative(0, recovery )
  219. Sleep(intervals)
  220. shoot_duration = shoot_duration + intervals
  221. until not IsMouseButtonPressed(1)
  222. end
  223. elseif (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then
  224. ReleaseKey(fire_key)
  225. end
  226.  
  227. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement