Advertisement
Guest User

fixed aio 2

a guest
Jan 16th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.76 KB | None | 0 0
  1.  
  2. local gsoVersion = "0.08"
  3.  
  4. local hName = myHero.charName
  5. local supportedChampions = {
  6. ["Ashe"] = true,
  7. ["Twitch"] = true
  8. }
  9.  
  10. if not supportedChampions[hName] == true then
  11. print("gamsteronAIO "..gsoVersion.." | hero not supported !")
  12. return
  13. end
  14.  
  15. _gso = {
  16. Orb = nil--,
  17. --global classes
  18. }
  19.  
  20.  
  21. --------------------|---------------------------------------------------------|--------------------
  22. --------------------|---------------------------------------------------------|--------------------
  23. --------------------|---------------------------------------------------------|--------------------
  24. --------------------|---------------------------------------------------------|--------------------
  25. --------------------|--------------------ORBWALKER----------------------------|--------------------
  26. --------------------|---------------------------------------------------------|--------------------
  27. --------------------|---------------------------------------------------------|--------------------
  28. --------------------|---------------------------------------------------------|--------------------
  29. --------------------|---------------------------------------------------------|--------------------
  30.  
  31. -- check if loaded
  32. if _gso.Orb then
  33. return
  34. end
  35.  
  36. -- API methods local
  37. local localProcessAAC = {}
  38. local localPreAAC = {}
  39. local function _localBonusDmg() return 0 end
  40. local function _localBonusDmgUnit(unit) return 0 end
  41. local function _localOnTick() return 0 end
  42. local function _localCastSpells() return 0 end
  43. local function _localCastSpellsAA() return 0 end
  44.  
  45. -- orbwalker class
  46. class "__gsoOrb"
  47.  
  48. -- init
  49. function __gsoOrb:__init()
  50. print("gamsteronAIO "..gsoVersion.." | orbwalker loaded!")
  51. self.menu = MenuElement({name = "Gamsteron Orbwalker", id = "gsoMenuOrb", type = MENU, leftIcon = "https://i.imgur.com/nahe4Ua.png"})
  52. self:_menu()
  53. self.latency = Game.Latency() * 0.001
  54. self.loaded = true
  55. self.lAttack = 0 -- lastAttackTime
  56. self.lMove = 0 -- lastMoveTime
  57. self.aaDmg = myHero.totalDamage
  58.  
  59. self.checkQ = true
  60. self.checkW = true
  61. self.checkE = true
  62. self.checkR = true
  63. self.preAAB = false
  64.  
  65. self.disAA = false
  66. self.disAAT = {}
  67. self.disAATN = 0
  68. self.disMove = false
  69. self.disMoveT = {}
  70. self.disMoveTN = 0
  71.  
  72. self.customAA = false
  73. self.stopOrb = false
  74. self.stopSpell = false
  75. self.lastSpellT = {}
  76. self.inAAT = false
  77. self.canAASpell = true
  78.  
  79. self.endTime = myHero.attackData.endTime
  80. self.windUpT = myHero.attackData.windUpTime
  81. self.animT = myHero.attackData.animationTime
  82. self.firstAA = 0
  83. self.countAA = 0
  84.  
  85. self.dActions = {} -- delayedActions
  86. self.dActionsC = 0
  87. self.aAttacks = {} -- activeAttacks
  88. self.shouldWaitT = 0
  89. self.shouldWait = false
  90.  
  91. self.aMinions = {} -- allyMinions
  92. self.aMinionsC = 0
  93. self.eMinions = {} -- enemyMinions
  94. self.eMinionsC = 0
  95. self.eMinionsLH = {} -- enemyMinionsLastHitable
  96. self.eMinionsLHC = 0
  97. self.eMinionsLC = {} -- enemyMinionsLaneClearable
  98. self.eMinionsLCC = 0
  99. self.eMinionsLHS = {} -- enemyMinionsLastHitableSoon
  100. self.eMinionsLHSC = 0
  101. self.eMinionsLHD = {} -- drawLastHitableMinion
  102. self.eMinionsLHSD = {} -- drawLastHitableSoonMinion
  103.  
  104. Callback.Add('Tick', function() self:_tick() end)
  105. Callback.Add('Draw', function() self:_draw() end)
  106. Callback.Add("WndMsg", function(msg, wParam) self:_wndmsg(msg, wParam) end)
  107.  
  108. end
  109.  
  110. --API methods global
  111. function __gsoOrb:_bonusDmg(func) _localBonusDmg = func end
  112. function __gsoOrb:_bonusDmgUnit(func) _localBonusDmgUnit = func end
  113. function __gsoOrb:_onTick(func) _localOnTick = func end
  114. function __gsoOrb:_castSpells(func) _localCastSpells = func end
  115. function __gsoOrb:_castSpellsAA(func) _localCastSpellsAA = func end
  116. function __gsoOrb:_blockAttack(tick, delay)
  117. self.disAA = true
  118. local getTick = self.disAAT[tick]
  119. if not getTick then
  120. self.disAAT[tick] = delay
  121. elseif delay > getTick then
  122. self.disAAT[tick] = delay
  123. end
  124. end
  125. function __gsoOrb:_blockMove(tick, delay)
  126. self.disMove = true
  127. local getTick = self.disMoveT[tick]
  128. if not getTick then
  129. self.disMoveT[tick] = delay
  130. elseif delay > getTick then
  131. self.disMoveT[tick] = delay
  132. end
  133. end
  134. function __gsoOrb:_processAA(arg)
  135. localProcessAAC[#localProcessAAC + 1] = arg
  136. end
  137. function __gsoOrb:_preAA(arg)
  138. localPreAAC[#localPreAAC + 1] = arg
  139. end
  140.  
  141. -- menu
  142. function __gsoOrb:_menu()
  143. self.menu:MenuElement({name = "Fast Lane Clear", id = "fastLN", value = true})
  144. self.menu:MenuElement({name = "Attack", id = "attack", type = MENU, leftIcon = "https://i.imgur.com/DsGzSEv.png"})
  145. self.menu.attack:MenuElement({name = "Set cursorPos delay", id = "cDelay", value = 50, min = 50, max = 100, step = 5 })
  146. self.menu.attack:MenuElement({name = "lasthit delay", id = "lhDelay", value = 0, min = 0, max = 100, step = 5 })
  147. self.menu.attack:MenuElement({name = "AA delay -> attack speed", id = "asDelay", value = 0, min = 0, max = 100, step = 5 })
  148. self.menu:MenuElement({name = "Movement", id = "movement", type = MENU, leftIcon = "https://i.imgur.com/Utq5iah.png"})
  149. self.menu.movement:MenuElement({name = "Kite Delay", id = "kite", value = 25, min = 0, max = 100, step = 5 })
  150. self.menu.movement:MenuElement({name = "Humanizer Movement Delay", id = "humanizer", value = 200, min = 0, max = 300, step = 10 })
  151. self.menu:MenuElement({name = "Drawings", id = "draw", type = MENU, leftIcon = "https://i.imgur.com/GuE9yOL.png"})
  152. self.menu.draw:MenuElement({name = "Enable", id = "enable", value = true})
  153. self.menu.draw:MenuElement({name = "MyHero attack range", id = "me", type = MENU})
  154. self.menu.draw.me:MenuElement({name = "Enable", id = "enable", value = true})
  155. self.menu.draw.me:MenuElement({name = "Color", id = "color", color = Draw.Color(150, 49, 210, 0)})
  156. self.menu.draw.me:MenuElement({name = "Width", id = "width", value = 1, min = 1, max = 10})
  157. self.menu.draw:MenuElement({name = "Enemy attack range", id = "he", type = MENU})
  158. self.menu.draw.he:MenuElement({name = "Enable", id = "enable", value = true})
  159. self.menu.draw.he:MenuElement({name = "Color", id = "color", color = Draw.Color(150, 255, 0, 0)})
  160. self.menu.draw.he:MenuElement({name = "Width", id = "width", value = 1, min = 1, max = 10})
  161. self.menu.draw:MenuElement({name = "Cursor Posistion", id = "cpos", type = MENU})
  162. self.menu.draw.cpos:MenuElement({name = "Enable", id = "enable", value = true})
  163. self.menu.draw.cpos:MenuElement({name = "Color", id = "color", color = Draw.Color(150, 153, 0, 76)})
  164. self.menu.draw.cpos:MenuElement({name = "Width", id = "width", value = 5, min = 1, max = 10})
  165. self.menu.draw.cpos:MenuElement({name = "Radius", id = "radius", value = 250, min = 1, max = 300})
  166. self.menu.draw:MenuElement({name = "Farm", id = "farm", type = MENU})
  167. self.menu.draw.farm:MenuElement({name = "Enable", id = "enable", value = true})
  168. self.menu.draw.farm:MenuElement({name = "LastHitable", id = "lastHitable", type = MENU})
  169. self.menu.draw.farm.lastHitable:MenuElement({name = "Enable", id = "enable", value = true})
  170. self.menu.draw.farm.lastHitable:MenuElement({name = "Color", id = "color", color = Draw.Color(255, 255, 255, 255)})
  171. self.menu.draw.farm.lastHitable:MenuElement({name = "Width", id = "width", value = 10, min = 1, max = 10})
  172. self.menu.draw.farm.lastHitable:MenuElement({name = "Radius", id = "radius", value = 35, min = 1, max = 100})
  173. self.menu.draw.farm:MenuElement({name = "AlmostLastHitable", id = "almostLastHitable", type = MENU})
  174. self.menu.draw.farm.almostLastHitable:MenuElement({name = "Enable", id = "enable", value = true})
  175. self.menu.draw.farm.almostLastHitable:MenuElement({name = "Color", id = "color", color = Draw.Color(255, 255, 102, 102)})
  176. self.menu.draw.farm.almostLastHitable:MenuElement({name = "Width", id = "width", value = 10, min = 1, max = 10})
  177. self.menu.draw.farm.almostLastHitable:MenuElement({name = "Radius", id = "radius", value = 35, min = 1, max = 100})
  178. self.menu.draw:MenuElement({name = "Minion attacks", id = "minionAttacks", type = MENU})
  179. self.menu.draw.minionAttacks:MenuElement({name = "Enable", id = "enable", value = true})
  180. self.menu.draw.minionAttacks:MenuElement({name = "Color", id = "color", color = Draw.Color(255, 255, 102, 0)})
  181. self.menu.draw.minionAttacks:MenuElement({name = "Width", id = "width", value = 3, min = 1, max = 10})
  182. self.menu.draw.minionAttacks:MenuElement({name = "Radius", id = "radius", value = 10, min = 1, max = 100})
  183. self.menu:MenuElement({name = "Keys", id = "keys", type = MENU, leftIcon = "https://i.imgur.com/QXvoHmH.png"})
  184. self.menu.keys:MenuElement({name = "Combo Key", id = "combo", key = string.byte(" ")})
  185. self.menu.keys:MenuElement({name = "Harass Key", id = "harass", key = string.byte("C")})
  186. self.menu.keys:MenuElement({name = "LastHit Key", id = "lastHit", key = string.byte("X")})
  187. self.menu.keys:MenuElement({name = "LaneClear Key", id = "laneClear", key = string.byte("V")})
  188. end
  189.  
  190. -- object manager
  191. function __gsoOrb:_valid(range, unit)
  192. if unit.distance < range and unit.dead == false and unit.isTargetable == true and unit.visible == true then
  193. return true
  194. end
  195. return false
  196. end
  197. function __gsoOrb:_addUnits()
  198. local countMinions = Game.MinionCount()
  199. for i = 1, countMinions do
  200. local minion = Game.Minion(i)
  201. if self:_valid(2000, minion) then
  202. if minion.isEnemy then
  203. self.eMinionsC = self.eMinionsC + 1
  204. self.eMinions[self.eMinionsC] = minion
  205. else
  206. self.aMinionsC = self.aMinionsC + 1
  207. self.aMinions[self.aMinionsC] = minion
  208. end
  209. end
  210. end
  211. end
  212. function __gsoOrb:_removeUnits()
  213. self.aMinions = {}
  214. self.aMinionsC = 0
  215. self.eMinions = {}
  216. self.eMinionsC = 0
  217. self.eMinionsLC = {}
  218. self.eMinionsLCC = 0
  219. self.eMinionsLH = {}
  220. self.eMinionsLHC = 0
  221. self.eMinionsLHS = {}
  222. self.eMinionsLHSC = 0
  223. end
  224.  
  225. -- predicted pos
  226. function __gsoOrb:_predPos(speed, pPos, unit)
  227. local result = unit.pos
  228. if unit.pathing.hasMovePath == true then
  229. local uPos = unit.pos
  230. local ePos = unit.pathing.endPos
  231. local distUP = pPos:DistanceTo(uPos)
  232. local distEP = pPos:DistanceTo(ePos)
  233. if distEP > distUP then
  234. result = uPos:Extended(ePos, 50+(unit.ms*(distUP / (speed - unit.ms))))
  235. else
  236. result = uPos:Extended(ePos, 50+(unit.ms*(distUP / (speed + unit.ms))))
  237. end
  238. end
  239. return result
  240. end
  241.  
  242. -- predicted hp
  243. function __gsoOrb:_isDead(target)
  244. local result = true
  245. for i = 1, self.eMinionsC do
  246. local eMin = self.eMinions[i]
  247. if target == eMin.handle then
  248. result = false
  249. break
  250. end
  251. end
  252. return result
  253. end
  254. function __gsoOrb:_possibleDmg(eMin, time)
  255. local result = 0
  256. for i = 1, self.aMinionsC do
  257. local aMin = self.aMinions[i]
  258. local aaData = aMin.attackData
  259. local aDmg = (aMin.totalDamage*(1+aMin.bonusDamagePercent))
  260. if self.menu.fastLN:Value() == false and (aMin.pathing.hasMovePath == true or self:_isDead(aaData.target) == true) then
  261. result = result + aDmg
  262. elseif aaData.target == eMin.handle then
  263. local endT = aaData.endTime
  264. local animT = aaData.animationTime
  265. local windUpT = aaData.windUpTime
  266. local pSpeed = aaData.projectileSpeed
  267. local pFlyT = pSpeed > 0 and aMin.pos:DistanceTo(eMin.pos) / pSpeed or 0
  268. local pStartT = endT - animT
  269. local pEndT = pStartT + pFlyT + windUpT
  270. local checkT = Game.Timer()
  271. pEndT = pEndT > checkT and pEndT or pEndT + animT + pFlyT
  272. while pEndT - checkT < time do
  273. result = result + aDmg
  274. pEndT = pEndT + animT + pFlyT
  275. end
  276. end
  277. end
  278. return result
  279. end
  280. function __gsoOrb:_setEnemyMinions()
  281. local mLH = self.menu.attack.lhDelay:Value()*0.001
  282. for i = 1, self.eMinionsC do
  283. local eMinion = self.eMinions[i]
  284. if eMinion.distance < myHero.range + myHero.boundingRadius + eMinion.boundingRadius - 30 then
  285. local eMinion_handle = eMinion.handle
  286. local eMinion_health = eMinion.health
  287. local myHero_aaData = myHero.attackData
  288. local myHero_pFlyTime = myHero_aaData.windUpTime + (eMinion.distance / myHero_aaData.projectileSpeed) + self.latency + 0.05 + self.menu.attack.lhDelay:Value()*0.001
  289. for k1,v1 in pairs(self.aAttacks) do
  290. for k2,v2 in pairs(self.aAttacks[k1]) do
  291. if v2.canceled == false and eMinion_handle == v2.to.handle then
  292. local checkT = Game.Timer()
  293. local pEndTime = v2.startTime + v2.pTime
  294. if pEndTime > checkT and pEndTime - checkT < myHero_pFlyTime - mLH then
  295. eMinion_health = eMinion_health - v2.dmg
  296. end
  297. end
  298. end
  299. end
  300. local myHero_dmg = self.aaDmg + _localBonusDmgUnit(eMinion)
  301. if eMinion_health - myHero_dmg < 0 then
  302. self.eMinionsLHC = self.eMinionsLHC + 1
  303. self.eMinionsLH[self.eMinionsLHC] = { eMinion, eMinion_health - myHero_dmg }
  304. else
  305. if eMinion.health - self:_possibleDmg(eMinion, self.animT*3) - myHero_dmg < 0 then
  306. self.shouldWait = true
  307. self.shouldWaitT = Game.Timer()
  308. self.eMinionsLHSC = self.eMinionsLHSC + 1
  309. self.eMinionsLHS[self.eMinionsLHSC] = eMinion
  310. else
  311. self.eMinionsLCC = self.eMinionsLCC + 1
  312. self.eMinionsLC[self.eMinionsLCC] = eMinion
  313. end
  314. end
  315. end
  316. end
  317. self.eMinionsLHD = self.eMinionsLH
  318. self.eMinionsLHSD = self.eMinionsLHS
  319. end
  320.  
  321. -- active attacks
  322. function __gsoOrb:_setActiveAA()
  323. for i = 1, self.aMinionsC do
  324. local aMinion = self.aMinions[i]
  325. local aHandle = aMinion.handle
  326. local aAAData = aMinion.attackData
  327. if aAAData.endTime > Game.Timer() then
  328. for i = 1, self.eMinionsC do
  329. local eMinion = self.eMinions[i]
  330. local eHandle = eMinion.handle
  331. if eHandle == aAAData.target then
  332. local checkT = Game.Timer()
  333. -- p -> projectile
  334. local pSpeed = aAAData.projectileSpeed
  335. local pFlyT = pSpeed > 0 and aMinion.pos:DistanceTo(eMinion.pos) / pSpeed or 0
  336. local pStartT = aAAData.endTime - aAAData.windDownTime
  337. if not self.aAttacks[aHandle] then
  338. self.aAttacks[aHandle] = {}
  339. end
  340. local aaID = math.floor(aAAData.endTime)
  341. if checkT < pStartT + pFlyT then
  342. if pSpeed > 0 then
  343. if checkT > pStartT then
  344. if not self.aAttacks[aHandle][aaID] then
  345. self.aAttacks[aHandle][aaID] = {
  346. canceled = false,
  347. speed = pSpeed,
  348. startTime = pStartT,
  349. pTime = pFlyT,
  350. pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartT)),
  351. from = aMinion,
  352. fromPos = aMinion.pos,
  353. to = eMinion,
  354. dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
  355. }
  356. end
  357. elseif aMinion.pathing.hasMovePath == true then
  358. --print("attack canceled")
  359. self.aAttacks[aHandle][aaID] = {
  360. canceled = true,
  361. from = aMinion
  362. }
  363. end
  364. elseif not self.aAttacks[aHandle][aaID] then
  365. self.aAttacks[aHandle][aaID] = {
  366. canceled = false,
  367. speed = pSpeed,
  368. startTime = pStartT - aAAData.windUpTime,
  369. pTime = aAAData.windUpTime,
  370. pos = aMinion.pos,
  371. from = aMinion,
  372. fromPos = aMinion.pos,
  373. to = eMinion,
  374. dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
  375. }
  376. end
  377. end
  378. break
  379. end
  380. end
  381. end
  382. end
  383. end
  384. function __gsoOrb:_handleActiveAA()
  385. local aAttacks2 = self.aAttacks
  386. for k1,v1 in pairs(aAttacks2) do
  387. local count = 0
  388. local checkT = Game.Timer()
  389. for k2,v2 in pairs(aAttacks2[k1]) do
  390. count = count + 1
  391. if v2.speed == 0 and (not v2.from or v2.from == nil or v2.from.dead) then
  392. --print("dead")
  393. self.aAttacks[k1] = nil
  394. break
  395. end
  396. if v2.canceled == false then
  397. local ranged = v2.speed > 0
  398. if ranged == true then
  399. self.aAttacks[k1][k2].pTime = v2.fromPos:DistanceTo(self:_predPos(v2.speed, v2.pos, v2.to)) / v2.speed
  400. end
  401. if checkT > v2.startTime + self.aAttacks[k1][k2].pTime - self.latency - 0.02 or not v2.to or v2.to == nil or v2.to.dead then
  402. self.aAttacks[k1][k2] = nil
  403. elseif ranged == true then
  404. self.aAttacks[k1][k2].pos = v2.fromPos:Extended(v2.to.pos, (checkT-v2.startTime)*v2.speed)
  405. end
  406. end
  407. end
  408. if count == 0 then
  409. --print("no active attacks")
  410. self.aAttacks[k1] = nil
  411. end
  412. end
  413. end
  414.  
  415. -- target selector
  416. function __gsoOrb:_comboT()
  417. local result = nil
  418. local min = 10000000
  419. for i = 1, Game.HeroCount() do
  420. local hero = Game.Hero(i)
  421. local armor = hero.armor - myHero.armorPen
  422. armor = armor > 0 and myHero.bonusArmorPenPercent * armor or armor
  423. local hp = hero.health + ( 2 * armor ) - ( hero.attackSpeed * hero.totalDamage ) - ( 1.5 * hero.ap )
  424. if hp < min and hero.isEnemy and self:_valid(myHero.range + myHero.boundingRadius + hero.boundingRadius - 30, hero) then
  425. min = hp
  426. result = hero
  427. end
  428. end
  429. return result
  430. end
  431. function __gsoOrb:_lastHitT()
  432. local result = nil
  433. local min = 10000000
  434. if self.eMinionsLHC > 0 then
  435. for i = 1, self.eMinionsLHC do
  436. local eMinionLH = self.eMinionsLH[i]
  437. local minion = eMinionLH[1]
  438. local hp = eMinionLH[2]
  439. if hp < min then
  440. min = hp
  441. result = minion
  442. end
  443. end
  444. end
  445. return result
  446. end
  447. function __gsoOrb:_laneClearT()
  448. local result = self:_lastHitT()
  449. if result == nil and self.eMinionsLHSC == 0 and self.shouldWait == false then
  450. result = self:_comboT()
  451. if result == nil then
  452. local min = 10000000
  453. for i = 1, self.eMinionsLCC do
  454. local minion = self.eMinionsLC[i]
  455. local hp = minion.health
  456. if hp < min then
  457. min = hp
  458. result = minion
  459. end
  460. end
  461. end
  462. end
  463. return result
  464. end
  465. function __gsoOrb:_harassT()
  466. local result = self:_lastHitT()
  467. return result == nil and self:_comboT() or result
  468. end
  469.  
  470. -- orb
  471. function __gsoOrb:_orb(unit)
  472. local checkT = Game.Timer()
  473. local mKite = self.menu.movement.kite:Value()*0.001
  474. local mHum = self.menu.movement.humanizer:Value()*0.001
  475. local mAS = self.menu.attack.asDelay:Value()*0.001
  476. local mDel = self.menu.attack.cDelay:Value()
  477. if self.stopOrb == false and self.stopSpell == false and self.disAA == false and self.dActionsC == 0 and unit ~= nil and (checkT + 0.13 - mAS > self.endTime or self.canAASpell == true) then
  478. self.preAAB = false
  479. -- checkT > self.lAttack + myHero.attackData.animationTime + 0.075 then
  480. if self.customAA == true then
  481. self.customAA = false
  482. end
  483. self.canAASpell = false
  484. self.stopOrb = true
  485. self.lAttack = Game.Timer()
  486. Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
  487. Control.mouse_event(MOUSEEVENTF_RIGHTUP)
  488. local cPos = cursorPos
  489. Control.SetCursorPos(unit.pos)
  490. Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
  491. Control.mouse_event(MOUSEEVENTF_RIGHTUP)
  492. self.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, mDel, 0 }
  493. self.dActionsC = self.dActionsC + 1
  494. elseif checkT + self.latency - mKite > self.endTime - (self.animT - self.windUpT) then
  495. --and checkT > self.lAttack + myHero.attackData.windUpTime + 0.075 then
  496. if self.dActionsC == 0 then
  497. _localCastSpellsAA()
  498. end
  499. if self.stopOrb == false and self.disMove == false and checkT - mHum > self.lMove then
  500. Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
  501. Control.mouse_event(MOUSEEVENTF_RIGHTUP)
  502. self.lMove = checkT
  503. end
  504. if self.preAAB == false and checkT > self.endTime - self.animT*0.35 and checkT < self.endTime - self.animT*0.25 and unit ~= nil then
  505. for i = 1, #localPreAAC do
  506. localPreAAC[i]()
  507. end
  508. self.preAAB = true
  509. end
  510. end
  511. end
  512.  
  513. -- wndmsg
  514. function __gsoOrb:_wndmsg(msg, wParam)
  515. local i = wParam
  516. local checkQ = self.checkQ == true and i == HK_Q
  517. local checkW = self.checkW == true and i == HK_W
  518. local checkE = self.checkE == true and i == HK_E
  519. local checkR = self.checkR == true and i == HK_R
  520. if checkQ or checkW or checkE or checkR or i == HK_SUMMONER_1 or i == HK_SUMMONER_2 then
  521. local checkT = Game.Timer()
  522. local inAATime = checkT < self.lAttack + self.windUpT + 0.05
  523. self.lastSpellT[checkT] = inAATime == true
  524. self.stopSpell = true
  525. end
  526. end
  527.  
  528. -- tick
  529. function __gsoOrb:_tick()
  530.  
  531. _localOnTick()
  532.  
  533. self:_addUnits()
  534. self:_setActiveAA()
  535. self:_handleActiveAA()
  536. self:_setEnemyMinions()
  537.  
  538. local ck = self.menu.keys.combo:Value()
  539. local hk = self.menu.keys.harass:Value()
  540. local lhk = self.menu.keys.lastHit:Value()
  541. local lck = self.menu.keys.laneClear:Value()
  542.  
  543. self.aaDmg = myHero.totalDamage + _localBonusDmg()
  544. self.latency = Game.Latency() * 0.001
  545.  
  546. local checkT = Game.Timer()
  547. if self.shouldWait == true and checkT > self.shouldWaitT + 0.5 then
  548. self.shouldWait = false
  549. --print("stop")
  550. end
  551.  
  552. if self.disAA == true then
  553. local disDAA = self.disAAT
  554. for k,v in pairs(disDAA) do
  555. if k + v > self.disAATN then
  556. self.disAATN = k + v
  557. self.disAAT[k] = nil
  558. end
  559. end
  560. if self.disAATN > 0 and checkT - self.disAATN > 0 then
  561. self.disAA = false
  562. self.disAATN = 0
  563. end
  564. end
  565.  
  566. if self.disMove == true then
  567. local disDMove = self.disMoveT
  568. for k,v in pairs(disDMove) do
  569. if k + v > self.disMoveTN then
  570. self.disMoveTN = k + v
  571. self.disMoveT[k] = nil
  572. end
  573. end
  574. if self.disMoveTN > 0 and checkT - self.disMoveTN > 0 then
  575. self.disMove = false
  576. self.disMoveTN = 0
  577. end
  578. end
  579.  
  580. local spellTimers = self.lastSpellT
  581. local countLess = 0
  582. for k,v in pairs(spellTimers) do
  583. if checkT > k + 2 then
  584. self.lastSpellT[k] = nil
  585. elseif checkT < k + 0.3 then
  586. countLess = countLess + 1
  587. self.stopSpell = true
  588. if v == true then
  589. self.inAAT = true
  590. end
  591. --break
  592. end
  593. end
  594. if countLess == 0 then
  595. if self.stopSpell == true then
  596. self.stopSpell = false
  597. end
  598. if self.inAAT == true then
  599. self.canAASpell = true
  600. self.inAAT = false
  601. --print("Spell in aa time: reset attack")
  602. end
  603. end
  604.  
  605. local dActions = self.dActions
  606. local cDActions = 0
  607. for k,v in pairs(dActions) do
  608. cDActions = cDActions + 1
  609. if GetTickCount() - k > v[2] then
  610. v[1]()
  611. if v[3] > 0 then
  612. Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
  613. Control.mouse_event(MOUSEEVENTF_RIGHTUP)
  614. end
  615. self.dActions[k] = nil
  616. end
  617. end
  618. self.dActionsC = cDActions
  619.  
  620. if cDActions == 0 then
  621. _localCastSpells()
  622. end
  623.  
  624. local aaData = myHero.attackData
  625. local endTime = aaData.endTime
  626. --endTime = self.customAA == true and self.endTime or endTime
  627. local windUpTime = aaData.windUpTime
  628. local animTime = aaData.animationTime
  629.  
  630. if endTime > self.endTime then
  631. args = { windUpT = windUpTime, animT = animTime, endT = self.endTime }
  632. for i = 1, #localProcessAAC do
  633. localProcessAAC[i](args)
  634. end
  635. if args.windUpT ~= windUpTime then
  636. self.customAA = true
  637. self.windUpT = args.windUpT
  638. else
  639. self.windUpT = windUpTime
  640. end
  641. --self.animT = args.animT
  642. --self.endTime = self.customAA == true and args.endT or endTime
  643. self.endTime = endTime
  644. self.animT = animTime
  645.  
  646. self.stopOrb = false
  647. self.lMove = 0
  648. if self.countAA == 0 then
  649. self.firstAA = checkT
  650. end
  651. self.countAA = self.countAA + 1
  652. if self.countAA == 5 then
  653. --print("5 auto attacks in: "..tostring(math.floor((checkT-self.firstAA)*1000)).."ms")
  654. self.firstAA = 0
  655. self.countAA = 0
  656. end
  657. elseif self.stopOrb == true and checkT > self.lAttack + self.windUpT + 0.25 + self.latency then
  658. print("Bad issue: reset attack")
  659. self.stopOrb = false
  660. end
  661.  
  662. if ck or hk or lhk or lck then
  663. local AAtarget = nil
  664. if ck then
  665. AAtarget = self:_comboT()
  666. elseif hk then
  667. AAtarget = self:_harassT()
  668. elseif lhk then
  669. AAtarget = self:_lastHitT()
  670. elseif lck then
  671. AAtarget = self:_laneClearT()
  672. end
  673. self:_orb(AAtarget)
  674. end
  675.  
  676. self:_removeUnits()
  677. end
  678.  
  679. -- draw
  680. function __gsoOrb:_draw()
  681. if not self.menu.draw.enable:Value() then return end
  682. if self.menu.draw.me.enable:Value() and not myHero.dead and myHero.pos:ToScreen().onScreen then
  683. Draw.Circle(myHero.pos, myHero.range + myHero.boundingRadius + 35, self.menu.draw.me.width:Value(), self.menu.draw.me.color:Value())
  684. end
  685. if self.menu.draw.he.enable:Value() then
  686. for i = 1, Game.HeroCount() do
  687. local hero = Game.Hero(i)
  688. if self:_valid(2000, hero) and hero.pos:ToScreen().onScreen then
  689. Draw.Circle(hero.pos, hero.range + hero.boundingRadius + 35, self.menu.draw.he.width:Value(), self.menu.draw.he.color:Value())
  690. end
  691. end
  692. end
  693. if self.menu.draw.cpos.enable:Value() then
  694. Draw.Circle(mousePos, self.menu.draw.cpos.radius:Value(), self.menu.draw.cpos.width:Value(), self.menu.draw.cpos.color:Value())
  695. end
  696. if self.menu.draw.farm.enable:Value() then
  697. if self.menu.draw.farm.lastHitable.enable:Value() then
  698. local countLH = #self.eMinionsLHD
  699. for i = 1, countLH do
  700. local eMinionLHD = self.eMinionsLHD[i]
  701. local minion = eMinionLHD[1]
  702. Draw.Circle(minion.pos, self.menu.draw.farm.lastHitable.radius:Value(), self.menu.draw.farm.lastHitable.width:Value(), self.menu.draw.farm.lastHitable.color:Value())
  703. end
  704. end
  705. if self.menu.draw.farm.almostLastHitable.enable:Value() then
  706. local countLHS = #self.eMinionsLHSD
  707. for i = 1, countLHS do
  708. local eMinionLHSD = self.eMinionsLHSD[i]
  709. Draw.Circle(eMinionLHSD.pos, self.menu.draw.farm.almostLastHitable.radius:Value(), self.menu.draw.farm.almostLastHitable.width:Value(), self.menu.draw.farm.almostLastHitable.color:Value())
  710. end
  711. end
  712. end
  713. if self.menu.draw.minionAttacks.enable:Value() then
  714. for k1,v1 in pairs(self.aAttacks) do
  715. for k2,v2 in pairs(self.aAttacks[k1]) do
  716. local checkT = Game.Timer()
  717. if v2.to and v2.to ~= nil and not v2.to.dead and checkT > v2.startTime and v2.canceled == false then
  718. if v2.speed > 0 then
  719. Draw.Circle(v2.pos, self.menu.draw.minionAttacks.radius:Value(), self.menu.draw.minionAttacks.width:Value(), self.menu.draw.minionAttacks.color:Value())
  720. else
  721. Draw.Circle(v2.from.pos, self.menu.draw.minionAttacks.radius:Value(), self.menu.draw.minionAttacks.width:Value(), self.menu.draw.minionAttacks.color:Value())
  722. end
  723. end
  724. end
  725. end
  726. end
  727. end
  728.  
  729. _gso.Orb = __gsoOrb()
  730.  
  731. --------------------|---------------------------------------------------------|--------------------
  732. --------------------|---------------------------------------------------------|--------------------
  733. --------------------|---------------------------------------------------------|--------------------
  734. --------------------|---------------------------------------------------------|--------------------
  735. --------------------|------------------------ASHE-----------------------------|--------------------
  736. --------------------|---------------------------------------------------------|--------------------
  737. --------------------|---------------------------------------------------------|--------------------
  738. --------------------|---------------------------------------------------------|--------------------
  739. --------------------|---------------------------------------------------------|--------------------
  740.  
  741. -- ashe class
  742. class "__gsoAshe"
  743.  
  744. -- init
  745. function __gsoAshe:__init()
  746. print("gamsteronAIO "..gsoVersion.." | ashe loaded!")
  747. self.menu = MenuElement({name = "Gamsteron Ashe", id = "gsoMenuAshe", type = MENU, leftIcon = "https://i.imgur.com/WohLMsm.png"})
  748. self:_menu()
  749. self.lastQ = 0
  750. self.lastW = 0
  751. self.lastR = 0
  752. self.lastP = 0
  753. self.qDur = 0
  754. self.lastChanged = 0
  755. self.aaSpeed = myHero.attackSpeed
  756. _gso.Orb.checkQ = false
  757. _gso.Orb:_bonusDmg(function() return self:_dmg() end)
  758. _gso.Orb:_bonusDmgUnit(function(unit) return self:_dmgUnit(unit) end)
  759. _gso.Orb:_preAA(function() self:_preAA() end)
  760. _gso.Orb:_castSpells(function() self:_spells() end)
  761. _gso.Orb:_processAA(function(args) self:_processAA(args) end)
  762. _gso.Orb:_onTick(function() self:_tick() end)
  763. end
  764.  
  765. --onProcessAttack
  766. function __gsoAshe:_processAA(args)
  767. if GetTickCount() < self.lastQ + 300 then
  768. args.windUpT = 1/(self.aaSpeed*3)
  769. args.animT = 1/(self.aaSpeed*0.6578947)
  770. args.endT = args.endT + args.animT
  771. end
  772. end
  773.  
  774. --tick
  775. function __gsoAshe:_tick()
  776. local checkT = Game.Timer()
  777. if myHero:GetSpellData(_Q).level > 0 then
  778. for i = 0, myHero.buffCount do
  779. local buff = myHero:GetBuff(i)
  780. if buff.count > 0 and buff.name:lower() == "asheqattack" then
  781. self.qDur = buff.duration
  782. self.lastP = checkT
  783. break
  784. end
  785. end
  786. if checkT > self.lastChanged + 1 and checkT > self.lastP + self.qDur - 0.3 and checkT < self.lastP + self.qDur - 0.075 then
  787. self.aaSpeed = self.aaSpeed - 0.15 - (myHero:GetSpellData(_Q).level*0.05)
  788. _gso.Orb.windUpT = 1/(self.aaSpeed*3)
  789. self.lastChanged = checkT
  790. print("ok")
  791. end
  792. end
  793. end
  794.  
  795. -- menu
  796. function __gsoAshe:_menu()
  797. self.menu:MenuElement({id = "rdist", name = "use R if enemy distance < X", value = 500, min = 100, max = 1000, step = 50})
  798. self.menu:MenuElement({type = MENU, id = "combo", name = "Combo"})
  799. self.menu.combo:MenuElement({id = "qc", name = "UseQ", value = true})
  800. self.menu.combo:MenuElement({id = "wc", name = "UseW", value = true})
  801. self.menu.combo:MenuElement({id = "rcd", name = "UseR [enemy distance < X", value = true})
  802. self.menu.combo:MenuElement({id = "rci", name = "UseR [enemy IsImmobile]", value = true})
  803. self.menu:MenuElement({type = MENU, id = "harass", name = "Harass"})
  804. self.menu.harass:MenuElement({id = "qh", name = "UseQ", value = true})
  805. self.menu.harass:MenuElement({id = "wh", name = "UseW", value = true})
  806. self.menu.harass:MenuElement({id = "rhd", name = "UseR [enemy distance < X]", value = false})
  807. self.menu.harass:MenuElement({id = "rhi", name = "UseR [enemy IsImmobile]", value = false})
  808. end
  809.  
  810. -- object manager
  811. function __gsoAshe:_valid(range, unit)
  812. if unit.distance < range and unit.dead == false and unit.isTargetable == true and unit.visible == true then
  813. return true
  814. end
  815. return false
  816. end
  817. function __gsoAshe:_countEnemies(range, addBB)
  818. local result = 0
  819. for i = 1, Game.HeroCount() do
  820. local hero = Game.Hero(i)
  821. local r = addBB and range + hero.boundingRadius - 30 or range
  822. if hero.isEnemy and self:_valid(r, hero) then
  823. result = result + 1
  824. end
  825. end
  826. return result
  827. end
  828. function __gsoAshe:_getEnemies(range)
  829. local result = {}
  830. for i = 1, Game.HeroCount() do
  831. local hero = Game.Hero(i)
  832. if hero.isEnemy and self:_valid(range, hero) then
  833. result[#result + 1] = hero
  834. end
  835. end
  836. return result
  837. end
  838. function __gsoAshe:_getTarget(range)
  839. local t = self:_getEnemies(range)
  840. local num = 10000000
  841. local target = nil
  842. for i = 1, #t do
  843. local unit = t[i]
  844. local armor = unit.armor - myHero.armorPen
  845. armor = armor > 0 and myHero.bonusArmorPenPercent * armor or armor
  846. local unithealth = unit.health + ( 2 * armor ) - ( unit.attackSpeed * unit.totalDamage ) - ( 1.5 * unit.ap )
  847. if unithealth < num then
  848. num = unithealth
  849. target = unit
  850. end
  851. end
  852. return target
  853. end
  854. function __gsoAshe:_isImmobile(unit)
  855. for i = 0, unit.buffCount do
  856. local buff = unit:GetBuff(i)
  857. local type = buff.type
  858. if buff and buff.count > 0 and (type == 5 or type == 11 or type == 29 or type == 24 or buff.name == "recall") then
  859. return true
  860. end
  861. end
  862. return false
  863. end
  864.  
  865. -- extra damage
  866. function __gsoAshe:_dmgUnit(unit)
  867. local dmg = myHero.totalDamage
  868. local crit = 0.1 + myHero.critChance
  869. for i = 0, unit.buffCount do
  870. local buff = unit:GetBuff(i)
  871. if buff.count > 0 and buff.name:lower() == "ashepassiveslow" then
  872. local aacompleteT = myHero.attackData.windUpTime + (unit.distance / myHero.attackData.projectileSpeed)
  873. if aacompleteT + 0.1 < buff.duration then
  874. return dmg * crit
  875. end
  876. --[[ buff.duration, example:
  877. print(buff.startTime.." "..buff.expireTime.." "..buff.duration.." "..Game.Timer())
  878. 221.715438842277 223.71543884277 0.16038513183594 223.55505371094
  879. 223,71543884277-223,55505371094=0,16038513183
  880. ]]
  881. end
  882. end
  883. return 0
  884. end
  885. function __gsoAshe:_dmg()
  886. return 3
  887. end
  888.  
  889. function __gsoAshe:_preAA()
  890. local QReadyT = GetTickCount() > self.lastQ + 500
  891. local QReady = Game.CanUseSpell(_Q) == 0
  892. if QReady == true and self:_countEnemies(myHero.range + myHero.boundingRadius, true) > 0 then
  893. if (self.menu.combo.qc:Value() and _gso.Orb.menu.keys.combo:Value()) or (self.menu.harass.qh:Value() and _gso.Orb.menu.keys.harass:Value()) then
  894. self.aaSpeed = myHero.attackSpeed + 0.15 + (myHero:GetSpellData(_Q).level*0.05)
  895. Control.KeyDown(HK_Q)
  896. Control.KeyUp(HK_Q)
  897. self.lastQ = GetTickCount()
  898. end
  899. end
  900. end
  901. function __gsoAshe:_spells()
  902. local isCombo = _gso.Orb.menu.keys.combo:Value()
  903. local isHarass = _gso.Orb.menu.keys.harass:Value()
  904. if GetTickCount() > self.lastW + 500 and Game.CanUseSpell(_W) == 0 then
  905. if (self.menu.combo.wc:Value() and isCombo) or (self.menu.harass.wh:Value() and isHarass) then
  906. local target = self:_getTarget(1200)
  907. if target ~= nil then
  908. local wPred = target:GetPrediction(2000,0.25)
  909. if wPred and wPred:ToScreen().onScreen and wPred:DistanceTo(myHero.pos) < 1200 and target:GetCollision(100,2000,0.25) == 0 then
  910. --_gso.Orb:_blockAttack(Game.Timer(), 0.1)
  911. --_gso.Orb:_blockMove(Game.Timer(), 0.1)
  912. local cPos = cursorPos
  913. Control.SetCursorPos(wPred)
  914. Control.KeyDown(HK_W)
  915. Control.KeyUp(HK_W)
  916. self.lastW = GetTickCount()
  917. _gso.Orb.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, 50, 2 }
  918. end
  919. end
  920. end
  921. end
  922. if GetTickCount() > self.lastR + 500 and Game.CanUseSpell(_R) == 0 then
  923. if (self.menu.combo.rcd:Value() and isCombo) or (self.menu.harass.rhd:Value() and isHarass) then
  924. local num = self.menu.rdist:Value()
  925. local t = nil
  926. for i = 1, Game.HeroCount() do
  927. local hero = Game.Hero(i)
  928. local dist = hero.distance
  929. if hero.isEnemy and hero.dead == false and hero.isTargetable == true and hero.visible == true and dist < num then
  930. num = dist
  931. t = hero
  932. end
  933. end
  934. if t ~= nil then
  935. local rPred = t:GetPrediction(1600,0.25)
  936. if rPred and rPred:ToScreen().onScreen then
  937. --_gso.Orb:_blockAttack(Game.Timer(), 0.25)
  938. --_gso.Orb:_blockMove(Game.Timer(), 0.1)
  939. local cPos = cursorPos
  940. Control.SetCursorPos(rPred)
  941. Control.KeyDown(HK_R)
  942. Control.KeyUp(HK_R)
  943. self.lastR = GetTickCount()
  944. _gso.Orb.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, 50, 4 }
  945. end
  946. end
  947. end
  948. if GetTickCount() > self.lastR + 500 and ((self.menu.combo.rci:Value() and isCombo) or (self.menu.harass.rhi:Value() and isHarass)) then
  949. local t = nil
  950. for i = 1, Game.HeroCount() do
  951. local hero = Game.Hero(i)
  952. if hero.isEnemy and self:_valid(1000, hero) and self:_isImmobile(hero) then
  953. t = hero
  954. break
  955. end
  956. end
  957. if t ~= nil then
  958. local rPred = t.pos
  959. if rPred and rPred:ToScreen().onScreen then
  960. --_gso.Orb:_blockAttack(Game.Timer(), 0.25)
  961. --_gso.Orb:_blockMove(Game.Timer(), 0.1)
  962. local cPos = cursorPos
  963. Control.SetCursorPos(rPred)
  964. Control.KeyDown(HK_R)
  965. Control.KeyUp(HK_R)
  966. self.lastR = GetTickCount()
  967. _gso.Orb.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, 50, 4 }
  968. end
  969. end
  970. end
  971. end
  972. end
  973.  
  974.  
  975. --------------------|---------------------------------------------------------|--------------------
  976. --------------------|---------------------------------------------------------|--------------------
  977. --------------------|---------------------------------------------------------|--------------------
  978. --------------------|---------------------------------------------------------|--------------------
  979. --------------------|--------------------ONLOAD-------------------------------|--------------------
  980. --------------------|---------------------------------------------------------|--------------------
  981. --------------------|---------------------------------------------------------|--------------------
  982. --------------------|---------------------------------------------------------|--------------------
  983. --------------------|---------------------------------------------------------|--------------------
  984.  
  985. function OnLoad()
  986. if hName == "Ashe" then
  987. __gsoAshe()
  988. elseif hName == "Twitch" then
  989. __gsoTwitch()
  990. end
  991. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement