Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- globals
- __gsoOrb_loaded = false
- gsoLatency = Game.Latency() * 0.001
- -- orbwalker class
- class "__gsoOrb"
- -- init
- function __gsoOrb:__init()
- --print("Gamsteron | orbwalker loaded!")
- self.menu = MenuElement({type = MENU, id = "menu", name = "Gamsteron Orbwalker 0.08", leftIcon = "https://i.imgur.com/nahe4Ua.png"})
- self:_menu()
- __gsoOrb_loaded = true
- self.lAttack = 0 -- lastAttackTime
- self.lMove = 0 -- lastMoveTime
- 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.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:_tick1() end)
- Callback.Add('Tick', function() self:_tick2() end)
- Callback.Add('Draw', function() self:_draw() end)
- Callback.Add("WndMsg", function(msg, wParam) self:_wndmsg(msg, wParam) end)
- end
- -- menu
- function __gsoOrb:_menu()
- 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 = "Harrass Key", id = "harras", 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 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 + aaData.animationTime + 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) + gsoLatency + 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 = myHero.totalDamage + 3
- 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 - gsoLatency - 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 unit ~= nil and (checkT + 0.13 - mAS > self.endTime or self.canAASpell == true) then
- -- checkT > self.lAttack + myHero.attackData.animationTime + 0.075 then
- 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 }
- elseif self.stopOrb == false and checkT - mHum > self.lMove and checkT + self.latency - mKite > self.endTime - (self.animT - self.windUpT) then
- --and checkT > self.lAttack + myHero.attackData.windUpTime + 0.075 then
- Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
- Control.mouse_event(MOUSEEVENTF_RIGHTUP)
- self.lMove = checkT
- end
- end
- -- wndmsg
- function __gsoOrb:_wndmsg(msg, wParam)
- local i = wParam
- if i == HK_Q or i == HK_W or i == HK_E or i == HK_R 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:_tick1()
- gsoLatency = Game.Latency() * 0.001
- self:_addUnits()
- self:_setActiveAA()
- self:_handleActiveAA()
- self:_setEnemyMinions()
- local ck = self.menu.keys.combo:Value()
- local hk = self.menu.keys.harras:Value()
- local lhk = self.menu.keys.lastHit:Value()
- local lck = self.menu.keys.laneClear:Value()
- 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
- function __gsoOrb:_tick2()
- local checkT = Game.Timer()
- if self.shouldWait == true and checkT > self.shouldWaitT + 0.5 then
- self.shouldWait = false
- --print("stop")
- 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.25 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
- --print("Spell in aa time: reset attack")
- end
- self.inAAT = false
- end
- local dActions = self.dActions
- for k,v in pairs(dActions) do
- if GetTickCount() - k > dActions[k][2] then
- dActions[k][1]()
- self.dActions[k] = nil
- end
- end
- self.latency = Game.Latency() * 0.001
- local aaData = myHero.attackData
- local endTime = aaData.endTime
- self.windUpT = aaData.windUpTime
- self.animT = aaData.animationTime
- if endTime > self.endTime then
- self.stopOrb = false
- self.endTime = endTime
- 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.15 then
- --print("Bad issue: reset attack")
- self.stopOrb = false
- end
- 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
- function OnLoad()
- __gsoOrb()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement