Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import "API" for Engine, IEntity, Graphics, IGraphicsListener, Vec3, Vec2, OS, Weapon, IEvent, EventType
- import "CoreTargetResolver" for TargetResolver
- import "CoreTargetSelector" for TargetSelector
- import "CoreAimbot" for CoreAimbot
- import "CoreSmoothing" for ISmoothingSource
- import "Config" for a1_enable, a1_key_k, ts1_fov, ts2_fov
- import "Config" for a1_flickmode
- import "Config" for triggerbot_hitbox_color_c
- //---------------------------CONFIG SECTION --------------------------
- //---------------------------Aimbot Settings--------------------------
- //Set to current aimbot key
- //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
- var CurrentAimbotKey = "LEFTMOUSE"
- //Set to current aimbot key
- //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
- var AimbotTwoKey = "J"
- //set to key of quick melee
- //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
- var QuickMeleeKey = "V"
- //set to key of quick melee (Make a secondary button for this)
- //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
- var PrimaryFireKey = "B"
- //Hanzo PreFire Speed Value
- var HanzoPreFireSpeed = 0.2
- var HanzoFullChargeProjectileSpeed = 120
- //---------------------------Aimbot Settings--------------------------
- //---------------------------Flick Settings--------------------------
- var FlickMode = false
- var HitBoxFactor = 60
- //---------------------------Flick Settings--------------------------
- //---------------------------Hanzo-----------------------------------
- //Charges up to atleast 80% for 200 dmg headshoots before flicking
- //Values allowed: true, false
- var ShootAbove200Dmg = false
- //---------------------------Hanzo-----------------------------------
- //---------------------------Genji----------------------------------
- //True: only slash when killable, false: always slash during ult if in range
- //Values allowed: true, false
- var Genji_KSUltMeleeOnly = false
- //---------------------------Genji---------------------------------
- var DebugDrawing = false
- var AutoMeleeOnlyKillable = true
- //------------------DO NOT EDIT UNDER HERE-------------------------
- //aimbot colors
- var PrimaryAimbot = null
- var FC = Graphics.colorARGB(0,1,0,0)
- var TC = Graphics.colorARGB(1,1,0,0)
- var TargetKill = Graphics.colorARGB(1,0,1,0)
- var TargetSafe = Graphics.colorARGB(1,1,0,0)
- //aimbot settings
- var FOV1 = ts1_fov
- var FOV2 = ts1_fov
- //trigger
- var TriggerFinished = false
- //Misc
- var MouseVec = Vec2.new(0,0)
- var MouseVecScreen = Vec2.new(Graphics.screenWidth/2, Graphics.screenHeight/2)
- var QuickMeleeState = 0
- var QuickMeleeTimer = 0
- //Flick settings
- var FlickState = 0
- var FlickResetTimer = 0
- //Prediction Caches
- var EnemyCurrentVelocity = {}
- var LastCacheTime = {}
- var LastEnemyVector = {}
- //key states
- var KeyDown = false
- var LeftClickTimer = 0
- var LastTarget = null
- var KeyState = 0
- //hanzo
- var HanzoChargeTime200Dmg = 550
- var HanzoRecoveryTime = 0
- var HanzoEHoldTime = 0
- var HanzoEActive = false
- var HanzoKeyDown = false
- //genji
- var DashCoolDown = 0
- var DashTarget = null
- var GenjiUlted = false
- var GenjiUltTimer = 0
- //ids
- var Genji_ID = 41
- var Hanzo_ID = 5
- var RoadHog_ID = 64
- var Dva_ID = 122
- var Orisa_ID = 318
- var Reinhardt_ID = 7
- var Winston_ID = 9
- var Hammond_ID = 458
- var Zarya_ID = 104
- var Ashe_ID = 512
- var Bastion_ID = 21
- var Doomfist_ID = 303
- var Junkrat_ID = 101
- var Mccree_ID = 66
- var Mei_ID = 221
- var Pharah_ID = 8
- var Reaper_ID = 2
- var Soldier76_ID = 110
- var Sombra_ID = 302
- var Symmetra_ID = 22
- var Torbjorn_ID = 6
- var Tracer_ID = 3
- var Widowmaker_ID = 10
- var Ana_ID = 315
- var Baptiste_ID = 545
- var Brigitte_ID = 405
- var Lucio_ID = 121
- var Mercy_ID = 4
- var Moira_ID = 418
- var Zenyatta_ID = 32
- //All heroes (time between flick in milliseconds)
- var FlickResetTimerForHero = {
- Genji_ID : 950,
- Hanzo_ID : 1300, // no reset for hanzu
- RoadHog_ID : 700,
- Dva_ID : 0,
- Orisa_ID : 0,
- Reinhardt_ID : 0,
- Winston_ID : 0,
- Hammond_ID : 0,
- Zarya_ID :0,
- Ashe_ID : 250,
- Bastion_ID : 0,
- Doomfist_ID : 320,
- Junkrat_ID : 650,
- Mccree_ID : 500,
- Mei_ID : 800,
- Pharah_ID : 750,
- Reaper_ID : 500,
- Soldier76_ID : 0,
- Sombra_ID : 0,
- Symmetra_ID : 0,
- Torbjorn_ID : 600,
- Tracer_ID : 0,
- Widowmaker_ID : 1400,
- Ana_ID : 800,
- Baptiste_ID : 650,
- Brigitte_ID : 0,
- Lucio_ID : 520,
- Mercy_ID : 200,
- Moira_ID : 0,
- Zenyatta_ID : 100
- }
- var ProjectileSpeed = {
- Hanzo_ID : HanzoFullChargeProjectileSpeed, //hanzo
- Torbjorn_ID : 70, //torb
- Zenyatta_ID : 80, //zen
- Genji_ID : 60, //genji
- Orisa_ID : 120, //orisa
- Mei_ID : 120, //mei
- Lucio_ID : 50,
- Mercy_ID : 40,
- RoadHog_ID : 50,
- Doomfist_ID : 80,
- Pharah_ID : 35
- }
- var ProjectileGravity = {
- Hanzo_ID : 6.1,
- Torbjorn_ID : 8.0,
- Zenyatta_ID : 0,
- Genji_ID : 0,
- Orisa_ID : 0,
- Mei_ID : 0,
- Lucio_ID : 0,
- Mercy_ID : 0,
- RoadHog_ID : 0,
- Doomfist_ID : 0,
- Pharah_ID : 0
- }
- var MakeKeys = {
- "A": 0x1E,
- "B": 0x30,
- "C": 0x2E,
- "D": 0x20,
- "E": 0x12,
- "F": 0x21,
- "G": 0x22,
- "H": 0x23,
- "I": 0x17,
- "J": 0x24,
- "K": 0x25,
- "L": 0x26,
- "M": 0x32,
- "N": 0x31,
- "O": 0x18,
- "P": 0x19,
- "Q": 0x10,
- "R": 0x13,
- "S": 0x1,
- "T": 0x14,
- "U": 0x16,
- "V": 0x2F,
- "W": 0x11,
- "X": 0x2D,
- "Y": 0x15,
- "Z": 0x2C,
- "'": 0x28,
- ",": 0x33,
- "-": 0x0C,
- ".": 0x34,
- "/": 0x35,
- "0": 0x0B,
- "1": 0x02,
- "2": 0x03,
- "3": 0x04,
- "4": 0x05,
- "5": 0x06,
- "6": 0x07,
- "7": 0x08,
- "8": 0x09,
- "9": 0x0A,
- ";": 0x27,
- "=": 0x0D,
- "[": 0x1A,
- "]": 0x1B,
- "`": 0x29,
- "LEFTSHIFT" : 0x2A,
- "LEFTALT" : 0x38
- }
- var VirtualKeys = {
- "L_Button" : 0x01,
- "0": 0x30,
- "1": 0x31,
- "2": 0x32,
- "3": 0x33,
- "4": 0x34,
- "5": 0x35,
- "6": 0x36,
- "7": 0x37,
- "8": 0x38,
- "9": 0x39,
- "A": 0x41,
- "B": 0x42,
- "C": 0x43,
- "D": 0x44,
- "E": 0x45,
- "F": 0x46,
- "G": 0x47,
- "H": 0x48,
- "I": 0x49,
- "J": 0x4A,
- "K": 0x4B,
- "L": 0x4C,
- "M": 0x4D,
- "N": 0x4E,
- "O": 0x4F,
- "P": 0x50,
- "Q": 0x51,
- "R": 0x52,
- "S": 0x53,
- "T": 0x54,
- "U": 0x55,
- "V": 0x56,
- "W": 0x57,
- "X": 0x58,
- "Y": 0x59,
- "Z": 0x5A,
- "VK_ACCEPT": 0x1E,
- "VK_ADD": 0x6B,
- "VK_APPS": 0x5D,
- "VK_ATTN": 0xF6,
- "VK_BACK": 0x08,
- "VK_BROWSER_BACK": 0xA6,
- "VK_BROWSER_FAVORITES": 0xAB,
- "VK_BROWSER_FORWARD": 0xA7,
- "VK_BROWSER_HOME": 0xAC,
- "VK_BROWSER_REFRESH": 0xA8,
- "VK_BROWSER_SEARCH": 0xAA,
- "VK_BROWSER_STOP": 0xA9,
- "VK_CANCEL": 0x03,
- "VK_CAPITAL": 0x14,
- "VK_CLEAR": 0x0C,
- "VK_CONTROL": 0x11,
- "VK_CONVERT": 0x1C,
- "VK_CRSEL": 0xF7,
- "VK_DECIMAL": 0x6E,
- "VK_DELETE": 0x2E,
- "VK_DIVIDE": 0x6F,
- "VK_DOWN": 0x28,
- "VK_END": 0x23,
- "VK_EREOF": 0xF9,
- "VK_ESCAPE": 0x1B,
- "VK_EXECUTE": 0x2B,
- "VK_EXSEL": 0xF8,
- "VK_F1": 0x70,
- "VK_F10": 0x79,
- "VK_F11": 0x7A,
- "VK_F12": 0x7B,
- "VK_F13": 0x7C,
- "VK_F14": 0x7D,
- "VK_F15": 0x7E,
- "VK_F16": 0x7F,
- "VK_F2": 0x71,
- "VK_F3": 0x72,
- "VK_F4": 0x73,
- "VK_F5": 0x74,
- "VK_F6": 0x75,
- "VK_F7": 0x76,
- "VK_F8": 0x77,
- "VK_F9": 0x78,
- "VK_FINAL": 0x18,
- "VK_HANGUEL": 0x15,
- "VK_HANGUL": 0x15,
- "VK_HANJA": 0x19,
- "VK_HELP": 0x2F,
- "VK_HOME": 0x24,
- "VK_INSERT": 0x2D,
- "VK_JUNJA": 0x17,
- "VK_KANA": 0x15,
- "VK_KANJI": 0x19,
- "VK_LAUNCH_APP1": 0xB6,
- "VK_LAUNCH_APP2": 0xB7,
- "VK_LAUNCH_MAIL": 0xB4,
- "VK_LAUNCH_MEDIA_SELECT": 0xB5,
- "VK_LCONTROL": 0xA2,
- "VK_LEFT": 0x25,
- "VK_LMENU": 0xA4,
- "VK_LSHIFT": 0xA0,
- "VK_LWIN": 0x5B,
- "VK_MBUTTON": 0x04,
- "VK_MEDIA_NEXT_TRACK": 0xB0,
- "VK_MEDIA_PLAY_PAUSE": 0xB3,
- "VK_MEDIA_PREV_TRACK": 0xB1,
- "VK_MEDIA_STOP": 0xB2,
- "VK_MENU": 0x12,
- "VK_MODECHANGE": 0x1F,
- "VK_MULTIPLY": 0x6A,
- "VK_NEXT": 0x22,
- "VK_NONCONVERT": 0x1D,
- "VK_NUMLOCK": 0x90,
- "VK_NUMPAD0": 0x60,
- "VK_NUMPAD1": 0x61,
- "VK_NUMPAD2": 0x62,
- "VK_NUMPAD3": 0x63,
- "VK_NUMPAD4": 0x64,
- "VK_NUMPAD5": 0x65,
- "VK_NUMPAD6": 0x66,
- "VK_NUMPAD7": 0x67,
- "VK_NUMPAD8": 0x68,
- "VK_NUMPAD9": 0x69,
- "VK_OEM_1": 0xBA,
- "VK_OEM_2": 0xBF,
- "VK_OEM_3": 0xC0,
- "VK_OEM_4": 0xDB,
- "VK_OEM_5": 0xDC,
- "VK_OEM_6": 0xDD,
- "VK_OEM_7": 0xDE,
- "VK_OEM_8": 0xDF,
- "VK_OEM_CLEAR": 0xFE,
- "VK_OEM_COMMA": 0xBC,
- "VK_OEM_MINUS": 0xBD,
- "VK_OEM_PERIOD": 0xBE,
- "VK_OEM_PLUS": 0xBB,
- "VK_PAUSE": 0x13,
- "VK_PLAY": 0xFA,
- "VK_PRINT": 0x2A,
- "VK_PRIOR": 0x21,
- "VK_RBUTTON": 0x02,
- "VK_RCONTROL": 0xA3,
- "VK_RETURN": 0x0D,
- "VK_RIGHT": 0x27,
- "VK_RMENU": 0xA5,
- "VK_RSHIFT": 0xA1,
- "VK_RWIN": 0x5C,
- "VK_SCROLL": 0x91,
- "VK_SELECT": 0x29,
- "VK_SEPARATOR": 0x6C,
- "VK_SHIFT": 0x10,
- "VK_SLEEP": 0x5F,
- "VK_SNAPSHOT": 0x2C,
- "VK_SPACE": 0x20,
- "VK_SUBTRACT": 0x6D,
- "VK_TAB": 0x09,
- "VK_UP": 0x26,
- "VK_VOLUME_DOWN": 0xAE,
- "VK_VOLUME_MUTE": 0xAD,
- "VK_VOLUME_UP": 0xAF,
- "VK_XBUTTON1": 0x05,
- "VK_XBUTTON2": 0x06,
- "VK_ZOOM": 0xFB,
- }
- /*Move Speed Calc */
- class FPSCounter {
- construct new() {
- _lastTick = 0
- _fps = 0
- _fps_temp = 0
- }
- fps { _fps }
- handle(time) {
- var currentTick = time * 0.001
- _fps_temp = _fps_temp + 1
- if ((currentTick - _lastTick) > 1) {
- _lastTick = currentTick
- _fps = _fps_temp
- _fps_temp = 0
- }
- }
- }
- var FPSCount = FPSCounter.new()
- class QuaternionSlerpSmoothingSource implements ISmoothingSource {
- construct new(speed) {_speed = speed / 100}
- smoothAngles(t, v1, v2) {
- return v1.qslerp(v2, _speed)
- }
- }
- var HanzoSmoothing = QuaternionSlerpSmoothingSource.new(HanzoPreFireSpeed)
- class Health {
- static GetTotalHP(target){
- if(target == null){
- return 0
- }
- return target.healthMax + target.armorMax + target.shieldMax
- }
- static GetCurrentHP(target){
- if(target == null){
- return 0
- }
- return target.health + target.shield + target.armor
- }
- }
- class Helpers {
- static min(x, y) { x > y ? y : x }
- static max(x, y) { x > y ? x : y }
- static addVectors(vec1, vec2) {
- return Vec3.new(vec1.x + vec2.x, vec1.y + vec2.y, vec1.z + vec2.z)
- }
- static subtractVectors(vec1, vec2) {
- return Vec3.new(vec1.x - vec2.x, vec1.y - vec2.y, vec1.z - vec2.z)
- }
- static multiplyVectors(vec1, vec2) {
- return Vec3.new(vec1.x * vec2.x, vec1.y * vec2.y, vec1.z * vec2.z)
- }
- static multiplyVectorN(vec1, n) {
- return Vec3.new(vec1.x * n, vec1.y * n, vec1.z * n)
- }
- static divideVectors(vec1, vec2) {
- return Vec3.new(vec1.x / vec2.x, vec1.y / vec2.y, vec1.z / vec2.z)
- }
- static divideVectorN(vec1, n) {
- return Vec3.new(vec1.x / n, vec1.y / n, vec1.z / n)
- }
- static isEqualVector(vec1, vec2) {
- return (vec1.x == vec2.x && vec1.y == vec2.y && vec1.z == vec2.z)
- }
- static drawCircle(x,y,r2,c) {
- r2 = r2 * 19 //adjust to radius of seraph
- x = Graphics.screenWidth * (x + 1)/2
- y = Graphics.screenHeight * (1 - y)/2
- var xf = null
- var yf = null
- for(i in 1..64) {
- var ang = i / 30 * Num.pi
- var xt = x + r2 * ang.cos
- var yt = y + r2 * ang.sin
- if(xf != null) {
- var res1 = Vec3.new(2 * (xt/Graphics.screenWidth) - 1,-2 * (yt/Graphics.screenHeight) + 1,0)
- var res2 = Vec3.new(2 * (xf/Graphics.screenWidth) - 1,-2 * (yf/Graphics.screenHeight) + 1,0)
- Graphics.addLine(res1.x,res1.y,c,res2.x,res2.y,c)
- }
- xf = xt
- yf = yt
- }
- }
- static CircleIntersection(point, center, radius) {
- radius = radius * 19
- var x = Graphics.screenWidth * (center.x + 1)/2
- var y = Graphics.screenHeight * (1 - center.y)/2
- var screenVec = Vec2.new(x,y)
- var result = (((screenVec.x - point.x) * (screenVec.x - point.x)) + ((screenVec.y - point.y) * (screenVec.y - point.y)))
- return result.sqrt < radius
- }
- static GetTriggerhitBox(target){
- if(target == null){
- return 25 / 19
- }
- var width = Helpers.min(4, LastTarget.screenBoundingBoxMin.distTo(LastTarget.screenBoundingBoxMax))
- return (HitBoxFactor*width)/19
- }
- }
- class AutoMelee{
- static AutoMeleeKS(){
- var key = GenjiUlted ? PrimaryFireKey : QuickMeleeKey
- if(Engine.getEnemies() == null){
- return
- }
- if(QuickMeleeState == 1){
- QuickMeleeState = 0
- OS.keyDown(MakeKeys[key])
- return
- }
- if(QuickMeleeState == 0 && OS.time - QuickMeleeTimer > 1000){
- for(target in Engine.getEnemies()) {
- if(target.isVisible && target.health > 0){
- var dist = Engine.getLocalPlayer().basePosition.distTo(target.basePosition)
- var dmg = GenjiUlted ? 170 : 30
- var range = GenjiUlted ? 5 : 2.75
- if(!AutoMeleeOnlyKillable){
- dmg = 10000
- }
- if((Health.GetCurrentHP(target) <= dmg || (!Genji_KSUltMeleeOnly && GenjiUlted)) && dist <= range){
- OS.keyUp(MakeKeys[key])
- QuickMeleeState = 1
- QuickMeleeTimer = OS.time
- return
- }
- }
- }
- }
- }
- }
- class Genji{
- static drawDashRange() {
- var genjiDashLength = 15
- for(entity in Engine.getEnemies()) {
- if (entity.health > 0 && entity.isVisible) {
- var enemyScreenPos = entity.basePosition.project()
- var color = null
- Engine.getLocalPlayer().basePosition.distTo(entity.basePosition) <= genjiDashLength ? color = TargetKill : color = TargetSafe
- if(enemyScreenPos.validate()){
- Graphics.addLine(0, -1, color, enemyScreenPos.x, enemyScreenPos.y, color)
- }
- }
- }
- }
- static CheckForUlt(){
- if(OS.isKeyDown(VirtualKeys["Q"])){
- GenjiUlted = true
- GenjiUltTimer = OS.time
- }else{
- if(OS.time - GenjiUltTimer > 6000){
- GenjiUlted = false
- }
- }
- }
- static DashKS() {
- var dash_dmg = 50
- var genjiDashLength = 15
- if(KeyState == 1){
- OS.keyDown(MakeKeys["LEFTSHIFT"])
- KeyState = 0
- if(DashTarget){
- if(DashTarget.health <= 0){
- DashCoolDown = 0
- }else{
- DashCoolDown = OS.time
- }
- }
- return
- }
- if(DashTarget){
- if(DashTarget.health <= 0){
- DashCoolDown = 0
- }
- }
- if(OS.time - DashCoolDown < 2000){
- return
- }
- if(KeyState == 0){
- for(entity in Engine.getEnemies()) {
- if (entity.health > 0 && entity.isVisible && Health.GetCurrentHP(entity) <= 50) {
- if (Engine.getLocalPlayer().basePosition.distTo(entity.basePosition) <= genjiDashLength) {
- var calcPred = Prediction.PredictPos(entity, 50, 0)
- var dt = calcPred.sub(Engine.getCameraPosition())
- var aimDir = dt.normalized()
- var aimAng = Vec3.new(aimDir.y.atan(aimDir.x), aimDir.z.asin, 0)
- Engine.setViewAngles(aimAng)
- DashTarget = entity
- DashCoolDown = 0
- OS.keyUp(MakeKeys["LEFTSHIFT"])
- KeyState = 1
- return
- }
- }
- }
- }
- }
- }
- class Hanzo{
- static SetChargeProjectileSpeed(){
- if(OS.time - HanzoRecoveryTime < 550){
- LeftClickTimer = OS.time
- return
- }
- if(OS.isKeyDown(VirtualKeys["L_Button"])){
- if(!KeyDown){
- LeftClickTimer = OS.time
- KeyDown = true
- }
- var timeChange = OS.time - LeftClickTimer
- var projSpeed = Helpers.min(26 + (HanzoFullChargeProjectileSpeed-26)/700*timeChange, HanzoFullChargeProjectileSpeed)
- if(ShootAbove200Dmg){
- if(OS.time - LeftClickTimer < HanzoChargeTime200Dmg){
- ProjectileSpeed[Hanzo_ID] = HanzoFullChargeProjectileSpeed
- }
- }
- ProjectileSpeed[Hanzo_ID] = projSpeed
- }else{
- if(KeyDown == true){
- KeyDown = false
- HanzoRecoveryTime = OS.time
- LeftClickTimer = OS.time
- }
- if(OS.time - LeftClickTimer > 100){
- ProjectileSpeed[Hanzo_ID] = HanzoFullChargeProjectileSpeed
- LeftClickTimer = OS.time
- }
- }
- }
- static CheckActiveE(){
- if(OS.isKeyDown(VirtualKeys["E"])){
- HanzoEActive = true
- if(OS.time - HanzoEHoldTime > 400){
- FlickState = 0
- }else{
- return
- }
- if(AimbotTwoKey != "LEFTMOUSE"){
- OS.keyUp(MakeKeys[AimbotTwoKey])
- }else{
- OS.leftClick = true
- }
- HanzoKeyDown = true
- if(LastTarget != null){
- var pos = Prediction.PredictPos(LastTarget, -1, -1)
- if(Helpers.CircleIntersection(MouseVecScreen, pos.project(), Helpers.GetTriggerhitBox(LastTarget))){
- OS.keyUp(MakeKeys[PrimaryFireKey])
- OS.keyDown(MakeKeys[PrimaryFireKey])
- OS.keyDown(MakeKeys[AimbotTwoKey])
- FlickState = 1
- HanzoEHoldTime = OS.time
- }
- }
- }else{
- HanzoEActive = false
- if(HanzoKeyDown){
- if(AimbotTwoKey != "LEFTMOUSE"){
- OS.keyDown(MakeKeys[AimbotTwoKey])
- }else{
- OS.leftClick = false
- }
- HanzoKeyDown = false
- }
- }
- }
- }
- class Prediction{
- static PredictPos(target, speed, gravity){
- var projectileSpeed = ProjectileSpeed[Engine.getLocalPlayer().heroId]
- var projectileGravity = ProjectileGravity[Engine.getLocalPlayer().heroId]
- if(Engine.getLocalPlayer() == null || target == null || projectileSpeed == null || EnemyCurrentVelocity[target.uid] == null){
- return target.headPosition
- }
- if(speed >= 0){
- projectileSpeed = speed
- }
- if(gravity >= 0){
- projectileGravity = gravity
- }
- var distant = target.basePosition.distTo(Engine.getLocalPlayer().basePosition)
- var travelTime = (distant / projectileSpeed)
- var predPos = Helpers.multiplyVectorN(EnemyCurrentVelocity[target.uid], travelTime)
- predPos.z = predPos.z + (projectileGravity * travelTime.pow(2) * 0.5)
- return Helpers.addVectors(target.headPosition, predPos)
- }
- }
- var SlowTarget = null
- class PredictionTargetResolver is TargetResolver {
- static resolve(i, target) {
- if(FlickState == 1){
- return Vec3.new(Num.largest,Num.largest,Num.largest)
- }
- var currentFOV = 0
- if(i == 1){
- currentFOV = FOV2
- }else{
- currentFOV = FOV1
- }
- /*if(LastTarget == null || !LastTarget.isVisible || LastTarget.health <= 0){
- if(Helpers.CircleIntersection(MouseVecScreen, target.headPosition.project(), currentFOV+1)){
- LastTarget = target
- }
- }else{
- target = LastTarget
- }*/
- LastTarget = target
- if(Engine.getLocalPlayer().heroId == Hanzo_ID){
- if((FlickMode && ShootAbove200Dmg) && !HanzoEActive){
- if(OS.time - LeftClickTimer < HanzoChargeTime200Dmg){
- if(Helpers.CircleIntersection(MouseVecScreen, target.headPosition.project(), currentFOV+1)){
- var cameraPos = Engine.getCameraPosition()
- var camAng = Engine.getViewAngles()
- var pos = Prediction.PredictPos(target, -1, -1)
- var dt = pos.sub(cameraPos)
- var aimDir = dt.normalized()
- var aimAng = Vec3.new(aimDir.y.atan(aimDir.x), aimDir.z.asin, 0)
- Engine.setViewAngles(HanzoSmoothing.smoothAngles(0, camAng, aimAng))
- }
- return Vec3.new(Num.largest,Num.largest,Num.largest)
- }
- }
- }
- if(!ProjectileSpeed[Engine.getLocalPlayer().heroId]){
- return target.headPosition
- }
- return Prediction.PredictPos(target, -1, -1)
- }
- }
- class Trigger{
- static AutoTrigger(key){
- if(TriggerFinished == true){
- OS.keyDown(MakeKeys[PrimaryFireKey])
- TriggerFinished = false
- return
- }else{
- if(key.down && LastTarget){
- var pos = null
- if(ProjectileSpeed[Engine.getLocalPlayer().heroId] != null){
- pos = Prediction.PredictPos(LastTarget, -1, -1)
- }else{
- pos = LastTarget.headPosition
- }
- if(Helpers.CircleIntersection(MouseVecScreen, pos.project(), Helpers.GetTriggerhitBox(LastTarget))){
- if(Engine.getLocalPlayer().heroId == Hanzo_ID){
- if(ShootAbove200Dmg){
- if(OS.time - LeftClickTimer > HanzoChargeTime200Dmg){
- OS.keyDown(MakeKeys[PrimaryFireKey])
- FlickState = 1
- FlickResetTimer = OS.time
- HanzoRecoveryTime = OS.time
- }
- }else{
- OS.keyUp(MakeKeys[PrimaryFireKey])
- TriggerFinished = true
- FlickState = 1
- FlickResetTimer = OS.time
- HanzoRecoveryTime = OS.time
- }
- }else{
- OS.keyUp(MakeKeys[PrimaryFireKey])
- TriggerFinished = true
- FlickResetTimer = OS.time
- FlickState = 1
- }
- }
- }
- }
- }
- }
- class AimbotPrediction implements IEvent {
- static getPrimaryInstance() { PrimaryAimbot }
- construct attach(i, key, flick) {
- _i = i
- _key = key
- //FlickMode = flick
- _targetState = 0
- this.registerAs(EventType.CoreLogic)
- }
- UpdateTarget(){
- if(LastTarget != null){
- if(LastTarget.health <= 0 || (!_key.down && !HanzoEActive)){
- LastTarget = null
- }
- }
- }
- tick(n) {
- if(Engine.getLocalPlayer() == null){
- return
- }
- this.UpdateTarget()
- AutoMelee.AutoMeleeKS()
- if(FlickMode == 0){
- FlickState = 0
- }else{
- if(!_key.down && !HanzoEActive){
- FlickState = 0
- }
- if(OS.time - FlickResetTimer > FlickResetTimerForHero[Engine.getLocalPlayer().heroId]){
- FlickState = 0
- }
- }
- var heroID = Engine.getLocalPlayer().heroId
- if(heroID == Genji_ID){
- //Genji.drawDashRange(Engine.getEnemies())
- Genji.DashKS()
- Genji.CheckForUlt()
- }
- if(heroID == Hanzo_ID){
- Hanzo.SetChargeProjectileSpeed()
- Hanzo.CheckActiveE()
- }
- Trigger.AutoTrigger(_key)
- if(DebugDrawing){
- for(ent in Engine.getEnemies()) {
- var predPos = Prediction.PredictPos(ent, -1, -1)
- if (ent.health > 0 && ent.isVisible && predPos != null) {
- var project = predPos.project()
- if (project.validate()) {
- Graphics.addLine(0,-1,FC,project.x,project.y,TC)
- }
- }
- }
- }
- }
- }
- class Cache implements IEvent {
- construct attach() {
- this.registerAs(EventType.CoreLogic)
- }
- UpdateCache(){
- if(Engine.getEnemies() == null){
- return
- }
- for(ent in Engine.getEnemies()) {
- if (ent.health > 0) {
- if(EnemyCurrentVelocity[ent.uid] == null || LastCacheTime[ent.uid] == null || LastEnemyVector[ent.uid] == null) {
- EnemyCurrentVelocity[ent.uid] = Vec3.new(0,0,0)
- LastCacheTime[ent.uid] = 0
- LastEnemyVector[ent.uid] = ent.basePosition
- }else{
- var time = FlickMode ? FPSCount.fps/4 : FPSCount.fps
- if(OS.time - LastCacheTime[ent.uid] > time){
- var direction = ent.basePosition.sub(LastEnemyVector[ent.uid]).normalized()
- var posAfter = Helpers.addVectors(ent.basePosition, ent.velocity)
- var speed = ent.basePosition.distTo(posAfter)
- var velocity = Helpers.multiplyVectorN(direction, speed)
- EnemyCurrentVelocity[ent.uid] = velocity
- LastCacheTime[ent.uid] = OS.time
- }
- LastEnemyVector[ent.uid] = ent.basePosition
- }
- }
- }
- }
- tick(n) {
- FPSCount.handle(OS.time)
- this.UpdateCache()
- /*
- if(LastTarget){
- var width = Helpers.min(4, LastTarget.screenBoundingBoxMin.distTo(LastTarget.screenBoundingBoxMax))
- Helpers.drawCircle(MouseVec.x, MouseVec.y, (HitBoxFactor*width)/19, TargetKill)
- System.print((HitBoxFactor*width))
- }*/
- }
- }
- PrimaryAimbot = AimbotPrediction.attach(0, a1_key_k, a1_flickmode)
- var cache = Cache.attach()
- TargetResolver.override(PredictionTargetResolver)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement