SHARE
TWEET

Untitled

a guest May 21st, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import "API" for IEvent, IEntity, IGraphicsListener, Engine, EventType, Graphics, Vec3, Vec2, OS
  2. import "CoreTargetResolver" for ITargetResolver, TargetResolver
  3.  
  4. class AimSettings {
  5.     construct new() {
  6.         _keys = {
  7.             "LB": 0x01,
  8.             "RB": 0x02,
  9.             "LS": 0xA0,
  10.             "ALT": 0x12
  11.         }
  12.         _heroes = {
  13.             64: "RoadHog",
  14.             41: "Genji",
  15.             122: "Dva",
  16.             318: "Orisa",
  17.             7: "Reinhardt",
  18.             9: "Winston",
  19.             458: "Ball",
  20.             104: "Zarya",
  21.             512: "Ashe",
  22.             21: "Bastion",
  23.             303: "Doomfist",
  24.             5: "Hanzo",
  25.             101: "Junkrat",
  26.             66: "Mccree",
  27.             221: "Mei",
  28.             8: "Pharah",
  29.             2: "Reaper",
  30.             110: "Soldier76",
  31.             302: "Sombra",
  32.             22: "Symmetra",
  33.             6: "Torbjorn",
  34.             3: "Tracer",
  35.             10: "Widowmaker",
  36.             315: "Ana",
  37.             545: "Baptiste",
  38.             405: "Brigitte",
  39.             121: "Lucio",
  40.             4: "Mercy",
  41.             418: "Moira",
  42.             32: "Zenyatta",
  43.         }
  44.  
  45.         _dmg = {
  46.             64: "RoadHog",
  47.             41: "Genji",
  48.             122: "Dva",
  49.             318: "Orisa",
  50.             7: "Reinhardt",
  51.             9: "Winston",
  52.             458: "Ball",
  53.             104: "Zarya",
  54.             512: "Ashe",
  55.             21: "Bastion",
  56.             303: "Doomfist",
  57.             5: "Hanzo",
  58.             101: "Junkrat",
  59.             66: "Mccree",
  60.             221: "Mei",
  61.             8: "Pharah",
  62.             2: "Reaper",
  63.             110: "Soldier76",
  64.             302: "Sombra",
  65.             22: "Symmetra",
  66.             6: "Torbjorn",
  67.             3: "Tracer",
  68.             10: "Widowmaker",
  69.             315: "Ana",
  70.             545: "Baptiste",
  71.             405: "Brigitte",
  72.             121: "Lucio",
  73.             4: "Mercy",
  74.             418: "Moira",
  75.             32: "Zenyatta",
  76.         }
  77.  
  78.         _projectileSpeed = {
  79.             41: 75,
  80.             5: 110,
  81.             32: 110,
  82.             4: 60,
  83.             6: 70,
  84.             121: 60,
  85.             318: 120,
  86.             122: 60,
  87.             221: 120
  88.         }
  89.         _projectileGravity = {
  90.             41: 0,
  91.             5: 9.8,
  92.             32: 0,
  93.             4: 0,
  94.             6: 9.8,
  95.             121: 0,
  96.             318: 0,
  97.             122: 0,
  98.             221: 0
  99.         }
  100.     }
  101.     keys { _keys }
  102.     heroes { _heroes }
  103.     dmg { _dmg }
  104.     projectileSpeed { _projectileSpeed }
  105.     projectileGravity { _projectileGravity }
  106. }
  107.  
  108. class FPSCounter {
  109.     construct new() {
  110.     _lastTick = 0
  111.     _fps = 0
  112.     _fps_temp = 0
  113.     }
  114.     fps { _fps }   
  115.     handle(time) {
  116.         var currentTick = time * 0.001
  117.         _fps_temp = _fps_temp + 1
  118.         if ((currentTick - _lastTick) > 1) {
  119.             _lastTick = currentTick
  120.             _fps = _fps_temp
  121.             _fps_temp = 0
  122.         }
  123.        
  124.     }
  125. }
  126.  
  127.  
  128. class Common {
  129.     static viewPortToScreenX(x) {
  130.         return Graphics.screenWidth * (x + 1)/2
  131.     }
  132.  
  133.     static viewPortToScreenY(y) {
  134.         return Graphics.screenHeight * (1 - y)/2
  135.     }
  136.  
  137.     static screenToViewPort(x,y) {
  138.         return Vec3.new(2 * (x/Graphics.screenWidth) - 1,-2 * (y/Graphics.screenHeight) + 1,0)
  139.     }
  140.  
  141.     static entityHealthPercent(ent) {
  142.         return (ent.health/ent.healthMax) * 100
  143.     }
  144.  
  145.     static dotProduct(vec1,vec2) {  
  146.      return (vec1.x * vec2.x) + (vec1.y * vec2.y) + (vec1.z * vec2.z)
  147.     }
  148.  
  149.     static crossProduct(vec1,vec2) {
  150.      var x = vec1.y * vec2.z - vec1.z * vec2.y
  151.      var y = vec1.z * vec2.x - vec1.x * vec2.z
  152.      var z = vec1.x * vec2.y - vec1.y * vec2.x
  153.      return Vec3.new(x,y,z)
  154.     }
  155.  
  156.     static lengthSqr2D(vec1) {
  157.     return (vec1.x * vec1.x) + (vec1.y * vec1.y)
  158.     }
  159.  
  160. //Thanks to dev with no profile name in discord
  161.      static multiplyVectors(vec1, vec2) {
  162.      return Vec3.new(vec1.x * vec2.x, vec1.y * vec2.y, vec1.z * vec2.z)
  163.      }
  164.  
  165.      static multiplyVectors2D(vec1, n) {
  166.      return Vec2.new(vec1.x * n, vec1.y * n)
  167.      }
  168.  
  169.     static addVectors(vec1, vec2) {
  170.      return Vec3.new(vec1.x + vec2.x, vec1.y + vec2.y, vec1.z + vec2.z)
  171.     }
  172.     static addVectors2D(vec1, vec2) {
  173.      return Vec2.new(vec1.x + vec2.x, vec1.y + vec2.y)
  174.     }
  175.     static subtractVectors(vec1, vec2) {
  176.      var res = Vec3.new(vec1.x - vec2.x, vec1.y - vec2.y, vec1.z - vec2.z)
  177.      return res
  178.     }
  179.     static subtractVectors2D(vec1, vec2) {
  180.      var res = Vec2.new(vec1.x - vec2.x, vec1.y - vec2.y)
  181.      return res
  182.     }
  183.     static multiplyVectorN(vec1, n) {
  184.      return Vec3.new(vec1.x * n, vec1.y * n, vec1.z * n)
  185.     }
  186.     static drawCircle(x,y,r2,c) {
  187.        x = Graphics.screenWidth * (x + 1)/2
  188.        y = Graphics.screenHeight * (1 - y)/2
  189.         var xf = null
  190.         var yf = null
  191.         for(i in 1..64) {
  192.             var ang = i / 30 * Num.pi
  193.             var xt = x + r2 * ang.cos
  194.             var yt = y + r2 * ang.sin
  195.             if(xf != null) {
  196.             var res1 = Vec3.new(2 * (xt/Graphics.screenWidth) - 1,-2 * (yt/Graphics.screenHeight) + 1,0)
  197.             var res2 = Vec3.new(2 * (xf/Graphics.screenWidth) - 1,-2 * (yf/Graphics.screenHeight) + 1,0)
  198.                 Graphics.addLine(res1.x,res1.y,c,res2.x,res2.y,c)
  199.             }
  200.             xf = xt
  201.             yf = yt
  202.         }
  203.     }
  204.     static drawFov(radius,drawfov) {
  205.         var tc = Graphics.colorARGB(255,255,255,255)
  206.         var screenM = Vec2.new(0,0)
  207.         if(drawfov) {
  208.         drawCircle(screenM.x, screenM.y, radius, tc)
  209.         }
  210.     }
  211.  
  212. }
  213.  
  214. class AimPred {
  215.   //Thanks to qwert1119
  216.     static calcGravityZ(z, projGravity, projTravelTime) {
  217.         return z + (projGravity * projTravelTime.pow(2) * 0.5)
  218.     }
  219.     static calcStaticTarget(entAimVec, projectileTravelTime, projectileGravity) {
  220.         entAimVec.z = calcGravityZ(entAimVec.z, projectileGravity, projectileTravelTime)
  221.         return entAimVec
  222.     }
  223.     static calcMovingTarget(uid, entBasePos, entAimVec, projectileTravelTime, projectileGravity) {
  224.         var targetVelocityVec3 = entBasePos.sub(Global.PositionCache[uid])
  225.         var targetSpeed = Global.PositionCache[uid].distTo(entBasePos) * Global.FPSCounter.fps
  226.         var predictionScale = projectileTravelTime * targetSpeed
  227.         var predictedPos = (entAimVec.add(targetVelocityVec3.normalized().scale(predictionScale)))
  228.         predictedPos.z = calcGravityZ(predictedPos.z, projectileGravity, projectileTravelTime)
  229.         return predictedPos
  230.     }
  231.    
  232.     static predAim() {
  233.         var lPlayer = Engine.getLocalPlayer()
  234.         if (lPlayer && Global.AimSettings.projectileSpeed.containsKey(lPlayer.heroId)) {
  235.             var enemies = Engine.getEnemies()
  236.             if (enemies) {
  237.                 for(ent in enemies) {
  238.                     var uid = ent.uid
  239.                     if (ent.health > 0) {
  240.                         var localPlayerPos = lPlayer.basePosition
  241.                         var basePos = ent.basePosition
  242.                         var headPos = ent.headPosition
  243.                         if (!Global.PositionCache[uid]) { Global.PositionCache[uid] = basePos }
  244.  
  245.                         var distance = basePos.distTo(localPlayerPos)
  246.                         var projectileTravelTime = distance / Global.AimSettings.projectileSpeed[lPlayer.heroId]
  247.                         var aimPos = null
  248.                         if (Global.PositionCache[uid].x == basePos.x && Global.PositionCache[uid].y == basePos.y && Global.PositionCache[uid].z == basePos.z) {
  249.                             aimPos = calcStaticTarget(headPos, projectileTravelTime, Global.AimSettings.projectileGravity[lPlayer.heroId])
  250.                         } else {
  251.                             aimPos = calcMovingTarget(uid, basePos, headPos, projectileTravelTime, Global.AimSettings.projectileGravity[lPlayer.heroId])
  252.                         }
  253.                         Global.PredictedCache[uid] = aimPos
  254.                         Global.PositionCache[uid] = basePos
  255.                     }
  256.                 }
  257.             }
  258.         }
  259.     }
  260. }
  261.  
  262. class AimBot {
  263.    static aimTarget(x,y,speed) {
  264.     var targetX = 0
  265.     var targetY = 0
  266.     x = Graphics.screenWidth * (x + 1)/2
  267.     y = Graphics.screenHeight * (1 - y)/2
  268.     if(x != 0) {
  269.         if(x > Graphics.screenWidth / 2) {
  270.             targetX = -(Graphics.screenWidth / 2 - x)
  271.             targetX = targetX / speed
  272.             if(targetX + Graphics.screenWidth / 2 > Graphics.screenWidth / 2 * 2) {
  273.             targetX = 0
  274.             }
  275.         }
  276.         if (x < Graphics.screenWidth / 2) {
  277.             targetX = x - Graphics.screenWidth / 2
  278.             targetX = targetX /speed
  279.             if (targetX + Graphics.screenWidth / 2 < 0) {
  280.             targetX = 0
  281.            }
  282.         }
  283.     }
  284.  
  285.     if (y != 0) {
  286.          if (y > Graphics.screenHeight / 2) {
  287.                 targetY = -(Graphics.screenHeight / 2 - y)
  288.                 targetY = targetY /speed
  289.                 if (targetY + Graphics.screenHeight / 2 > Graphics.screenHeight / 2 * 2) {
  290.                 targetY = 0
  291.                 }
  292.             }
  293.  
  294.             if (y < Graphics.screenHeight / 2) {
  295.                 targetY = y - Graphics.screenHeight / 2
  296.                 targetY = targetY /speed
  297.                 if (targetY + Graphics.screenHeight / 2 < 0) {
  298.                 targetY = 0            
  299.                 }
  300.             }
  301.         }
  302.         var checkPos = Vec2.new(targetX,targetY)
  303.         var currentPos = Vec2.new(x,y)
  304.         var ppPos = checkPos
  305.         var ppPos2 = Common.multiplyVectors2D(ppPos,0.56)
  306.         var ppPos3 = Common.addVectors2D(ppPos2,checkPos)
  307.         //var predPos = Common.addVectors2D(Common.multiplyVectors2D(Common.subtractVectors2D(checkPos,currentPos).normalized(),220),currentPos)
  308.         if(checkPos.validate()){
  309.         OS.moveMouse(checkPos.x,checkPos.y)
  310.         }    
  311.     }
  312.  
  313.     static getClosestEnemy() {
  314.         var lowestDistance = 99999
  315.         var closestPlayer = null
  316.         for(currentPlayer in Engine.getEnemies()) {
  317.         var currentPlayerPos = currentPlayer.headPosition.project()
  318.         var curP = Vec2.new(currentPlayerPos.x,currentPlayerPos.y)
  319.         var sP = Vec2.new(0, 0)
  320.         var currentPlayerDistance = curP.distTo(sP)
  321.  
  322.         if(currentPlayerDistance < lowestDistance) {
  323.             lowestDistance = currentPlayerDistance
  324.             closestPlayer = currentPlayer
  325.         }
  326.       }
  327.  
  328.      if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible){        
  329.         return closestPlayer
  330.      }
  331.  
  332.     }
  333.  
  334.     static pointInCircle(point,cirCenter,radius) {
  335.         var x = Graphics.screenWidth * (cirCenter.x + 1)/2
  336.         var y = Graphics.screenHeight * (1 - cirCenter.y)/2
  337.         var cirScreen = Vec2.new(x,y)
  338.         var res = (((cirScreen.x - point.x) * (cirScreen.x - point.x)) + ((cirScreen.y - point.y) * (cirScreen.y - point.y)))
  339.         System.print("%(res.sqrt)")
  340.         return res.sqrt < radius
  341.     }
  342.     static aimTar(currentPlayer) {
  343.         var bonePos = currentPlayer.headPosition.project()
  344.         var x = Graphics.screenWidth * (bonePos.x + 1)/2
  345.         var y = Graphics.screenHeight * (1 - bonePos.y)/2
  346.         return Vec2.new(x,y)
  347.     }
  348.  
  349.    
  350.     static shootClosestEnemy(keyDown,speed) {
  351.         var lowestDistance = 99999
  352.         var closestPlayer = null
  353.         for(currentPlayer in Engine.getEnemies()) {
  354.         var currentPlayerPos = currentPlayer.headPosition.project()
  355.         var curP = Vec2.new(currentPlayerPos.x,currentPlayerPos.y)
  356.         var sP = Vec2.new(0, 0)
  357.         var currentPlayerDistance = curP.distTo(sP)
  358.  
  359.         if(currentPlayerDistance < lowestDistance) {
  360.             lowestDistance = currentPlayerDistance
  361.             closestPlayer = currentPlayer
  362.         }
  363.     }
  364.     if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible){        
  365.         var bonePos = closestPlayer.headPosition.project() //_closestPlayer.getBonePosition(2).project()
  366.        
  367.         var lp = Engine.getLocalPlayer()
  368.         if (Global.AimSettings.projectileSpeed.containsKey(lp.heroId) || Global.PredictedCache[closestPlayer.uid] || (lp.heroId == 122 && lp.healthMax <= 400)) {
  369.             bonePos = Global.PredictedCache[closestPlayer.uid].project()
  370.         }
  371.  
  372.          if(OS.isKeyDown(keyDown)){
  373.              aimTarget(bonePos.x,bonePos.y,speed)  
  374.          }  
  375.     }
  376.  
  377.   }
  378.  
  379.   static shootClosestFov(keyDown,speed,fov,drawfov) {
  380.         Common.drawFov(fov,drawfov)
  381.         var lowestDistance = 99999
  382.         var closestPlayer = null
  383.         for(currentPlayer in Engine.getEnemies()) {
  384.         var currentPlayerPos = currentPlayer.headPosition.project()
  385.         var curP = Vec2.new(currentPlayerPos.x,currentPlayerPos.y)
  386.         var sP = Vec2.new(0, 0)
  387.         var currentPlayerDistance = curP.distTo(sP)
  388.  
  389.         if(currentPlayerDistance < lowestDistance) {
  390.             lowestDistance = currentPlayerDistance
  391.             closestPlayer = currentPlayer
  392.         }
  393.     }
  394.     if(closestPlayer != null && closestPlayer.validate()){        
  395.         var bonePos = closestPlayer.headPosition.project()
  396.         var lp = Engine.getLocalPlayer()
  397.         if (Global.AimSettings.projectileSpeed.containsKey(lp.heroId) || Global.PredictedCache[closestPlayer.uid] || (lp.heroId == 122 && lp.healthMax <= 400)) {
  398.             bonePos = Global.PredictedCache[closestPlayer.uid].project()
  399.         }
  400.  
  401.         var sP2 = Vec2.new(Graphics.screenWidth/2, Graphics.screenHeight/2)
  402.         var head = aimTar(closestPlayer) //_closestPlayer.getBonePosition(2).project()
  403.          if(OS.isKeyDown(keyDown) && pointInCircle(sP2,bonePos,fov) && closestPlayer.health > 0 && closestPlayer.isVisible){
  404.              aimTarget(bonePos.x,bonePos.y,speed)  
  405.          }  
  406.     }
  407.  
  408.   }
  409.  
  410.   static shootClosestEnemyAna(keyDown,speed) {
  411.         var lowestDistance = 99999
  412.         var closestPlayer = null
  413.         for(currentPlayer in Engine.getEnemies()) {
  414.         var currentPlayerPos = currentPlayer.headPosition.project()
  415.         var curP = Vec2.new(currentPlayerPos.x,currentPlayerPos.y)
  416.         var sP = Vec2.new(0, 0)
  417.         var currentPlayerDistance = curP.distTo(sP)
  418.  
  419.         if(currentPlayerDistance < lowestDistance) {
  420.             lowestDistance = currentPlayerDistance
  421.             closestPlayer = currentPlayer
  422.         }
  423.     }
  424.     if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible){        
  425.         var bonePos = closestPlayer.getBonePosition(2).project() //_closestPlayer.getBonePosition(2).project()
  426.          if(OS.isKeyDown(keyDown)){
  427.              aimTarget(bonePos.x,bonePos.y,speed)  
  428.          }  
  429.     }
  430.  
  431.   }
  432.  
  433.   static drawLine() {
  434.      var fc = Graphics.colorARGB(0,1,0,0)
  435.         var tc = Graphics.colorARGB(1,1,0,0)
  436.         var fx = 0
  437.         var fy = -0.25
  438.        
  439.         for(ent in Engine.getEnemies()) {
  440.             var screenPos = ent.boundingBoxMin.project()
  441.             var sP = Vec2.new(Graphics.screenWidth/2, Graphics.screenHeight/2)
  442.             if(screenPos.validate() && ent.health > 0){
  443.                 Common.drawCircle(screenPos.x, screenPos.y, 20, tc)
  444.                 //Graphics.addLine(fx,fy,fc,screenPos.x,screenPos.y,tc)
  445.             }
  446.             if(pointInCircle(sP,screenPos,20)) {
  447.                Graphics.addLine(fx,fy,fc,screenPos.x,screenPos.y,tc)
  448.             }
  449.         }
  450.  }
  451.  
  452.  static drawLine2() {
  453.      var fc = Graphics.colorARGB(0,1,0,0)
  454.         var tc = Graphics.colorARGB(1,1,0,0)
  455.         var fx = 0
  456.         var fy = -0.25
  457.        
  458.         for(ent in Engine.getEnemies()) {
  459.             var screenPos = ent.headPosition.project()
  460.             var sP = Vec2.new(Graphics.screenWidth/2, Graphics.screenHeight/2)
  461.             if(screenPos.validate() && ent.health > 0){
  462.                 Common.drawCircle(screenPos.x, screenPos.y, 20, tc)
  463.                 //Graphics.addLine(fx,fy,fc,screenPos.x,screenPos.y,tc)
  464.             }
  465.             if(pointInCircle(sP,screenPos,100)) {
  466.                Graphics.addLine(fx,fy,fc,screenPos.x,screenPos.y,tc)
  467.             }
  468.         }
  469.  }
  470.  
  471.  
  472.   static shootVisableEnemy(keyDown,speed) {
  473.         var lowestDistance = 0
  474.         var closestPlayer = null
  475.         for(currentPlayer in Engine.getEnemies()) {
  476.         var currentPlayerPos = currentPlayer.headPosition.project()
  477.         var curP = Vec2.new(currentPlayerPos.x,currentPlayerPos.y)
  478.         var sP = Vec2.new(0, 0)
  479.         var currentPlayerDistance = curP.distTo(sP)
  480.  
  481.         if(currentPlayer.isVisible && currentPlayer.health > lowestDistance) {
  482.             lowestDistance = currentPlayerDistance
  483.             closestPlayer = currentPlayer
  484.         }
  485.     }
  486.     if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible){        
  487.         var bonePos = closestPlayer.headPosition.project() //_closestPlayer.getBonePosition(2).project()
  488.          if(OS.isKeyDown(keyDown)){
  489.              aimTarget(bonePos.x,bonePos.y,speed)  
  490.          }  
  491.     }
  492.  
  493.   }
  494.  
  495.   static healClosestAlly(keyDown,speed) {
  496.         var lowestDistance = 99999
  497.         var closestPlayer = null
  498.         for(currentPlayer in Engine.getAllies()) {
  499.         var currentPlayerPos = currentPlayer.basePosition.project()
  500.         var curP = Vec2.new(currentPlayerPos.x,currentPlayerPos.y)
  501.         var sP = Vec2.new(0, 0)
  502.         var currentPlayerDistance = curP.distTo(sP)
  503.  
  504.         if(currentPlayerDistance < lowestDistance) {
  505.             lowestDistance = currentPlayerDistance
  506.             closestPlayer = currentPlayer
  507.         }
  508.     }
  509.     if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible){        
  510.         var bonePos = closestPlayer.headPosition.project() //_closestPlayer.getBonePosition(2).project()
  511.          if(OS.isKeyDown(keyDown)){
  512.              aimTarget(bonePos.x,bonePos.y,speed)  
  513.          }  
  514.     }
  515.  
  516.   }
  517.  
  518.  
  519.   static heallowestAlly(keyDown,speed) {
  520.         var lowestHealth = 99999
  521.         var closestPlayer = null
  522.         for(currentPlayer in Engine.getAllies()) {
  523.         var currentPlayerHealth = currentPlayer.health + currentPlayer.shield
  524.  
  525.         if(currentPlayerHealth < lowestHealth) {
  526.             lowestHealth = currentPlayerHealth
  527.             closestPlayer = currentPlayer
  528.         }
  529.     }
  530.     if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible){        
  531.         var bonePos = closestPlayer.basePosition.project() //_closestPlayer.getBonePosition(2).project()
  532.          if(OS.isKeyDown(keyDown)){
  533.              aimTarget(bonePos.x,bonePos.y,speed)  
  534.          }  
  535.     }
  536.  
  537.   }
  538.  
  539.   static logicShoot(keyDown,keyDown2,sleepSpeed,healSpeed,shootSpeed) {
  540.         var lowestHealth = 99999
  541.         var closestPlayer = null
  542.         for(currentPlayer in Engine.getAllies()) {
  543.         var currentPlayerHealth = currentPlayer.health + currentPlayer.shield
  544.  
  545.         if(currentPlayerHealth < lowestHealth) {
  546.             lowestHealth = currentPlayerHealth
  547.             closestPlayer = currentPlayer
  548.         }
  549.     }
  550.     if(OS.isKeyDown(keyDown2)) {
  551.         shootClosestEnemyAna(keyDown2,sleepSpeed)
  552.     }
  553.     if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible && Common.entityHealthPercent(closestPlayer) < 75 ){        
  554.         var bonePos = closestPlayer.getBonePosition(2).project()
  555.          if(OS.isKeyDown(keyDown)){
  556.              aimTarget(bonePos.x,bonePos.y,healSpeed)  
  557.          }  
  558.     } else {
  559.         if(OS.isKeyDown(keyDown)){
  560.         shootClosestEnemyAna(keyDown,shootSpeed)
  561.     }
  562.     }
  563.   }
  564.  
  565.    static logicShoot2(keyDown,keyDown2,sleepSpeed,healSpeed,shootSpeed) {
  566.        var  lowestDistance = 99999
  567.         var closestPlayer = null
  568.         for(currentPlayer in Engine.getAllies()) {
  569.         var currentPlayerPos = currentPlayer.basePosition.project()
  570.         var curP = Vec2.new(currentPlayerPos.x,currentPlayerPos.y)
  571.         var sP = Vec2.new(0, 0)
  572.         var currentPlayerDistance = curP.distTo(sP)
  573.  
  574.         if(currentPlayerDistance < lowestDistance) {
  575.             lowestDistance = currentPlayerDistance
  576.             closestPlayer = currentPlayer
  577.         }
  578.     }
  579.     if(OS.isKeyDown(keyDown2)) {
  580.         shootClosestEnemyAna(keyDown2,sleepSpeed)
  581.     }
  582.     if(closestPlayer != null && closestPlayer.validate() && closestPlayer.health > 0 && closestPlayer.isVisible && Common.entityHealthPercent(closestPlayer) < 75 ){        
  583.         var bonePos = closestPlayer.getBonePosition(2).project()
  584.          if(OS.isKeyDown(keyDown)){
  585.              aimTarget(bonePos.x,bonePos.y,healSpeed)  
  586.          }  
  587.     } else {
  588.         if(OS.isKeyDown(keyDown)){
  589.         shootClosestEnemyAna(keyDown,shootSpeed)
  590.     }
  591.     }
  592.   }
  593. }
  594.  
  595. class Global {
  596.     static init() {  
  597.         if (!__PositionCache) {
  598.             __PositionCache = {}
  599.         }
  600.         if (!__PredictedCache) {
  601.             __PredictedCache = {}
  602.         }
  603.         if(!__AimSettings) {
  604.             __AimSettings = AimSettings.new()
  605.         }
  606.         if (!__FPSCounter) {
  607.             __FPSCounter = FPSCounter.new()
  608.         }
  609.     }
  610.     static AimSettings { __AimSettings }
  611.     static FPSCounter { __FPSCounter }
  612.     static PositionCache { __PositionCache }
  613.     static PredictedCache { __PredictedCache }
  614. }
  615.  
  616. class GraphicsEvent is IGraphicsListener {
  617.     static onDraw() {
  618.     Global.FPSCounter.handle(OS.time)
  619.     AimPred.predAim()
  620.     var key = Global.AimSettings.keys["LB"]
  621.     var speed = 5.5  // 1 - 100 smoothing
  622.     var fov = 25
  623.     var drawfov = false
  624.     var localPlayer = Engine.getLocalPlayer()
  625.     //Future Pred Based Aimbot
  626.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Genji") {
  627.           key = Global.AimSettings.keys["LB"]
  628.           speed = 3
  629.           fov = 100
  630.          
  631.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  632.     }
  633.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Torbjorn") {
  634.           key = Global.AimSettings.keys["LB"]
  635.           speed = 4.5
  636.           fov = 100
  637.          
  638.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  639.     }
  640.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Hanzo") {
  641.           key = Global.AimSettings.keys["LB"]
  642.           speed = 4.5
  643.           fov = 100
  644.          
  645.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  646.     }
  647.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Mei") {
  648.           key = Global.AimSettings.keys["LB"]
  649.           speed = 4.5
  650.           fov = 100
  651.          
  652.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  653.     }
  654.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Mercy") {
  655.           key = Global.AimSettings.keys["LB"]
  656.           speed = 4.5
  657.           fov = 100
  658.          
  659.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  660.     }
  661.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Lucio") {
  662.           key = Global.AimSettings.keys["LB"]
  663.           speed = 4.5
  664.           fov = 100
  665.          
  666.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  667.     }
  668.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Zenyatta") {
  669.           key = Global.AimSettings.keys["LB"]
  670.           speed = 4.5
  671.           fov = 100
  672.          
  673.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  674.     }
  675.    
  676.     //Flick Based Aimbot
  677.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Mccree") {
  678.           key = Global.AimSettings.keys["LB"]
  679.           speed = 2
  680.           fov = 100    
  681.           //AimBot.pointInCircleCheck()
  682.             //Aimbot.shootNearCrossHairFov(key,speed,fov)
  683.             AimBot.shootClosestFov(key,speed,fov,drawfov)
  684.           //AimBot.shootClosestEnemy(key,speed)      
  685.     }
  686.  
  687.     //FPS Aimbot
  688.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Tracer") {
  689.           key = Global.AimSettings.keys["LB"]
  690.           speed = 12
  691.           fov = 100
  692.  
  693.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  694.     }
  695.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Soldier76") {
  696.           key = Global.AimSettings.keys["LB"]
  697.           speed = 10
  698.           fov = 100
  699.  
  700.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  701.     }
  702.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Bastion") {
  703.           key = Global.AimSettings.keys["LB"]
  704.           speed = 10
  705.           fov = 100
  706.  
  707.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  708.     }
  709.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Dva") {
  710.           key = Global.AimSettings.keys["LB"]
  711.           speed = 10
  712.           fov = 100
  713.  
  714.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  715.     }
  716.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Orisa") {
  717.           key = Global.AimSettings.keys["LB"]
  718.           speed = 10
  719.           fov = 100
  720.  
  721.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  722.     }
  723.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Reaper") {
  724.           key = Global.AimSettings.keys["LB"]
  725.           speed = 10
  726.           fov = 100
  727.  
  728.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  729.     }
  730.      if (Global.AimSettings.heroes[localPlayer.heroId] == "Sombra") {
  731.           key = Global.AimSettings.keys["LB"]
  732.           speed = 10
  733.           fov = 100
  734.  
  735.           AimBot.shootClosestFov(key,speed,fov,drawfov)
  736.     }
  737.  
  738.     //Smart Logic/Adaptive Smoothing Aimbot
  739.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Ana") {
  740.           key = Global.AimSettings.keys["ALT"]
  741.       var key2 = Global.AimSettings.keys["LS"]
  742.       var sleepSpeed = 1.5 ////speed when using your sleep
  743.       var healSpeed = 2.5 //speed to heal allies
  744.           speed = 4.5 //speed to hit enemies
  745.  
  746.           AimBot.logicShoot(key,key2,sleepSpeed,healSpeed,speed)
  747.     }
  748.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Widowmaker") {
  749.           key = Global.AimSettings.keys["LB"]
  750.           var key2 = Global.AimSettings.keys["RB"]
  751.           var speed2 = 10 //Speed without scoping
  752.           speed = 1.2 //speed with scoping
  753.           fov = 100
  754.          
  755.           if(OS.isKeyDown(key2)) {
  756.              Common.drawFov(fov * 2,drawfov)
  757.           }
  758.           if(!OS.isKeyDown(key2)) {
  759.             Common.drawFov(fov,drawfov)  
  760.           }
  761.          
  762.           if(OS.isKeyDown(key2) && OS.isKeyDown(key)){
  763.           AimBot.shootClosestFov(key,speed,fov * 2,false)
  764.           }
  765.           if(OS.isKeyDown(key)) {
  766.              AimBot.shootClosestFov(key,speed2,fov,false)
  767.           }
  768.     }
  769.     if (Global.AimSettings.heroes[localPlayer.heroId] == "Ashe") {
  770.           key = Global.AimSettings.keys["LB"]
  771.           var key2 = Global.AimSettings.keys["RB"]
  772.           var speed2 = 7.5 //Speed without scoping
  773.           speed = 3.5 //speed with scoping
  774.           fov = 100
  775.          
  776.           if(OS.isKeyDown(key2)) {
  777.              Common.drawFov(fov * 2,drawfov)
  778.           }
  779.           if(!OS.isKeyDown(key2)) {
  780.             Common.drawFov(fov,drawfov)  
  781.           }
  782.          
  783.           if(OS.isKeyDown(key2) && OS.isKeyDown(key)){
  784.            AimBot.shootClosestFov(key,speed,fov * 2,false)
  785.           }
  786.           if(OS.isKeyDown(key)) {
  787.               AimBot.shootClosestFov(key,speed2,fov,false)
  788.           }
  789.     }
  790.  
  791.      //AimBot.shootClosestEnemy(key,12)
  792.    
  793.  
  794.   }
  795. }
  796. Global.init()
  797. Graphics.registerListener(GraphicsEvent)
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