Advertisement
Guest User

Untitled

a guest
May 24th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.54 KB | None | 0 0
  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 = nil
  14. local akm_key = 7
  15. local m16a4_key = 6
  16. local m416_key = 8
  17. local scarl_key = nil
  18. local uzi_key = nil
  19. local set_off_key = 9
  20.  
  21. ---- keyboard ---- Only Support logitech G Keyboard
  22.  
  23. local ump9_gkey = nil ---1 is use F1.
  24. local akm_gkey = nil
  25. local m16a4_gkey = nil
  26. local m416_gkey = nil
  27. local scarl_gkey = nil
  28. local uzi_gkey = nil
  29. local set_off_gkey = nil
  30.  
  31. ---- fire key ----
  32.  
  33. local fire_key = "f8"
  34.  
  35. ---- can use "lalt", "ralt", "alt" "lshift", "rshift", "shift" "lctrl", "rctrl", "ctrl"
  36.  
  37. local ignore_key = "ralt" --- ignore key
  38. local hold_breath_key = "lshift"
  39.  
  40. ---- only can use "numlock", "capslock", "scrolllock"
  41.  
  42. local full_mode_key = "numlock" ---numlock lamp on,recoil is full_mode.
  43. local mode_switch_key = "capslock"
  44. local lighton_key = "scrolllock" ---start script,scrolllock lamp will be on.close script ,scrolllock lamp will be off.
  45.  
  46. --- fastloot setting---
  47. --- Press fast_loot_key and click Left mouse button ---
  48.  
  49. local fastloot = true ---if you don't need it, you can close it by true to false.
  50. local fast_loot_key = "lctrl"
  51. local move = 40 ----1920*1080
  52.  
  53. --- Your Sensitivity in Game
  54.  
  55. local vertical_sensitivity = 1.15 --- default is 0.7
  56. local target_sensitivity = 50 --- default is 50.0
  57. local scope_sensitivity = 35 --- default is 50.0
  58. local scope4x_sensitivity = 35 --- default is 50.0
  59.  
  60. ---- function ----
  61. -- if auto_mode = true ,the guns need to switch automatic shooting mode,except m16 single.
  62.  
  63. local auto_mode = true
  64.  
  65. -- you can close these by true to false
  66.  
  67. local hold_breath_mode = true
  68. local full_mode = true
  69.  
  70. ---- Obfs setting
  71. ---- Two firing time intervals = weapon_speed * interval_ratio * ( 1 + random_seed * ( 0 ~ 1))
  72. local weapon_speed_mode = false
  73. -- local obfs_mode = false
  74. local obfs_mode = false
  75. local interval_ratio = 0.75
  76. local random_seed = 1
  77.  
  78. --------------------------------------------------------------------------
  79. ---------------- Recoil Table ------------------------------
  80. ---------------- You can fix the value here ------------------------------
  81. --------------------------------------------------------------------------
  82. --- recoil times
  83. --- if the Recoil compensation is Large or small,You can modify the value of all_recoil_Times or recoil_table{times}
  84. local all_recoil_times = 1
  85.  
  86. local recoil_table = {}
  87.  
  88. recoil_table["ump9"] = {
  89. 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},
  90. basictimes = 0.963,
  91.  
  92. full={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},
  93. fulltimes = 0.963*0.75,
  94.  
  95. holdbreathtimes = 1.25,
  96.  
  97. quadruple={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},
  98. quadrupletimes = 4*0.963,
  99.  
  100. fullof4x={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},
  101. fullof4xtimes = 4*0.963*0.75,
  102.  
  103. speed = 90,
  104. }
  105.  
  106. recoil_table["akm"] = {
  107. 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},
  108. basictimes = 0.96,
  109.  
  110. full={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},
  111. fulltimes = 0.96*0.75,
  112.  
  113. holdbreathtimes = 1.25,
  114.  
  115. quadruple={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},
  116. quadrupletimes = 4*0.96*0.99,
  117.  
  118. fullof4x={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},
  119. fullof4xtimes = 4*0.96*0.99*0.75,
  120.  
  121. speed = 100,
  122. }
  123.  
  124.  
  125. recoil_table["m16a4"] = {
  126. basic={47,35,38,44,58,61,70,67,73,74,72,69,72,71,72,70,72,70,69,71},
  127. basictimes = 1.15,
  128.  
  129. full={47,35,38,44,58,61,70,67,73,74,72,69,72,71,72,70,72,70,69,71},
  130. fulltimes = 1.15*0.75,
  131.  
  132. holdbreathtimes = 1.25,
  133.  
  134. quadruple={47,35,38,44,58,61,70,67,73,74,72,69,72,71,72,70,72,70,69,71},
  135. quadrupletimes = 1.15*4,
  136.  
  137. fullof4x={47,35,38,44,58,61,70,67,73,74,72,69,72,71,72,70,72,70,69,71},
  138. fullof4xtimes = 4*1.15*0.75,
  139.  
  140. speed = 80,
  141. }
  142.  
  143. recoil_table["m416"] = {
  144. basic={49,37,38,39,43,46,47,47,48,49,50,49,55,56,58,60},
  145. basictimes = 1.05,
  146.  
  147. full={49,37,38,39,43,46,47,47,48,49,50,49,55,56,58,60},
  148. fulltimes = 1.05*0.75,
  149.  
  150. holdbreathtimes = 1.25,
  151.  
  152. quadruple={49,37,38,39,43,46,47,47,48,49,50,49,55,56,58,60},
  153. quadrupletimes = 4*1.05,
  154.  
  155. fullof4x={49,37,38,39,43,46,47,47,48,49,50,49,55,56,58,60},
  156. fullof4xtimes = 4*1.05*0.75,
  157.  
  158. speed = 90,
  159. }
  160.  
  161. recoil_table["scarl"] = {
  162. basic={40,28,35,44,44,45,46,46,46,48,49,45,44,44,51,55},
  163. basictimes = 0.89,
  164.  
  165. full={40,28,35,44,44,45,46,46,46,48,49,45,44,44,51,55},
  166. fulltimes = 0.89*0.75,
  167.  
  168. holdbreathtimes = 1.25,
  169.  
  170. quadruple={40,28,35,44,44,45,46,46,46,48,49,45,44,44,51,55},
  171. quadrupletimes = 4*0.89,
  172.  
  173. fullof4x={40,28,35,44,44,45,46,46,46,48,49,45,44,44,51,55},
  174. fullof4xtimes = 4*0.89*0.75,
  175.  
  176. speed = 100,
  177. }
  178.  
  179. recoil_table["uzi"] = {
  180. basic={18,18,18,19,19,21,24,24,30,26,30,30,34,34,38},
  181. basictimes = 1.7,
  182.  
  183. full={18,18,18,19,19,21,24,24,30,26,30,30,34,34,38},
  184. fulltimes = 1.7*0.75,
  185.  
  186. holdbreathtimes = 1.25,
  187.  
  188. quadruple={18,18,18,19,19,21,24,24,30,26,30,30,34,34,38},
  189. quadrupletimes = 1.7,
  190.  
  191. fullof4x={18,18,18,19,19,21,24,24,30,26,30,30,34,34,38},
  192. fullof4xtimes = 1.7*0.75,
  193.  
  194. speed = 48,
  195. }
  196.  
  197. recoil_table["none"] = {
  198. 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},
  199. basictimes = 1,
  200.  
  201. full={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},
  202. fulltimes = 1,
  203.  
  204. holdbreathtimes = 1,
  205.  
  206. 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},
  207. quadrupletimes = 1,
  208.  
  209. fullof4x={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},
  210. fullof4xtimes = 1,
  211.  
  212. speed = 60,
  213. }
  214.  
  215.  
  216. --------------------------------------------------------------------------
  217. ---------------- Function ------------------------------
  218. --------------------------------------------------------------------------
  219.  
  220.  
  221. function convert_sens(unconvertedSens)
  222. return 0.002 * math.pow(10, unconvertedSens / 50)
  223. end
  224.  
  225. function calc_sens_scale(sensitivity)
  226. return convert_sens(sensitivity)/convert_sens(50)
  227. end
  228.  
  229. function light_on()
  230. if not IsKeyLockOn(lighton_key) then
  231. PressAndReleaseKey(lighton_key)
  232. end
  233. end
  234.  
  235. function light_off()
  236. if IsKeyLockOn(lighton_key) then
  237. PressAndReleaseKey(lighton_key)
  238. end
  239. end
  240.  
  241. local target_scale = calc_sens_scale(target_sensitivity)
  242. local scope_scale = calc_sens_scale(scope_sensitivity)
  243. local scope4x_scale = calc_sens_scale(scope4x_sensitivity)
  244.  
  245. function recoil_mode()
  246. if not IsKeyLockOn(mode_switch_key) then
  247. if IsKeyLockOn(full_mode_key) and full_mode then
  248. return "full";
  249. else
  250. return "basic";
  251. end
  252. end
  253.  
  254. if IsKeyLockOn(mode_switch_key) then
  255. if IsKeyLockOn(full_mode_key) and full_mode then
  256. return "fullof4x"
  257. else
  258. return "quadruple"
  259. end
  260. end
  261. end
  262.  
  263. function recoil_value(_weapon,_duration)
  264. local _mode = recoil_mode()
  265. local step = (math.floor(_duration/100)) + 1
  266. if step > #recoil_table[_weapon][_mode] then
  267. step = #recoil_table[_weapon][_mode]
  268. end
  269.  
  270. local weapon_recoil = recoil_table[_weapon][_mode][step]
  271. -- OutputLogMessage("weapon_recoil = %s\n", weapon_recoil)
  272.  
  273. local weapon_speed = 30
  274. if weapon_speed_mode then
  275. weapon_speed = recoil_table[_weapon]["speed"]
  276. end
  277. -- OutputLogMessage("weapon_speed = %s\n", weapon_speed)
  278.  
  279. local weapon_basictimes = recoil_table[_weapon]["basictimes"]
  280. local weapon_fulltimes = recoil_table[_weapon]["fulltimes"]
  281. local weapon_quadrupletimes = recoil_table[_weapon]["quadrupletimes"]
  282. local weapon_fullof4xtimes = recoil_table[_weapon]["fullof4xtimes"]
  283. local weapon_holdbreathtimes = recoil_table[_weapon]["holdbreathtimes"]
  284. local weapon_intervals = weapon_speed
  285.  
  286. if obfs_mode then
  287. local coefficient = interval_ratio * ( 1 + random_seed * math.random())
  288. weapon_intervals = math.floor(coefficient * weapon_speed)
  289. end
  290. -- OutputLogMessage("weapon_intervals = %s\n", weapon_intervals)
  291.  
  292. recoil_recovery = weapon_recoil * weapon_intervals / 100
  293. recoil_times = all_recoil_times * 0.7 / vertical_sensitivity
  294.  
  295. if recoil_mode() == "basic" then
  296. recoil_recovery = recoil_recovery * recoil_times * weapon_basictimes
  297. end
  298. if recoil_mode() == "basic" and hold_breath_mode and IsModifierPressed(hold_breath_key) then
  299. recoil_recovery = recoil_recovery * weapon_holdbreathtimes * recoil_times * weapon_basictimes
  300. end
  301.  
  302. if recoil_mode() == "full" then
  303. recoil_recovery = recoil_recovery * recoil_times * weapon_fulltimes
  304. end
  305. if recoil_mode() == "full" and hold_breath_mode and IsModifierPressed(hold_breath_key) then
  306. recoil_recovery = recoil_recovery * weapon_holdbreathtimes * recoil_times * weapon_fulltimes
  307. end
  308.  
  309. if recoil_mode() == "quadruple" then
  310. recoil_recovery = recoil_recovery * recoil_times * weapon_quadrupletimes
  311. end
  312.  
  313. if recoil_mode() == "fullof4x" then
  314. recoil_recovery = recoil_recovery * recoil_times * weapon_fullof4xtimes
  315. end
  316.  
  317. -- issues/3
  318. if IsMouseButtonPressed(2) then
  319. recoil_recovery = recoil_recovery / target_scale
  320. elseif recoil_mode() == "basic" then
  321. recoil_recovery = recoil_recovery / scope_scale
  322. elseif recoil_mode() == "full" then
  323. recoil_recovery = recoil_recovery / scope_scale
  324. elseif recoil_mode() == "quadruple" then
  325. recoil_recovery = recoil_recovery / scope4x_scale
  326. elseif recoil_mode() == "fullof4x" then
  327. recoil_recovery = recoil_recovery / scope4x_scale
  328. end
  329.  
  330. return weapon_intervals,recoil_recovery
  331. end
  332.  
  333.  
  334. --------------------------------------------------------------------------
  335. ---------------- OnEvent ------------------------------
  336. --------------------------------------------------------------------------
  337.  
  338.  
  339. function OnEvent(event, arg)
  340. OutputLogMessage("event = %s, arg = %d\n", event, arg)
  341. if (event == "PROFILE_ACTIVATED") then
  342. EnablePrimaryMouseButtonEvents(true)
  343. elseif event == "PROFILE_DEACTIVATED" then
  344. current_weapon = "none"
  345. shoot_duration = 0.0
  346. ReleaseKey(fire_key)
  347. ReleaseMouseButton(1)
  348. end
  349.  
  350. if (event == "MOUSE_BUTTON_PRESSED" and arg == set_off_key)
  351. or (event == "G_PRESSED" and arg == set_off_gkey) then
  352. current_weapon = "none" light_off()
  353. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == akm_key)
  354. or (event == "G_PRESSED" and arg == akm_gkey) then
  355. current_weapon = "akm" light_on()
  356. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m16a4_key)
  357. or (event == "G_PRESSED" and arg == m16a4_gkey) then
  358. current_weapon = "m16a4" light_on()
  359. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m416_key)
  360. or (event == "G_PRESSED" and arg == m416_gkey) then
  361. current_weapon = "m416" light_on()
  362. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == ump9_key)
  363. or (event == "G_PRESSED" and arg == ump9_gkey) then
  364. current_weapon = "ump9" light_on()
  365. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == uzi_key)
  366. or (event == "G_PRESSED" and arg == uzi_gkey) then
  367. current_weapon = "uzi" light_on()
  368. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == scarl_key)
  369. or (event == "G_PRESSED" and arg == scarl_gkey) then
  370. current_weapon = "scarl" light_on()
  371. elseif (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
  372. -- button 1 : Shoot
  373. if ((current_weapon == "none") or IsModifierPressed(ignore_key)) then
  374. PressKey(fire_key)
  375. repeat
  376. Sleep(30)
  377. until not IsMouseButtonPressed(1)
  378. ReleaseKey(fire_key)
  379. elseif((current_weapon == "m16a4") and not IsModifierPressed(ignore_key)) then
  380. local shoot_duration = 0.0
  381. repeat
  382. local intervals,recovery = recoil_value(current_weapon,shoot_duration)
  383. PressAndReleaseKey(fire_key)
  384. MoveMouseRelative(0, recovery )
  385. Sleep(intervals)
  386. shoot_duration = shoot_duration + intervals
  387. until not IsMouseButtonPressed(1)
  388. else
  389. if auto_mode then
  390. PressKey(fire_key)
  391. local shoot_duration = 0.0
  392. repeat
  393. local intervals,recovery = recoil_value(current_weapon,shoot_duration)
  394. MoveMouseRelative(0, recovery )
  395. Sleep(intervals)
  396. shoot_duration = shoot_duration + intervals
  397. until not IsMouseButtonPressed(1)
  398. else
  399. local shoot_duration = 0.0
  400. repeat
  401. local intervals,recovery = recoil_value(current_weapon,shoot_duration)
  402. PressAndReleaseKey(fire_key)
  403. MoveMouseRelative(0, recovery )
  404. Sleep(intervals)
  405. shoot_duration = shoot_duration + intervals
  406. until not IsMouseButtonPressed(1)
  407. end
  408. end
  409. elseif (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then
  410. ReleaseKey(fire_key)
  411. end
  412. while (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and IsModifierPressed(fast_loot_key) and fastloot) do
  413. Sleep(10)
  414. PressMouseButton(1)
  415. Sleep(10)
  416. MoveMouseRelative(move, 0)
  417. MoveMouseRelative(move, 0)
  418. MoveMouseRelative(move, 0)
  419. Sleep(2)
  420. MoveMouseRelative(move, 0)
  421. MoveMouseRelative(move, 0)
  422. MoveMouseRelative(move, 0)
  423. Sleep(2)
  424. MoveMouseRelative(move, 0)
  425. MoveMouseRelative(move, 0)
  426. MoveMouseRelative(move, 0)
  427. Sleep(2)
  428. MoveMouseRelative(move, 0)
  429. MoveMouseRelative(move, 0)
  430. MoveMouseRelative(move, 0)
  431. Sleep(2)
  432. MoveMouseRelative(move, 0)
  433. MoveMouseRelative(move, 0)
  434. MoveMouseRelative(move, 0)
  435. Sleep(10)
  436. ReleaseMouseButton(1)
  437. Sleep(10)
  438. MoveMouseRelative(-move, 0)
  439. MoveMouseRelative(-move, 0)
  440. MoveMouseRelative(-move, 0)
  441. Sleep(2)
  442. MoveMouseRelative(-move, 0)
  443. MoveMouseRelative(-move, 0)
  444. MoveMouseRelative(-move, 0)
  445. Sleep(2)
  446. MoveMouseRelative(-move, 0)
  447. MoveMouseRelative(-move, 0)
  448. MoveMouseRelative(-move, 0)
  449. MoveMouseRelative(-move, 0)
  450. Sleep(2)
  451. MoveMouseRelative(-move, 0)
  452. Sleep(2)
  453. MoveMouseRelative(-move, 0)
  454. MoveMouseRelative(-move, 0)
  455. MoveMouseRelative(-move, 0)
  456. MoveMouseRelative(-move, 0)
  457. Sleep(10)
  458. if not IsModifierPressed(fast_loot_key) then
  459. break
  460. end
  461. end
  462. endcc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement