Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gsoVersion = "0.08"
- local hName = myHero.charName
- local supportedChampions = {
- ["Ashe"] = true,
- ["Twitch"] = true
- }
- if not supportedChampions[hName] == true then
- print("gamsteronAIO "..gsoVersion.." | hero not supported !")
- return
- end
- _gso = {
- Orb = nil--,
- --global classes
- }
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|--------------------ORBWALKER----------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- -- check if loaded
- if _gso.Orb then
- return
- end
- -- API methods local
- local localProcessAAC = {}
- local localPreAAC = {}
- local function _localBonusDmg() return 0 end
- local function _localBonusDmgUnit(unit) return 0 end
- local function _localOnTick() return 0 end
- local function _localCastSpells() return 0 end
- local function _localCastSpellsAA() return 0 end
- -- orbwalker class
- class "__gsoOrb"
- -- init
- function __gsoOrb:__init()
- print("gamsteronAIO "..gsoVersion.." | orbwalker loaded!")
- self.menu = MenuElement({name = "Gamsteron Orbwalker", id = "gsoMenuOrb", type = MENU, leftIcon = "https://i.imgur.com/nahe4Ua.png"})
- self:_menu()
- self.latency = Game.Latency() * 0.001
- self.loaded = true
- self.lAttack = 0 -- lastAttackTime
- self.lMove = 0 -- lastMoveTime
- self.aaDmg = myHero.totalDamage
- self.checkQ = true
- self.checkW = true
- self.checkE = true
- self.checkR = true
- self.preAAB = false
- self.disAA = false
- self.disAAT = {}
- self.disAATN = 0
- self.disMove = false
- self.disMoveT = {}
- self.disMoveTN = 0
- self.customAA = false
- self.stopOrb = false
- self.stopSpell = false
- self.lastSpellT = {}
- self.inAAT = false
- self.canAASpell = true
- self.endTime = myHero.attackData.endTime
- self.windUpT = myHero.attackData.windUpTime
- self.animT = myHero.attackData.animationTime
- self.firstAA = 0
- self.countAA = 0
- self.dActions = {} -- delayedActions
- self.dActionsC = 0
- self.aAttacks = {} -- activeAttacks
- self.shouldWaitT = 0
- self.shouldWait = false
- self.aMinions = {} -- allyMinions
- self.aMinionsC = 0
- self.eMinions = {} -- enemyMinions
- self.eMinionsC = 0
- self.eMinionsLH = {} -- enemyMinionsLastHitable
- self.eMinionsLHC = 0
- self.eMinionsLC = {} -- enemyMinionsLaneClearable
- self.eMinionsLCC = 0
- self.eMinionsLHS = {} -- enemyMinionsLastHitableSoon
- self.eMinionsLHSC = 0
- self.eMinionsLHD = {} -- drawLastHitableMinion
- self.eMinionsLHSD = {} -- drawLastHitableSoonMinion
- Callback.Add('Tick', function() self:_tick() end)
- Callback.Add('Draw', function() self:_draw() end)
- Callback.Add("WndMsg", function(msg, wParam) self:_wndmsg(msg, wParam) end)
- end
- --API methods global
- function __gsoOrb:_bonusDmg(func) _localBonusDmg = func end
- function __gsoOrb:_bonusDmgUnit(func) _localBonusDmgUnit = func end
- function __gsoOrb:_onTick(func) _localOnTick = func end
- function __gsoOrb:_castSpells(func) _localCastSpells = func end
- function __gsoOrb:_castSpellsAA(func) _localCastSpellsAA = func end
- function __gsoOrb:_blockAttack(tick, delay)
- self.disAA = true
- local getTick = self.disAAT[tick]
- if not getTick then
- self.disAAT[tick] = delay
- elseif delay > getTick then
- self.disAAT[tick] = delay
- end
- end
- function __gsoOrb:_blockMove(tick, delay)
- self.disMove = true
- local getTick = self.disMoveT[tick]
- if not getTick then
- self.disMoveT[tick] = delay
- elseif delay > getTick then
- self.disMoveT[tick] = delay
- end
- end
- function __gsoOrb:_processAA(arg)
- localProcessAAC[#localProcessAAC + 1] = arg
- end
- function __gsoOrb:_preAA(arg)
- localPreAAC[#localPreAAC + 1] = arg
- end
- -- menu
- function __gsoOrb:_menu()
- self.menu:MenuElement({name = "Fast Lane Clear", id = "fastLN", value = true})
- self.menu:MenuElement({name = "Attack", id = "attack", type = MENU, leftIcon = "https://i.imgur.com/DsGzSEv.png"})
- self.menu.attack:MenuElement({name = "Set cursorPos delay", id = "cDelay", value = 50, min = 50, max = 100, step = 5 })
- self.menu.attack:MenuElement({name = "lasthit delay", id = "lhDelay", value = 0, min = 0, max = 100, step = 5 })
- self.menu.attack:MenuElement({name = "AA delay -> attack speed", id = "asDelay", value = 0, min = 0, max = 100, step = 5 })
- self.menu:MenuElement({name = "Movement", id = "movement", type = MENU, leftIcon = "https://i.imgur.com/Utq5iah.png"})
- self.menu.movement:MenuElement({name = "Kite Delay", id = "kite", value = 25, min = 0, max = 100, step = 5 })
- self.menu.movement:MenuElement({name = "Humanizer Movement Delay", id = "humanizer", value = 200, min = 0, max = 300, step = 10 })
- self.menu:MenuElement({name = "Drawings", id = "draw", type = MENU, leftIcon = "https://i.imgur.com/GuE9yOL.png"})
- self.menu.draw:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw:MenuElement({name = "MyHero attack range", id = "me", type = MENU})
- self.menu.draw.me:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw.me:MenuElement({name = "Color", id = "color", color = Draw.Color(150, 49, 210, 0)})
- self.menu.draw.me:MenuElement({name = "Width", id = "width", value = 1, min = 1, max = 10})
- self.menu.draw:MenuElement({name = "Enemy attack range", id = "he", type = MENU})
- self.menu.draw.he:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw.he:MenuElement({name = "Color", id = "color", color = Draw.Color(150, 255, 0, 0)})
- self.menu.draw.he:MenuElement({name = "Width", id = "width", value = 1, min = 1, max = 10})
- self.menu.draw:MenuElement({name = "Cursor Posistion", id = "cpos", type = MENU})
- self.menu.draw.cpos:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw.cpos:MenuElement({name = "Color", id = "color", color = Draw.Color(150, 153, 0, 76)})
- self.menu.draw.cpos:MenuElement({name = "Width", id = "width", value = 5, min = 1, max = 10})
- self.menu.draw.cpos:MenuElement({name = "Radius", id = "radius", value = 250, min = 1, max = 300})
- self.menu.draw:MenuElement({name = "Farm", id = "farm", type = MENU})
- self.menu.draw.farm:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw.farm:MenuElement({name = "LastHitable", id = "lastHitable", type = MENU})
- self.menu.draw.farm.lastHitable:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw.farm.lastHitable:MenuElement({name = "Color", id = "color", color = Draw.Color(255, 255, 255, 255)})
- self.menu.draw.farm.lastHitable:MenuElement({name = "Width", id = "width", value = 10, min = 1, max = 10})
- self.menu.draw.farm.lastHitable:MenuElement({name = "Radius", id = "radius", value = 35, min = 1, max = 100})
- self.menu.draw.farm:MenuElement({name = "AlmostLastHitable", id = "almostLastHitable", type = MENU})
- self.menu.draw.farm.almostLastHitable:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw.farm.almostLastHitable:MenuElement({name = "Color", id = "color", color = Draw.Color(255, 255, 102, 102)})
- self.menu.draw.farm.almostLastHitable:MenuElement({name = "Width", id = "width", value = 10, min = 1, max = 10})
- self.menu.draw.farm.almostLastHitable:MenuElement({name = "Radius", id = "radius", value = 35, min = 1, max = 100})
- self.menu.draw:MenuElement({name = "Minion attacks", id = "minionAttacks", type = MENU})
- self.menu.draw.minionAttacks:MenuElement({name = "Enable", id = "enable", value = true})
- self.menu.draw.minionAttacks:MenuElement({name = "Color", id = "color", color = Draw.Color(255, 255, 102, 0)})
- self.menu.draw.minionAttacks:MenuElement({name = "Width", id = "width", value = 3, min = 1, max = 10})
- self.menu.draw.minionAttacks:MenuElement({name = "Radius", id = "radius", value = 10, min = 1, max = 100})
- self.menu:MenuElement({name = "Keys", id = "keys", type = MENU, leftIcon = "https://i.imgur.com/QXvoHmH.png"})
- self.menu.keys:MenuElement({name = "Combo Key", id = "combo", key = string.byte(" ")})
- self.menu.keys:MenuElement({name = "Harass Key", id = "harass", key = string.byte("C")})
- self.menu.keys:MenuElement({name = "LastHit Key", id = "lastHit", key = string.byte("X")})
- self.menu.keys:MenuElement({name = "LaneClear Key", id = "laneClear", key = string.byte("V")})
- end
- -- object manager
- function __gsoOrb:_valid(range, unit)
- if unit.distance < range and unit.dead == false and unit.isTargetable == true and unit.visible == true then
- return true
- end
- return false
- end
- function __gsoOrb:_addUnits()
- local countMinions = Game.MinionCount()
- for i = 1, countMinions do
- local minion = Game.Minion(i)
- if self:_valid(2000, minion) then
- if minion.isEnemy then
- self.eMinionsC = self.eMinionsC + 1
- self.eMinions[self.eMinionsC] = minion
- else
- self.aMinionsC = self.aMinionsC + 1
- self.aMinions[self.aMinionsC] = minion
- end
- end
- end
- end
- function __gsoOrb:_removeUnits()
- self.aMinions = {}
- self.aMinionsC = 0
- self.eMinions = {}
- self.eMinionsC = 0
- self.eMinionsLC = {}
- self.eMinionsLCC = 0
- self.eMinionsLH = {}
- self.eMinionsLHC = 0
- self.eMinionsLHS = {}
- self.eMinionsLHSC = 0
- end
- -- predicted pos
- function __gsoOrb:_predPos(speed, pPos, unit)
- local result = unit.pos
- if unit.pathing.hasMovePath == true then
- local uPos = unit.pos
- local ePos = unit.pathing.endPos
- local distUP = pPos:DistanceTo(uPos)
- local distEP = pPos:DistanceTo(ePos)
- if distEP > distUP then
- result = uPos:Extended(ePos, 50+(unit.ms*(distUP / (speed - unit.ms))))
- else
- result = uPos:Extended(ePos, 50+(unit.ms*(distUP / (speed + unit.ms))))
- end
- end
- return result
- end
- -- predicted hp
- function __gsoOrb:_isDead(target)
- local result = true
- for i = 1, self.eMinionsC do
- local eMin = self.eMinions[i]
- if target == eMin.handle then
- result = false
- break
- end
- end
- return result
- end
- function __gsoOrb:_possibleDmg(eMin, time)
- local result = 0
- for i = 1, self.aMinionsC do
- local aMin = self.aMinions[i]
- local aaData = aMin.attackData
- local aDmg = (aMin.totalDamage*(1+aMin.bonusDamagePercent))
- if self.menu.fastLN:Value() == false and (aMin.pathing.hasMovePath == true or self:_isDead(aaData.target) == true) then
- result = result + aDmg
- elseif aaData.target == eMin.handle then
- local endT = aaData.endTime
- local animT = aaData.animationTime
- local windUpT = aaData.windUpTime
- local pSpeed = aaData.projectileSpeed
- local pFlyT = pSpeed > 0 and aMin.pos:DistanceTo(eMin.pos) / pSpeed or 0
- local pStartT = endT - animT
- local pEndT = pStartT + pFlyT + windUpT
- local checkT = Game.Timer()
- pEndT = pEndT > checkT and pEndT or pEndT + animT + pFlyT
- while pEndT - checkT < time do
- result = result + aDmg
- pEndT = pEndT + animT + pFlyT
- end
- end
- end
- return result
- end
- function __gsoOrb:_setEnemyMinions()
- local mLH = self.menu.attack.lhDelay:Value()*0.001
- for i = 1, self.eMinionsC do
- local eMinion = self.eMinions[i]
- if eMinion.distance < myHero.range + myHero.boundingRadius + eMinion.boundingRadius - 30 then
- local eMinion_handle = eMinion.handle
- local eMinion_health = eMinion.health
- local myHero_aaData = myHero.attackData
- local myHero_pFlyTime = myHero_aaData.windUpTime + (eMinion.distance / myHero_aaData.projectileSpeed) + self.latency + 0.05 + self.menu.attack.lhDelay:Value()*0.001
- for k1,v1 in pairs(self.aAttacks) do
- for k2,v2 in pairs(self.aAttacks[k1]) do
- if v2.canceled == false and eMinion_handle == v2.to.handle then
- local checkT = Game.Timer()
- local pEndTime = v2.startTime + v2.pTime
- if pEndTime > checkT and pEndTime - checkT < myHero_pFlyTime - mLH then
- eMinion_health = eMinion_health - v2.dmg
- end
- end
- end
- end
- local myHero_dmg = self.aaDmg + _localBonusDmgUnit(eMinion)
- if eMinion_health - myHero_dmg < 0 then
- self.eMinionsLHC = self.eMinionsLHC + 1
- self.eMinionsLH[self.eMinionsLHC] = { eMinion, eMinion_health - myHero_dmg }
- else
- if eMinion.health - self:_possibleDmg(eMinion, self.animT*3) - myHero_dmg < 0 then
- self.shouldWait = true
- self.shouldWaitT = Game.Timer()
- self.eMinionsLHSC = self.eMinionsLHSC + 1
- self.eMinionsLHS[self.eMinionsLHSC] = eMinion
- else
- self.eMinionsLCC = self.eMinionsLCC + 1
- self.eMinionsLC[self.eMinionsLCC] = eMinion
- end
- end
- end
- end
- self.eMinionsLHD = self.eMinionsLH
- self.eMinionsLHSD = self.eMinionsLHS
- end
- -- active attacks
- function __gsoOrb:_setActiveAA()
- for i = 1, self.aMinionsC do
- local aMinion = self.aMinions[i]
- local aHandle = aMinion.handle
- local aAAData = aMinion.attackData
- if aAAData.endTime > Game.Timer() then
- for i = 1, self.eMinionsC do
- local eMinion = self.eMinions[i]
- local eHandle = eMinion.handle
- if eHandle == aAAData.target then
- local checkT = Game.Timer()
- -- p -> projectile
- local pSpeed = aAAData.projectileSpeed
- local pFlyT = pSpeed > 0 and aMinion.pos:DistanceTo(eMinion.pos) / pSpeed or 0
- local pStartT = aAAData.endTime - aAAData.windDownTime
- if not self.aAttacks[aHandle] then
- self.aAttacks[aHandle] = {}
- end
- local aaID = math.floor(aAAData.endTime)
- if checkT < pStartT + pFlyT then
- if pSpeed > 0 then
- if checkT > pStartT then
- if not self.aAttacks[aHandle][aaID] then
- self.aAttacks[aHandle][aaID] = {
- canceled = false,
- speed = pSpeed,
- startTime = pStartT,
- pTime = pFlyT,
- pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartT)),
- from = aMinion,
- fromPos = aMinion.pos,
- to = eMinion,
- dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
- }
- end
- elseif aMinion.pathing.hasMovePath == true then
- --print("attack canceled")
- self.aAttacks[aHandle][aaID] = {
- canceled = true,
- from = aMinion
- }
- end
- elseif not self.aAttacks[aHandle][aaID] then
- self.aAttacks[aHandle][aaID] = {
- canceled = false,
- speed = pSpeed,
- startTime = pStartT - aAAData.windUpTime,
- pTime = aAAData.windUpTime,
- pos = aMinion.pos,
- from = aMinion,
- fromPos = aMinion.pos,
- to = eMinion,
- dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
- }
- end
- end
- break
- end
- end
- end
- end
- end
- function __gsoOrb:_handleActiveAA()
- local aAttacks2 = self.aAttacks
- for k1,v1 in pairs(aAttacks2) do
- local count = 0
- local checkT = Game.Timer()
- for k2,v2 in pairs(aAttacks2[k1]) do
- count = count + 1
- if v2.speed == 0 and (not v2.from or v2.from == nil or v2.from.dead) then
- --print("dead")
- self.aAttacks[k1] = nil
- break
- end
- if v2.canceled == false then
- local ranged = v2.speed > 0
- if ranged == true then
- self.aAttacks[k1][k2].pTime = v2.fromPos:DistanceTo(self:_predPos(v2.speed, v2.pos, v2.to)) / v2.speed
- end
- 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
- self.aAttacks[k1][k2] = nil
- elseif ranged == true then
- self.aAttacks[k1][k2].pos = v2.fromPos:Extended(v2.to.pos, (checkT-v2.startTime)*v2.speed)
- end
- end
- end
- if count == 0 then
- --print("no active attacks")
- self.aAttacks[k1] = nil
- end
- end
- end
- -- target selector
- function __gsoOrb:_comboT()
- local result = nil
- local min = 10000000
- for i = 1, Game.HeroCount() do
- local hero = Game.Hero(i)
- local armor = hero.armor - myHero.armorPen
- armor = armor > 0 and myHero.bonusArmorPenPercent * armor or armor
- local hp = hero.health + ( 2 * armor ) - ( hero.attackSpeed * hero.totalDamage ) - ( 1.5 * hero.ap )
- if hp < min and hero.isEnemy and self:_valid(myHero.range + myHero.boundingRadius + hero.boundingRadius - 30, hero) then
- min = hp
- result = hero
- end
- end
- return result
- end
- function __gsoOrb:_lastHitT()
- local result = nil
- local min = 10000000
- if self.eMinionsLHC > 0 then
- for i = 1, self.eMinionsLHC do
- local eMinionLH = self.eMinionsLH[i]
- local minion = eMinionLH[1]
- local hp = eMinionLH[2]
- if hp < min then
- min = hp
- result = minion
- end
- end
- end
- return result
- end
- function __gsoOrb:_laneClearT()
- local result = self:_lastHitT()
- if result == nil and self.eMinionsLHSC == 0 and self.shouldWait == false then
- result = self:_comboT()
- if result == nil then
- local min = 10000000
- for i = 1, self.eMinionsLCC do
- local minion = self.eMinionsLC[i]
- local hp = minion.health
- if hp < min then
- min = hp
- result = minion
- end
- end
- end
- end
- return result
- end
- function __gsoOrb:_harassT()
- local result = self:_lastHitT()
- return result == nil and self:_comboT() or result
- end
- -- orb
- function __gsoOrb:_orb(unit)
- local checkT = Game.Timer()
- local mKite = self.menu.movement.kite:Value()*0.001
- local mHum = self.menu.movement.humanizer:Value()*0.001
- local mAS = self.menu.attack.asDelay:Value()*0.001
- local mDel = self.menu.attack.cDelay:Value()
- 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
- self.preAAB = false
- -- checkT > self.lAttack + myHero.attackData.animationTime + 0.075 then
- if self.customAA == true then
- self.customAA = false
- end
- self.canAASpell = false
- self.stopOrb = true
- self.lAttack = Game.Timer()
- Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
- Control.mouse_event(MOUSEEVENTF_RIGHTUP)
- local cPos = cursorPos
- Control.SetCursorPos(unit.pos)
- Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
- Control.mouse_event(MOUSEEVENTF_RIGHTUP)
- self.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, mDel, 0 }
- self.dActionsC = self.dActionsC + 1
- elseif checkT + self.latency - mKite > self.endTime - (self.animT - self.windUpT) then
- --and checkT > self.lAttack + myHero.attackData.windUpTime + 0.075 then
- if self.dActionsC == 0 then
- _localCastSpellsAA()
- end
- if self.stopOrb == false and self.disMove == false and checkT - mHum > self.lMove then
- Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
- Control.mouse_event(MOUSEEVENTF_RIGHTUP)
- self.lMove = checkT
- end
- if self.preAAB == false and checkT > self.endTime - self.animT*0.35 and checkT < self.endTime - self.animT*0.25 and unit ~= nil then
- for i = 1, #localPreAAC do
- localPreAAC[i]()
- end
- self.preAAB = true
- end
- end
- end
- -- wndmsg
- function __gsoOrb:_wndmsg(msg, wParam)
- local i = wParam
- local checkQ = self.checkQ == true and i == HK_Q
- local checkW = self.checkW == true and i == HK_W
- local checkE = self.checkE == true and i == HK_E
- local checkR = self.checkR == true and i == HK_R
- if checkQ or checkW or checkE or checkR or i == HK_SUMMONER_1 or i == HK_SUMMONER_2 then
- local checkT = Game.Timer()
- local inAATime = checkT < self.lAttack + self.windUpT + 0.05
- self.lastSpellT[checkT] = inAATime == true
- self.stopSpell = true
- end
- end
- -- tick
- function __gsoOrb:_tick()
- _localOnTick()
- self:_addUnits()
- self:_setActiveAA()
- self:_handleActiveAA()
- self:_setEnemyMinions()
- local ck = self.menu.keys.combo:Value()
- local hk = self.menu.keys.harass:Value()
- local lhk = self.menu.keys.lastHit:Value()
- local lck = self.menu.keys.laneClear:Value()
- self.aaDmg = myHero.totalDamage + _localBonusDmg()
- self.latency = Game.Latency() * 0.001
- local checkT = Game.Timer()
- if self.shouldWait == true and checkT > self.shouldWaitT + 0.5 then
- self.shouldWait = false
- --print("stop")
- end
- if self.disAA == true then
- local disDAA = self.disAAT
- for k,v in pairs(disDAA) do
- if k + v > self.disAATN then
- self.disAATN = k + v
- self.disAAT[k] = nil
- end
- end
- if self.disAATN > 0 and checkT - self.disAATN > 0 then
- self.disAA = false
- self.disAATN = 0
- end
- end
- if self.disMove == true then
- local disDMove = self.disMoveT
- for k,v in pairs(disDMove) do
- if k + v > self.disMoveTN then
- self.disMoveTN = k + v
- self.disMoveT[k] = nil
- end
- end
- if self.disMoveTN > 0 and checkT - self.disMoveTN > 0 then
- self.disMove = false
- self.disMoveTN = 0
- end
- end
- local spellTimers = self.lastSpellT
- local countLess = 0
- for k,v in pairs(spellTimers) do
- if checkT > k + 2 then
- self.lastSpellT[k] = nil
- elseif checkT < k + 0.3 then
- countLess = countLess + 1
- self.stopSpell = true
- if v == true then
- self.inAAT = true
- end
- --break
- end
- end
- if countLess == 0 then
- if self.stopSpell == true then
- self.stopSpell = false
- end
- if self.inAAT == true then
- self.canAASpell = true
- self.inAAT = false
- --print("Spell in aa time: reset attack")
- end
- end
- local dActions = self.dActions
- local cDActions = 0
- for k,v in pairs(dActions) do
- cDActions = cDActions + 1
- if GetTickCount() - k > v[2] then
- v[1]()
- if v[3] > 0 then
- Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
- Control.mouse_event(MOUSEEVENTF_RIGHTUP)
- end
- self.dActions[k] = nil
- end
- end
- self.dActionsC = cDActions
- if cDActions == 0 then
- _localCastSpells()
- end
- local aaData = myHero.attackData
- local endTime = aaData.endTime
- --endTime = self.customAA == true and self.endTime or endTime
- local windUpTime = aaData.windUpTime
- local animTime = aaData.animationTime
- if endTime > self.endTime then
- args = { windUpT = windUpTime, animT = animTime, endT = self.endTime }
- for i = 1, #localProcessAAC do
- localProcessAAC[i](args)
- end
- if args.windUpT ~= windUpTime then
- self.customAA = true
- self.windUpT = args.windUpT
- else
- self.windUpT = windUpTime
- end
- --self.animT = args.animT
- --self.endTime = self.customAA == true and args.endT or endTime
- self.endTime = endTime
- self.animT = animTime
- self.stopOrb = false
- self.lMove = 0
- if self.countAA == 0 then
- self.firstAA = checkT
- end
- self.countAA = self.countAA + 1
- if self.countAA == 5 then
- --print("5 auto attacks in: "..tostring(math.floor((checkT-self.firstAA)*1000)).."ms")
- self.firstAA = 0
- self.countAA = 0
- end
- elseif self.stopOrb == true and checkT > self.lAttack + self.windUpT + 0.25 + self.latency then
- print("Bad issue: reset attack")
- self.stopOrb = false
- end
- if ck or hk or lhk or lck then
- local AAtarget = nil
- if ck then
- AAtarget = self:_comboT()
- elseif hk then
- AAtarget = self:_harassT()
- elseif lhk then
- AAtarget = self:_lastHitT()
- elseif lck then
- AAtarget = self:_laneClearT()
- end
- self:_orb(AAtarget)
- end
- self:_removeUnits()
- end
- -- draw
- function __gsoOrb:_draw()
- if not self.menu.draw.enable:Value() then return end
- if self.menu.draw.me.enable:Value() and not myHero.dead and myHero.pos:ToScreen().onScreen then
- Draw.Circle(myHero.pos, myHero.range + myHero.boundingRadius + 35, self.menu.draw.me.width:Value(), self.menu.draw.me.color:Value())
- end
- if self.menu.draw.he.enable:Value() then
- for i = 1, Game.HeroCount() do
- local hero = Game.Hero(i)
- if self:_valid(2000, hero) and hero.pos:ToScreen().onScreen then
- Draw.Circle(hero.pos, hero.range + hero.boundingRadius + 35, self.menu.draw.he.width:Value(), self.menu.draw.he.color:Value())
- end
- end
- end
- if self.menu.draw.cpos.enable:Value() then
- Draw.Circle(mousePos, self.menu.draw.cpos.radius:Value(), self.menu.draw.cpos.width:Value(), self.menu.draw.cpos.color:Value())
- end
- if self.menu.draw.farm.enable:Value() then
- if self.menu.draw.farm.lastHitable.enable:Value() then
- local countLH = #self.eMinionsLHD
- for i = 1, countLH do
- local eMinionLHD = self.eMinionsLHD[i]
- local minion = eMinionLHD[1]
- 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())
- end
- end
- if self.menu.draw.farm.almostLastHitable.enable:Value() then
- local countLHS = #self.eMinionsLHSD
- for i = 1, countLHS do
- local eMinionLHSD = self.eMinionsLHSD[i]
- 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())
- end
- end
- end
- if self.menu.draw.minionAttacks.enable:Value() then
- for k1,v1 in pairs(self.aAttacks) do
- for k2,v2 in pairs(self.aAttacks[k1]) do
- local checkT = Game.Timer()
- if v2.to and v2.to ~= nil and not v2.to.dead and checkT > v2.startTime and v2.canceled == false then
- if v2.speed > 0 then
- Draw.Circle(v2.pos, self.menu.draw.minionAttacks.radius:Value(), self.menu.draw.minionAttacks.width:Value(), self.menu.draw.minionAttacks.color:Value())
- else
- Draw.Circle(v2.from.pos, self.menu.draw.minionAttacks.radius:Value(), self.menu.draw.minionAttacks.width:Value(), self.menu.draw.minionAttacks.color:Value())
- end
- end
- end
- end
- end
- end
- _gso.Orb = __gsoOrb()
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|------------------------ASHE-----------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- -- ashe class
- class "__gsoAshe"
- -- init
- function __gsoAshe:__init()
- print("gamsteronAIO "..gsoVersion.." | ashe loaded!")
- self.menu = MenuElement({name = "Gamsteron Ashe", id = "gsoMenuAshe", type = MENU, leftIcon = "https://i.imgur.com/WohLMsm.png"})
- self:_menu()
- self.lastQ = 0
- self.lastW = 0
- self.lastR = 0
- self.lastP = 0
- self.qDur = 0
- self.lastChanged = 0
- self.aaSpeed = myHero.attackSpeed
- _gso.Orb.checkQ = false
- _gso.Orb:_bonusDmg(function() return self:_dmg() end)
- _gso.Orb:_bonusDmgUnit(function(unit) return self:_dmgUnit(unit) end)
- _gso.Orb:_preAA(function() self:_preAA() end)
- _gso.Orb:_castSpells(function() self:_spells() end)
- _gso.Orb:_processAA(function(args) self:_processAA(args) end)
- _gso.Orb:_onTick(function() self:_tick() end)
- end
- --onProcessAttack
- function __gsoAshe:_processAA(args)
- if GetTickCount() < self.lastQ + 300 then
- args.windUpT = 1/(self.aaSpeed*3)
- args.animT = 1/(self.aaSpeed*0.6578947)
- args.endT = args.endT + args.animT
- end
- end
- --tick
- function __gsoAshe:_tick()
- local checkT = Game.Timer()
- if myHero:GetSpellData(_Q).level > 0 then
- for i = 0, myHero.buffCount do
- local buff = myHero:GetBuff(i)
- if buff.count > 0 and buff.name:lower() == "asheqattack" then
- self.qDur = buff.duration
- self.lastP = checkT
- break
- end
- end
- if checkT > self.lastChanged + 1 and checkT > self.lastP + self.qDur - 0.3 and checkT < self.lastP + self.qDur - 0.075 then
- self.aaSpeed = self.aaSpeed - 0.15 - (myHero:GetSpellData(_Q).level*0.05)
- _gso.Orb.windUpT = 1/(self.aaSpeed*3)
- self.lastChanged = checkT
- print("ok")
- end
- end
- end
- -- menu
- function __gsoAshe:_menu()
- self.menu:MenuElement({id = "rdist", name = "use R if enemy distance < X", value = 500, min = 100, max = 1000, step = 50})
- self.menu:MenuElement({type = MENU, id = "combo", name = "Combo"})
- self.menu.combo:MenuElement({id = "qc", name = "UseQ", value = true})
- self.menu.combo:MenuElement({id = "wc", name = "UseW", value = true})
- self.menu.combo:MenuElement({id = "rcd", name = "UseR [enemy distance < X", value = true})
- self.menu.combo:MenuElement({id = "rci", name = "UseR [enemy IsImmobile]", value = true})
- self.menu:MenuElement({type = MENU, id = "harass", name = "Harass"})
- self.menu.harass:MenuElement({id = "qh", name = "UseQ", value = true})
- self.menu.harass:MenuElement({id = "wh", name = "UseW", value = true})
- self.menu.harass:MenuElement({id = "rhd", name = "UseR [enemy distance < X]", value = false})
- self.menu.harass:MenuElement({id = "rhi", name = "UseR [enemy IsImmobile]", value = false})
- end
- -- object manager
- function __gsoAshe:_valid(range, unit)
- if unit.distance < range and unit.dead == false and unit.isTargetable == true and unit.visible == true then
- return true
- end
- return false
- end
- function __gsoAshe:_countEnemies(range, addBB)
- local result = 0
- for i = 1, Game.HeroCount() do
- local hero = Game.Hero(i)
- local r = addBB and range + hero.boundingRadius - 30 or range
- if hero.isEnemy and self:_valid(r, hero) then
- result = result + 1
- end
- end
- return result
- end
- function __gsoAshe:_getEnemies(range)
- local result = {}
- for i = 1, Game.HeroCount() do
- local hero = Game.Hero(i)
- if hero.isEnemy and self:_valid(range, hero) then
- result[#result + 1] = hero
- end
- end
- return result
- end
- function __gsoAshe:_getTarget(range)
- local t = self:_getEnemies(range)
- local num = 10000000
- local target = nil
- for i = 1, #t do
- local unit = t[i]
- local armor = unit.armor - myHero.armorPen
- armor = armor > 0 and myHero.bonusArmorPenPercent * armor or armor
- local unithealth = unit.health + ( 2 * armor ) - ( unit.attackSpeed * unit.totalDamage ) - ( 1.5 * unit.ap )
- if unithealth < num then
- num = unithealth
- target = unit
- end
- end
- return target
- end
- function __gsoAshe:_isImmobile(unit)
- for i = 0, unit.buffCount do
- local buff = unit:GetBuff(i)
- local type = buff.type
- if buff and buff.count > 0 and (type == 5 or type == 11 or type == 29 or type == 24 or buff.name == "recall") then
- return true
- end
- end
- return false
- end
- -- extra damage
- function __gsoAshe:_dmgUnit(unit)
- local dmg = myHero.totalDamage
- local crit = 0.1 + myHero.critChance
- for i = 0, unit.buffCount do
- local buff = unit:GetBuff(i)
- if buff.count > 0 and buff.name:lower() == "ashepassiveslow" then
- local aacompleteT = myHero.attackData.windUpTime + (unit.distance / myHero.attackData.projectileSpeed)
- if aacompleteT + 0.1 < buff.duration then
- return dmg * crit
- end
- --[[ buff.duration, example:
- print(buff.startTime.." "..buff.expireTime.." "..buff.duration.." "..Game.Timer())
- 221.715438842277 223.71543884277 0.16038513183594 223.55505371094
- 223,71543884277-223,55505371094=0,16038513183
- ]]
- end
- end
- return 0
- end
- function __gsoAshe:_dmg()
- return 3
- end
- function __gsoAshe:_preAA()
- local QReadyT = GetTickCount() > self.lastQ + 500
- local QReady = Game.CanUseSpell(_Q) == 0
- if QReady == true and self:_countEnemies(myHero.range + myHero.boundingRadius, true) > 0 then
- 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
- self.aaSpeed = myHero.attackSpeed + 0.15 + (myHero:GetSpellData(_Q).level*0.05)
- Control.KeyDown(HK_Q)
- Control.KeyUp(HK_Q)
- self.lastQ = GetTickCount()
- end
- end
- end
- function __gsoAshe:_spells()
- local isCombo = _gso.Orb.menu.keys.combo:Value()
- local isHarass = _gso.Orb.menu.keys.harass:Value()
- if GetTickCount() > self.lastW + 500 and Game.CanUseSpell(_W) == 0 then
- if (self.menu.combo.wc:Value() and isCombo) or (self.menu.harass.wh:Value() and isHarass) then
- local target = self:_getTarget(1200)
- if target ~= nil then
- local wPred = target:GetPrediction(2000,0.25)
- if wPred and wPred:ToScreen().onScreen and wPred:DistanceTo(myHero.pos) < 1200 and target:GetCollision(100,2000,0.25) == 0 then
- --_gso.Orb:_blockAttack(Game.Timer(), 0.1)
- --_gso.Orb:_blockMove(Game.Timer(), 0.1)
- local cPos = cursorPos
- Control.SetCursorPos(wPred)
- Control.KeyDown(HK_W)
- Control.KeyUp(HK_W)
- self.lastW = GetTickCount()
- _gso.Orb.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, 50, 2 }
- end
- end
- end
- end
- if GetTickCount() > self.lastR + 500 and Game.CanUseSpell(_R) == 0 then
- if (self.menu.combo.rcd:Value() and isCombo) or (self.menu.harass.rhd:Value() and isHarass) then
- local num = self.menu.rdist:Value()
- local t = nil
- for i = 1, Game.HeroCount() do
- local hero = Game.Hero(i)
- local dist = hero.distance
- if hero.isEnemy and hero.dead == false and hero.isTargetable == true and hero.visible == true and dist < num then
- num = dist
- t = hero
- end
- end
- if t ~= nil then
- local rPred = t:GetPrediction(1600,0.25)
- if rPred and rPred:ToScreen().onScreen then
- --_gso.Orb:_blockAttack(Game.Timer(), 0.25)
- --_gso.Orb:_blockMove(Game.Timer(), 0.1)
- local cPos = cursorPos
- Control.SetCursorPos(rPred)
- Control.KeyDown(HK_R)
- Control.KeyUp(HK_R)
- self.lastR = GetTickCount()
- _gso.Orb.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, 50, 4 }
- end
- end
- end
- if GetTickCount() > self.lastR + 500 and ((self.menu.combo.rci:Value() and isCombo) or (self.menu.harass.rhi:Value() and isHarass)) then
- local t = nil
- for i = 1, Game.HeroCount() do
- local hero = Game.Hero(i)
- if hero.isEnemy and self:_valid(1000, hero) and self:_isImmobile(hero) then
- t = hero
- break
- end
- end
- if t ~= nil then
- local rPred = t.pos
- if rPred and rPred:ToScreen().onScreen then
- --_gso.Orb:_blockAttack(Game.Timer(), 0.25)
- --_gso.Orb:_blockMove(Game.Timer(), 0.1)
- local cPos = cursorPos
- Control.SetCursorPos(rPred)
- Control.KeyDown(HK_R)
- Control.KeyUp(HK_R)
- self.lastR = GetTickCount()
- _gso.Orb.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, 50, 4 }
- end
- end
- end
- end
- end
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|--------------------ONLOAD-------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- --------------------|---------------------------------------------------------|--------------------
- function OnLoad()
- if hName == "Ashe" then
- __gsoAshe()
- elseif hName == "Twitch" then
- __gsoTwitch()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement