Advertisement
Guest User

aio

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