Advertisement
Guest User

Untitled

a guest
May 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.33 KB | None | 0 0
  1. import "API" for Engine, IEntity, Graphics, IGraphicsListener, Vec3, Vec2, OS, Weapon, IEvent, EventType
  2. import "CoreTargetResolver" for TargetResolver
  3. import "CoreTargetSelector" for TargetSelector
  4. import "CoreAimbot" for CoreAimbot
  5. import "CoreSmoothing" for ISmoothingSource
  6. import "Config" for a1_enable, a1_key_k, ts1_fov, ts2_fov
  7. import "Config" for a1_flickmode
  8. import "Config" for triggerbot_hitbox_color_c
  9.  
  10. //---------------------------CONFIG SECTION --------------------------
  11. //---------------------------Aimbot Settings--------------------------
  12. //Set to current aimbot key
  13. //Values allowed: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, Y, X, Z, ', ",", -, ., =, /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, LEFTALT, LEFTMOUSE
  14. var CurrentAimbotKey = "LEFTMOUSE"
  15.  
  16. //Set to current aimbot key
  17. //Values allowed: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, Y, X, Z, ', ",", -, ., =, /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, LEFTALT, LEFTMOUSE
  18. var AimbotTwoKey = "J"
  19.  
  20. //set to key of quick melee
  21. //Values allowed: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, Y, X, Z, ', ",", -, ., =, /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, LEFTALT, LEFTMOUSE
  22. var QuickMeleeKey = "V"
  23.  
  24. //set to key of quick melee (Make a secondary button for this)
  25. //Values allowed: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, Y, X, Z, ', ",", -, ., =, /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, LEFTALT
  26. var PrimaryFireKey = "B"
  27.  
  28. //Hanzo PreFire Speed Value
  29. var HanzoPreFireSpeed = 0.2
  30. var HanzoFullChargeProjectileSpeed = 120
  31. //---------------------------Aimbot Settings--------------------------
  32.  
  33.  
  34. //---------------------------Flick Settings--------------------------
  35. var FlickMode = false
  36. var HitBoxFactor = 60
  37. //---------------------------Flick Settings--------------------------
  38.  
  39.  
  40. //---------------------------Hanzo-----------------------------------
  41. //Charges up to atleast 80% for 200 dmg headshoots before flicking
  42. //Values allowed: true, false
  43. var ShootAbove200Dmg = false
  44. //---------------------------Hanzo-----------------------------------
  45.  
  46.  
  47. //---------------------------Genji----------------------------------
  48. //True: only slash when killable, false: always slash during ult if in range
  49. //Values allowed: true, false
  50. var Genji_KSUltMeleeOnly = false
  51. //---------------------------Genji---------------------------------
  52.  
  53.  
  54. var DebugDrawing = false
  55. var AutoMeleeOnlyKillable = true
  56. //------------------DO NOT EDIT UNDER HERE-------------------------
  57.  
  58. //aimbot colors
  59. var PrimaryAimbot = null
  60. var FC = Graphics.colorARGB(0,1,0,0)
  61. var TC = Graphics.colorARGB(1,1,0,0)
  62. var TargetKill = Graphics.colorARGB(1,0,1,0)
  63. var TargetSafe = Graphics.colorARGB(1,1,0,0)
  64.  
  65. //aimbot settings
  66. var FOV1 = ts1_fov
  67. var FOV2 = ts1_fov
  68.  
  69. //trigger
  70. var TriggerFinished = false
  71.  
  72. //Misc
  73. var MouseVec = Vec2.new(0,0)
  74. var MouseVecScreen = Vec2.new(Graphics.screenWidth/2, Graphics.screenHeight/2)
  75. var QuickMeleeState = 0
  76. var QuickMeleeTimer = 0
  77.  
  78. //Flick settings
  79. var FlickState = 0
  80. var FlickResetTimer = 0
  81.  
  82. //Prediction Caches
  83. var EnemyCurrentVelocity = {}
  84. var LastCacheTime = {}
  85. var LastEnemyVector = {}
  86.  
  87. //key states
  88. var KeyDown = false
  89. var LeftClickTimer = 0
  90. var LastTarget = null
  91. var KeyState = 0
  92.  
  93. //hanzo
  94. var HanzoChargeTime200Dmg = 550
  95. var HanzoRecoveryTime = 0
  96. var HanzoEHoldTime = 0
  97. var HanzoEActive = false
  98. var HanzoKeyDown = false
  99.  
  100. //genji
  101. var DashCoolDown = 0
  102. var DashTarget = null
  103. var GenjiUlted = false
  104. var GenjiUltTimer = 0
  105.  
  106. //ids
  107. var Genji_ID = 41
  108. var Hanzo_ID = 5
  109. var RoadHog_ID = 64
  110. var Dva_ID = 122
  111. var Orisa_ID = 318
  112. var Reinhardt_ID = 7
  113. var Winston_ID = 9
  114. var Hammond_ID = 458
  115. var Zarya_ID = 104
  116. var Ashe_ID = 512
  117. var Bastion_ID = 21
  118. var Doomfist_ID = 303
  119. var Junkrat_ID = 101
  120. var Mccree_ID = 66
  121. var Mei_ID = 221
  122. var Pharah_ID = 8
  123. var Reaper_ID = 2
  124. var Soldier76_ID = 110
  125. var Sombra_ID = 302
  126. var Symmetra_ID = 22
  127. var Torbjorn_ID = 6
  128. var Tracer_ID = 3
  129. var Widowmaker_ID = 10
  130. var Ana_ID = 315
  131. var Baptiste_ID = 545
  132. var Brigitte_ID = 405
  133. var Lucio_ID = 121
  134. var Mercy_ID = 4
  135. var Moira_ID = 418
  136. var Zenyatta_ID = 32
  137.  
  138. //All heroes (time between flick in milliseconds)
  139. var FlickResetTimerForHero = {
  140. Genji_ID : 950,
  141. Hanzo_ID : 1300, // no reset for hanzu
  142. RoadHog_ID : 700,
  143. Dva_ID : 0,
  144. Orisa_ID : 0,
  145. Reinhardt_ID : 0,
  146. Winston_ID : 0,
  147. Hammond_ID : 0,
  148. Zarya_ID :0,
  149. Ashe_ID : 250,
  150. Bastion_ID : 0,
  151. Doomfist_ID : 320,
  152. Junkrat_ID : 650,
  153. Mccree_ID : 500,
  154. Mei_ID : 800,
  155. Pharah_ID : 750,
  156. Reaper_ID : 500,
  157. Soldier76_ID : 0,
  158. Sombra_ID : 0,
  159. Symmetra_ID : 0,
  160. Torbjorn_ID : 600,
  161. Tracer_ID : 0,
  162. Widowmaker_ID : 1400,
  163. Ana_ID : 800,
  164. Baptiste_ID : 650,
  165. Brigitte_ID : 0,
  166. Lucio_ID : 520,
  167. Mercy_ID : 200,
  168. Moira_ID : 0,
  169. Zenyatta_ID : 100
  170. }
  171.  
  172. var ProjectileSpeed = {
  173. Hanzo_ID : HanzoFullChargeProjectileSpeed, //hanzo
  174. Torbjorn_ID : 70, //torb
  175. Zenyatta_ID : 80, //zen
  176. Genji_ID : 60, //genji
  177. Orisa_ID : 120, //orisa
  178. Mei_ID : 120, //mei
  179. Lucio_ID : 50,
  180. Mercy_ID : 40,
  181. RoadHog_ID : 50,
  182. Doomfist_ID : 80,
  183. Pharah_ID : 35
  184. }
  185.  
  186. var ProjectileGravity = {
  187. Hanzo_ID : 6.1,
  188. Torbjorn_ID : 8.0,
  189. Zenyatta_ID : 0,
  190. Genji_ID : 0,
  191. Orisa_ID : 0,
  192. Mei_ID : 0,
  193. Lucio_ID : 0,
  194. Mercy_ID : 0,
  195. RoadHog_ID : 0,
  196. Doomfist_ID : 0,
  197. Pharah_ID : 0
  198. }
  199.  
  200. var MakeKeys = {
  201. "A": 0x1E,
  202. "B": 0x30,
  203. "C": 0x2E,
  204. "D": 0x20,
  205. "E": 0x12,
  206. "F": 0x21,
  207. "G": 0x22,
  208. "H": 0x23,
  209. "I": 0x17,
  210. "J": 0x24,
  211. "K": 0x25,
  212. "L": 0x26,
  213. "M": 0x32,
  214. "N": 0x31,
  215. "O": 0x18,
  216. "P": 0x19,
  217. "Q": 0x10,
  218. "R": 0x13,
  219. "S": 0x1,
  220. "T": 0x14,
  221. "U": 0x16,
  222. "V": 0x2F,
  223. "W": 0x11,
  224. "X": 0x2D,
  225. "Y": 0x15,
  226. "Z": 0x2C,
  227. "'": 0x28,
  228. ",": 0x33,
  229. "-": 0x0C,
  230. ".": 0x34,
  231. "/": 0x35,
  232. "0": 0x0B,
  233. "1": 0x02,
  234. "2": 0x03,
  235. "3": 0x04,
  236. "4": 0x05,
  237. "5": 0x06,
  238. "6": 0x07,
  239. "7": 0x08,
  240. "8": 0x09,
  241. "9": 0x0A,
  242. ";": 0x27,
  243. "=": 0x0D,
  244. "[": 0x1A,
  245. "]": 0x1B,
  246. "`": 0x29,
  247. "LEFTSHIFT" : 0x2A,
  248. "LEFTALT" : 0x38
  249. }
  250.  
  251. var VirtualKeys = {
  252. "L_Button" : 0x01,
  253. "0": 0x30,
  254. "1": 0x31,
  255. "2": 0x32,
  256. "3": 0x33,
  257. "4": 0x34,
  258. "5": 0x35,
  259. "6": 0x36,
  260. "7": 0x37,
  261. "8": 0x38,
  262. "9": 0x39,
  263. "A": 0x41,
  264. "B": 0x42,
  265. "C": 0x43,
  266. "D": 0x44,
  267. "E": 0x45,
  268. "F": 0x46,
  269. "G": 0x47,
  270. "H": 0x48,
  271. "I": 0x49,
  272. "J": 0x4A,
  273. "K": 0x4B,
  274. "L": 0x4C,
  275. "M": 0x4D,
  276. "N": 0x4E,
  277. "O": 0x4F,
  278. "P": 0x50,
  279. "Q": 0x51,
  280. "R": 0x52,
  281. "S": 0x53,
  282. "T": 0x54,
  283. "U": 0x55,
  284. "V": 0x56,
  285. "W": 0x57,
  286. "X": 0x58,
  287. "Y": 0x59,
  288. "Z": 0x5A,
  289. "VK_ACCEPT": 0x1E,
  290. "VK_ADD": 0x6B,
  291. "VK_APPS": 0x5D,
  292. "VK_ATTN": 0xF6,
  293. "VK_BACK": 0x08,
  294. "VK_BROWSER_BACK": 0xA6,
  295. "VK_BROWSER_FAVORITES": 0xAB,
  296. "VK_BROWSER_FORWARD": 0xA7,
  297. "VK_BROWSER_HOME": 0xAC,
  298. "VK_BROWSER_REFRESH": 0xA8,
  299. "VK_BROWSER_SEARCH": 0xAA,
  300. "VK_BROWSER_STOP": 0xA9,
  301. "VK_CANCEL": 0x03,
  302. "VK_CAPITAL": 0x14,
  303. "VK_CLEAR": 0x0C,
  304. "VK_CONTROL": 0x11,
  305. "VK_CONVERT": 0x1C,
  306. "VK_CRSEL": 0xF7,
  307. "VK_DECIMAL": 0x6E,
  308. "VK_DELETE": 0x2E,
  309. "VK_DIVIDE": 0x6F,
  310. "VK_DOWN": 0x28,
  311. "VK_END": 0x23,
  312. "VK_EREOF": 0xF9,
  313. "VK_ESCAPE": 0x1B,
  314. "VK_EXECUTE": 0x2B,
  315. "VK_EXSEL": 0xF8,
  316. "VK_F1": 0x70,
  317. "VK_F10": 0x79,
  318. "VK_F11": 0x7A,
  319. "VK_F12": 0x7B,
  320. "VK_F13": 0x7C,
  321. "VK_F14": 0x7D,
  322. "VK_F15": 0x7E,
  323. "VK_F16": 0x7F,
  324. "VK_F2": 0x71,
  325. "VK_F3": 0x72,
  326. "VK_F4": 0x73,
  327. "VK_F5": 0x74,
  328. "VK_F6": 0x75,
  329. "VK_F7": 0x76,
  330. "VK_F8": 0x77,
  331. "VK_F9": 0x78,
  332. "VK_FINAL": 0x18,
  333. "VK_HANGUEL": 0x15,
  334. "VK_HANGUL": 0x15,
  335. "VK_HANJA": 0x19,
  336. "VK_HELP": 0x2F,
  337. "VK_HOME": 0x24,
  338. "VK_INSERT": 0x2D,
  339. "VK_JUNJA": 0x17,
  340. "VK_KANA": 0x15,
  341. "VK_KANJI": 0x19,
  342. "VK_LAUNCH_APP1": 0xB6,
  343. "VK_LAUNCH_APP2": 0xB7,
  344. "VK_LAUNCH_MAIL": 0xB4,
  345. "VK_LAUNCH_MEDIA_SELECT": 0xB5,
  346. "VK_LCONTROL": 0xA2,
  347. "VK_LEFT": 0x25,
  348. "VK_LMENU": 0xA4,
  349. "VK_LSHIFT": 0xA0,
  350. "VK_LWIN": 0x5B,
  351. "VK_MBUTTON": 0x04,
  352. "VK_MEDIA_NEXT_TRACK": 0xB0,
  353. "VK_MEDIA_PLAY_PAUSE": 0xB3,
  354. "VK_MEDIA_PREV_TRACK": 0xB1,
  355. "VK_MEDIA_STOP": 0xB2,
  356. "VK_MENU": 0x12,
  357. "VK_MODECHANGE": 0x1F,
  358. "VK_MULTIPLY": 0x6A,
  359. "VK_NEXT": 0x22,
  360. "VK_NONCONVERT": 0x1D,
  361. "VK_NUMLOCK": 0x90,
  362. "VK_NUMPAD0": 0x60,
  363. "VK_NUMPAD1": 0x61,
  364. "VK_NUMPAD2": 0x62,
  365. "VK_NUMPAD3": 0x63,
  366. "VK_NUMPAD4": 0x64,
  367. "VK_NUMPAD5": 0x65,
  368. "VK_NUMPAD6": 0x66,
  369. "VK_NUMPAD7": 0x67,
  370. "VK_NUMPAD8": 0x68,
  371. "VK_NUMPAD9": 0x69,
  372. "VK_OEM_1": 0xBA,
  373. "VK_OEM_2": 0xBF,
  374. "VK_OEM_3": 0xC0,
  375. "VK_OEM_4": 0xDB,
  376. "VK_OEM_5": 0xDC,
  377. "VK_OEM_6": 0xDD,
  378. "VK_OEM_7": 0xDE,
  379. "VK_OEM_8": 0xDF,
  380. "VK_OEM_CLEAR": 0xFE,
  381. "VK_OEM_COMMA": 0xBC,
  382. "VK_OEM_MINUS": 0xBD,
  383. "VK_OEM_PERIOD": 0xBE,
  384. "VK_OEM_PLUS": 0xBB,
  385. "VK_PAUSE": 0x13,
  386. "VK_PLAY": 0xFA,
  387. "VK_PRINT": 0x2A,
  388. "VK_PRIOR": 0x21,
  389. "VK_RBUTTON": 0x02,
  390. "VK_RCONTROL": 0xA3,
  391. "VK_RETURN": 0x0D,
  392. "VK_RIGHT": 0x27,
  393. "VK_RMENU": 0xA5,
  394. "VK_RSHIFT": 0xA1,
  395. "VK_RWIN": 0x5C,
  396. "VK_SCROLL": 0x91,
  397. "VK_SELECT": 0x29,
  398. "VK_SEPARATOR": 0x6C,
  399. "VK_SHIFT": 0x10,
  400. "VK_SLEEP": 0x5F,
  401. "VK_SNAPSHOT": 0x2C,
  402. "VK_SPACE": 0x20,
  403. "VK_SUBTRACT": 0x6D,
  404. "VK_TAB": 0x09,
  405. "VK_UP": 0x26,
  406. "VK_VOLUME_DOWN": 0xAE,
  407. "VK_VOLUME_MUTE": 0xAD,
  408. "VK_VOLUME_UP": 0xAF,
  409. "VK_XBUTTON1": 0x05,
  410. "VK_XBUTTON2": 0x06,
  411. "VK_ZOOM": 0xFB,
  412. }
  413.  
  414. /*Move Speed Calc */
  415. class FPSCounter {
  416. construct new() {
  417. _lastTick = 0
  418. _fps = 0
  419. _fps_temp = 0
  420. }
  421. fps { _fps }
  422. handle(time) {
  423. var currentTick = time * 0.001
  424. _fps_temp = _fps_temp + 1
  425. if ((currentTick - _lastTick) > 1) {
  426. _lastTick = currentTick
  427. _fps = _fps_temp
  428. _fps_temp = 0
  429. }
  430.  
  431. }
  432. }
  433. var FPSCount = FPSCounter.new()
  434.  
  435. class QuaternionSlerpSmoothingSource implements ISmoothingSource {
  436. construct new(speed) {_speed = speed / 100}
  437. smoothAngles(t, v1, v2) {
  438. return v1.qslerp(v2, _speed)
  439. }
  440. }
  441. var HanzoSmoothing = QuaternionSlerpSmoothingSource.new(HanzoPreFireSpeed)
  442.  
  443. class Health {
  444. static GetTotalHP(target){
  445. if(target == null){
  446. return 0
  447. }
  448.  
  449. return target.healthMax + target.armorMax + target.shieldMax
  450. }
  451.  
  452. static GetCurrentHP(target){
  453. if(target == null){
  454. return 0
  455. }
  456.  
  457. return target.health + target.shield + target.armor
  458. }
  459. }
  460.  
  461. class Helpers {
  462. static min(x, y) { x > y ? y : x }
  463. static max(x, y) { x > y ? x : y }
  464. static addVectors(vec1, vec2) {
  465. return Vec3.new(vec1.x + vec2.x, vec1.y + vec2.y, vec1.z + vec2.z)
  466. }
  467. static subtractVectors(vec1, vec2) {
  468. return Vec3.new(vec1.x - vec2.x, vec1.y - vec2.y, vec1.z - vec2.z)
  469. }
  470. static multiplyVectors(vec1, vec2) {
  471. return Vec3.new(vec1.x * vec2.x, vec1.y * vec2.y, vec1.z * vec2.z)
  472. }
  473. static multiplyVectorN(vec1, n) {
  474. return Vec3.new(vec1.x * n, vec1.y * n, vec1.z * n)
  475. }
  476. static divideVectors(vec1, vec2) {
  477. return Vec3.new(vec1.x / vec2.x, vec1.y / vec2.y, vec1.z / vec2.z)
  478. }
  479. static divideVectorN(vec1, n) {
  480. return Vec3.new(vec1.x / n, vec1.y / n, vec1.z / n)
  481. }
  482. static isEqualVector(vec1, vec2) {
  483. return (vec1.x == vec2.x && vec1.y == vec2.y && vec1.z == vec2.z)
  484. }
  485.  
  486. static drawCircle(x,y,r2,c) {
  487. r2 = r2 * 19 //adjust to radius of seraph
  488. x = Graphics.screenWidth * (x + 1)/2
  489. y = Graphics.screenHeight * (1 - y)/2
  490. var xf = null
  491. var yf = null
  492. for(i in 1..64) {
  493. var ang = i / 30 * Num.pi
  494. var xt = x + r2 * ang.cos
  495. var yt = y + r2 * ang.sin
  496. if(xf != null) {
  497. var res1 = Vec3.new(2 * (xt/Graphics.screenWidth) - 1,-2 * (yt/Graphics.screenHeight) + 1,0)
  498. var res2 = Vec3.new(2 * (xf/Graphics.screenWidth) - 1,-2 * (yf/Graphics.screenHeight) + 1,0)
  499. Graphics.addLine(res1.x,res1.y,c,res2.x,res2.y,c)
  500. }
  501. xf = xt
  502. yf = yt
  503. }
  504. }
  505.  
  506. static CircleIntersection(point, center, radius) {
  507. radius = radius * 19
  508.  
  509. var x = Graphics.screenWidth * (center.x + 1)/2
  510. var y = Graphics.screenHeight * (1 - center.y)/2
  511. var screenVec = Vec2.new(x,y)
  512.  
  513. var result = (((screenVec.x - point.x) * (screenVec.x - point.x)) + ((screenVec.y - point.y) * (screenVec.y - point.y)))
  514.  
  515. return result.sqrt < radius
  516. }
  517.  
  518. static GetTriggerhitBox(target){
  519. if(target == null){
  520. return 25 / 19
  521. }
  522.  
  523. var width = Helpers.min(4, LastTarget.screenBoundingBoxMin.distTo(LastTarget.screenBoundingBoxMax))
  524. return (HitBoxFactor*width)/19
  525. }
  526. }
  527.  
  528. class AutoMelee{
  529. static AutoMeleeKS(){
  530. var key = GenjiUlted ? PrimaryFireKey : QuickMeleeKey
  531.  
  532. if(Engine.getEnemies() == null){
  533. return
  534. }
  535.  
  536. if(QuickMeleeState == 1){
  537. QuickMeleeState = 0
  538. OS.keyDown(MakeKeys[key])
  539. return
  540. }
  541.  
  542. if(QuickMeleeState == 0 && OS.time - QuickMeleeTimer > 1000){
  543. for(target in Engine.getEnemies()) {
  544. if(target.isVisible && target.health > 0){
  545. var dist = Engine.getLocalPlayer().basePosition.distTo(target.basePosition)
  546. var dmg = GenjiUlted ? 170 : 30
  547. var range = GenjiUlted ? 5 : 2.75
  548.  
  549. if(!AutoMeleeOnlyKillable){
  550. dmg = 10000
  551. }
  552.  
  553. if((Health.GetCurrentHP(target) <= dmg || (!Genji_KSUltMeleeOnly && GenjiUlted)) && dist <= range){
  554. OS.keyUp(MakeKeys[key])
  555. QuickMeleeState = 1
  556. QuickMeleeTimer = OS.time
  557. return
  558. }
  559. }
  560. }
  561. }
  562. }
  563. }
  564.  
  565. class Genji{
  566. static drawDashRange() {
  567. var genjiDashLength = 15
  568.  
  569. for(entity in Engine.getEnemies()) {
  570. if (entity.health > 0 && entity.isVisible) {
  571. var enemyScreenPos = entity.basePosition.project()
  572. var color = null
  573. Engine.getLocalPlayer().basePosition.distTo(entity.basePosition) <= genjiDashLength ? color = TargetKill : color = TargetSafe
  574. if(enemyScreenPos.validate()){
  575. Graphics.addLine(0, -1, color, enemyScreenPos.x, enemyScreenPos.y, color)
  576. }
  577. }
  578. }
  579. }
  580.  
  581. static CheckForUlt(){
  582. if(OS.isKeyDown(VirtualKeys["Q"])){
  583. GenjiUlted = true
  584. GenjiUltTimer = OS.time
  585. }else{
  586. if(OS.time - GenjiUltTimer > 6000){
  587. GenjiUlted = false
  588. }
  589. }
  590. }
  591.  
  592. static DashKS() {
  593. var dash_dmg = 50
  594. var genjiDashLength = 15
  595.  
  596. if(KeyState == 1){
  597. OS.keyDown(MakeKeys["LEFTSHIFT"])
  598. KeyState = 0
  599.  
  600. if(DashTarget){
  601. if(DashTarget.health <= 0){
  602. DashCoolDown = 0
  603. }else{
  604. DashCoolDown = OS.time
  605. }
  606. }
  607. return
  608. }
  609.  
  610. if(DashTarget){
  611. if(DashTarget.health <= 0){
  612. DashCoolDown = 0
  613. }
  614. }
  615.  
  616. if(OS.time - DashCoolDown < 2000){
  617. return
  618. }
  619.  
  620. if(KeyState == 0){
  621. for(entity in Engine.getEnemies()) {
  622. if (entity.health > 0 && entity.isVisible && Health.GetCurrentHP(entity) <= 50) {
  623. if (Engine.getLocalPlayer().basePosition.distTo(entity.basePosition) <= genjiDashLength) {
  624. var calcPred = Prediction.PredictPos(entity, 50, 0)
  625.  
  626. var dt = calcPred.sub(Engine.getCameraPosition())
  627. var aimDir = dt.normalized()
  628. var aimAng = Vec3.new(aimDir.y.atan(aimDir.x), aimDir.z.asin, 0)
  629.  
  630. Engine.setViewAngles(aimAng)
  631.  
  632. DashTarget = entity
  633. DashCoolDown = 0
  634. OS.keyUp(MakeKeys["LEFTSHIFT"])
  635. KeyState = 1
  636. return
  637. }
  638. }
  639. }
  640. }
  641. }
  642. }
  643.  
  644. class Hanzo{
  645. static SetChargeProjectileSpeed(){
  646. if(OS.time - HanzoRecoveryTime < 550){
  647. LeftClickTimer = OS.time
  648. return
  649. }
  650.  
  651. if(OS.isKeyDown(VirtualKeys["L_Button"])){
  652. if(!KeyDown){
  653. LeftClickTimer = OS.time
  654. KeyDown = true
  655. }
  656. var timeChange = OS.time - LeftClickTimer
  657. var projSpeed = Helpers.min(26 + (HanzoFullChargeProjectileSpeed-26)/700*timeChange, HanzoFullChargeProjectileSpeed)
  658.  
  659. if(ShootAbove200Dmg){
  660. if(OS.time - LeftClickTimer < HanzoChargeTime200Dmg){
  661. ProjectileSpeed[Hanzo_ID] = HanzoFullChargeProjectileSpeed
  662. }
  663. }
  664.  
  665. ProjectileSpeed[Hanzo_ID] = projSpeed
  666. }else{
  667. if(KeyDown == true){
  668. KeyDown = false
  669. HanzoRecoveryTime = OS.time
  670. LeftClickTimer = OS.time
  671. }
  672.  
  673. if(OS.time - LeftClickTimer > 100){
  674. ProjectileSpeed[Hanzo_ID] = HanzoFullChargeProjectileSpeed
  675. LeftClickTimer = OS.time
  676. }
  677. }
  678. }
  679.  
  680. static CheckActiveE(){
  681. if(OS.isKeyDown(VirtualKeys["E"])){
  682. HanzoEActive = true
  683.  
  684. if(OS.time - HanzoEHoldTime > 400){
  685. FlickState = 0
  686. }else{
  687. return
  688. }
  689.  
  690. if(AimbotTwoKey != "LEFTMOUSE"){
  691. OS.keyUp(MakeKeys[AimbotTwoKey])
  692. }else{
  693. OS.leftClick = true
  694. }
  695.  
  696. HanzoKeyDown = true
  697.  
  698. if(LastTarget != null){
  699. var pos = Prediction.PredictPos(LastTarget, -1, -1)
  700.  
  701. if(Helpers.CircleIntersection(MouseVecScreen, pos.project(), Helpers.GetTriggerhitBox(LastTarget))){
  702. OS.keyUp(MakeKeys[PrimaryFireKey])
  703. OS.keyDown(MakeKeys[PrimaryFireKey])
  704. OS.keyDown(MakeKeys[AimbotTwoKey])
  705. FlickState = 1
  706. HanzoEHoldTime = OS.time
  707. }
  708. }
  709. }else{
  710. HanzoEActive = false
  711.  
  712. if(HanzoKeyDown){
  713. if(AimbotTwoKey != "LEFTMOUSE"){
  714. OS.keyDown(MakeKeys[AimbotTwoKey])
  715. }else{
  716. OS.leftClick = false
  717. }
  718. HanzoKeyDown = false
  719. }
  720. }
  721. }
  722. }
  723.  
  724. class Prediction{
  725. static PredictPos(target, speed, gravity){
  726. var projectileSpeed = ProjectileSpeed[Engine.getLocalPlayer().heroId]
  727. var projectileGravity = ProjectileGravity[Engine.getLocalPlayer().heroId]
  728.  
  729. if(Engine.getLocalPlayer() == null || target == null || projectileSpeed == null || EnemyCurrentVelocity[target.uid] == null){
  730. return target.headPosition
  731. }
  732.  
  733. if(speed >= 0){
  734. projectileSpeed = speed
  735. }
  736.  
  737. if(gravity >= 0){
  738. projectileGravity = gravity
  739. }
  740.  
  741. var distant = target.basePosition.distTo(Engine.getLocalPlayer().basePosition)
  742. var travelTime = (distant / projectileSpeed)
  743.  
  744. var predPos = Helpers.multiplyVectorN(EnemyCurrentVelocity[target.uid], travelTime)
  745. predPos.z = predPos.z + (projectileGravity * travelTime.pow(2) * 0.5)
  746.  
  747. return Helpers.addVectors(target.headPosition, predPos)
  748. }
  749. }
  750.  
  751. var SlowTarget = null
  752. class PredictionTargetResolver is TargetResolver {
  753. static resolve(i, target) {
  754. if(FlickState == 1){
  755. return Vec3.new(Num.largest,Num.largest,Num.largest)
  756. }
  757.  
  758. var currentFOV = 0
  759.  
  760. if(i == 1){
  761. currentFOV = FOV2
  762. }else{
  763. currentFOV = FOV1
  764. }
  765.  
  766. /*if(LastTarget == null || !LastTarget.isVisible || LastTarget.health <= 0){
  767. if(Helpers.CircleIntersection(MouseVecScreen, target.headPosition.project(), currentFOV+1)){
  768. LastTarget = target
  769. }
  770. }else{
  771. target = LastTarget
  772. }*/
  773.  
  774. LastTarget = target
  775.  
  776. if(Engine.getLocalPlayer().heroId == Hanzo_ID){
  777. if((FlickMode && ShootAbove200Dmg) && !HanzoEActive){
  778. if(OS.time - LeftClickTimer < HanzoChargeTime200Dmg){
  779. if(Helpers.CircleIntersection(MouseVecScreen, target.headPosition.project(), currentFOV+1)){
  780. var cameraPos = Engine.getCameraPosition()
  781. var camAng = Engine.getViewAngles()
  782.  
  783. var pos = Prediction.PredictPos(target, -1, -1)
  784. var dt = pos.sub(cameraPos)
  785. var aimDir = dt.normalized()
  786. var aimAng = Vec3.new(aimDir.y.atan(aimDir.x), aimDir.z.asin, 0)
  787.  
  788. Engine.setViewAngles(HanzoSmoothing.smoothAngles(0, camAng, aimAng))
  789. }
  790. return Vec3.new(Num.largest,Num.largest,Num.largest)
  791. }
  792. }
  793. }
  794.  
  795. if(!ProjectileSpeed[Engine.getLocalPlayer().heroId]){
  796. return target.headPosition
  797. }
  798.  
  799. return Prediction.PredictPos(target, -1, -1)
  800. }
  801. }
  802.  
  803. class Trigger{
  804. static AutoTrigger(key){
  805. if(TriggerFinished == true){
  806. OS.keyDown(MakeKeys[PrimaryFireKey])
  807. TriggerFinished = false
  808. return
  809. }else{
  810. if(key.down && LastTarget){
  811. var pos = null
  812. if(ProjectileSpeed[Engine.getLocalPlayer().heroId] != null){
  813. pos = Prediction.PredictPos(LastTarget, -1, -1)
  814. }else{
  815. pos = LastTarget.headPosition
  816. }
  817.  
  818. if(Helpers.CircleIntersection(MouseVecScreen, pos.project(), Helpers.GetTriggerhitBox(LastTarget))){
  819. if(Engine.getLocalPlayer().heroId == Hanzo_ID){
  820. if(ShootAbove200Dmg){
  821. if(OS.time - LeftClickTimer > HanzoChargeTime200Dmg){
  822. OS.keyDown(MakeKeys[PrimaryFireKey])
  823. FlickState = 1
  824. FlickResetTimer = OS.time
  825. HanzoRecoveryTime = OS.time
  826. }
  827. }else{
  828. OS.keyUp(MakeKeys[PrimaryFireKey])
  829. TriggerFinished = true
  830. FlickState = 1
  831. FlickResetTimer = OS.time
  832. HanzoRecoveryTime = OS.time
  833. }
  834. }else{
  835. OS.keyUp(MakeKeys[PrimaryFireKey])
  836. TriggerFinished = true
  837. FlickResetTimer = OS.time
  838. FlickState = 1
  839. }
  840. }
  841. }
  842. }
  843. }
  844. }
  845.  
  846. class AimbotPrediction implements IEvent {
  847. static getPrimaryInstance() { PrimaryAimbot }
  848.  
  849. construct attach(i, key, flick) {
  850. _i = i
  851. _key = key
  852. //FlickMode = flick
  853. _targetState = 0
  854.  
  855. this.registerAs(EventType.CoreLogic)
  856. }
  857.  
  858. UpdateTarget(){
  859. if(LastTarget != null){
  860. if(LastTarget.health <= 0 || (!_key.down && !HanzoEActive)){
  861. LastTarget = null
  862. }
  863. }
  864. }
  865.  
  866. tick(n) {
  867. if(Engine.getLocalPlayer() == null){
  868. return
  869. }
  870.  
  871. this.UpdateTarget()
  872. AutoMelee.AutoMeleeKS()
  873.  
  874. if(FlickMode == 0){
  875. FlickState = 0
  876. }else{
  877. if(!_key.down && !HanzoEActive){
  878. FlickState = 0
  879. }
  880.  
  881. if(OS.time - FlickResetTimer > FlickResetTimerForHero[Engine.getLocalPlayer().heroId]){
  882. FlickState = 0
  883. }
  884. }
  885.  
  886. var heroID = Engine.getLocalPlayer().heroId
  887.  
  888. if(heroID == Genji_ID){
  889. //Genji.drawDashRange(Engine.getEnemies())
  890. Genji.DashKS()
  891. Genji.CheckForUlt()
  892. }
  893.  
  894. if(heroID == Hanzo_ID){
  895. Hanzo.SetChargeProjectileSpeed()
  896. Hanzo.CheckActiveE()
  897. }
  898.  
  899. Trigger.AutoTrigger(_key)
  900.  
  901. if(DebugDrawing){
  902. for(ent in Engine.getEnemies()) {
  903. var predPos = Prediction.PredictPos(ent, -1, -1)
  904. if (ent.health > 0 && ent.isVisible && predPos != null) {
  905. var project = predPos.project()
  906.  
  907. if (project.validate()) {
  908. Graphics.addLine(0,-1,FC,project.x,project.y,TC)
  909. }
  910. }
  911. }
  912. }
  913. }
  914. }
  915.  
  916. class Cache implements IEvent {
  917. construct attach() {
  918. this.registerAs(EventType.CoreLogic)
  919. }
  920.  
  921. UpdateCache(){
  922. if(Engine.getEnemies() == null){
  923. return
  924. }
  925.  
  926. for(ent in Engine.getEnemies()) {
  927. if (ent.health > 0) {
  928. if(EnemyCurrentVelocity[ent.uid] == null || LastCacheTime[ent.uid] == null || LastEnemyVector[ent.uid] == null) {
  929. EnemyCurrentVelocity[ent.uid] = Vec3.new(0,0,0)
  930. LastCacheTime[ent.uid] = 0
  931. LastEnemyVector[ent.uid] = ent.basePosition
  932. }else{
  933. var time = FlickMode ? FPSCount.fps/4 : FPSCount.fps
  934. if(OS.time - LastCacheTime[ent.uid] > time){
  935. var direction = ent.basePosition.sub(LastEnemyVector[ent.uid]).normalized()
  936. var posAfter = Helpers.addVectors(ent.basePosition, ent.velocity)
  937. var speed = ent.basePosition.distTo(posAfter)
  938. var velocity = Helpers.multiplyVectorN(direction, speed)
  939. EnemyCurrentVelocity[ent.uid] = velocity
  940. LastCacheTime[ent.uid] = OS.time
  941. }
  942.  
  943. LastEnemyVector[ent.uid] = ent.basePosition
  944. }
  945. }
  946. }
  947. }
  948.  
  949. tick(n) {
  950. FPSCount.handle(OS.time)
  951. this.UpdateCache()
  952.  
  953. /*
  954. if(LastTarget){
  955. var width = Helpers.min(4, LastTarget.screenBoundingBoxMin.distTo(LastTarget.screenBoundingBoxMax))
  956. Helpers.drawCircle(MouseVec.x, MouseVec.y, (HitBoxFactor*width)/19, TargetKill)
  957. System.print((HitBoxFactor*width))
  958. }*/
  959. }
  960. }
  961.  
  962. PrimaryAimbot = AimbotPrediction.attach(0, a1_key_k, a1_flickmode)
  963. var cache = Cache.attach()
  964. TargetResolver.override(PredictionTargetResolver)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement