Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- orbwalker class
- class "__gsoOrb"
- -- init
- function __gsoOrb:__init()
- self.menu = MenuElement({type = MENU, id = "menu", name = "TEST"})
- self.menu:MenuElement({name = "Combo Key", id = "combo", key = string.byte(" ")})
- self.lAttack = 0 -- lastAttackTime
- self.lMove = 0 -- lastMoveTime
- self.latency = Game.Latency() * 0.001
- 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
- Callback.Add('Tick', function() self:_tick() end)
- Callback.Add('Tick', function() self:_tick2() end)
- Callback.Add("WndMsg", function(msg, wParam) self:_wndmsg(msg, wParam) end)
- end
- 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
- function __gsoOrb:_tick()
- if self.menu.combo:Value() then
- local target = nil
- for i = 1, Game.HeroCount() do
- local hero = Game.Hero(i)
- local range = myHero.range + myHero.boundingRadius + hero.boundingRadius - 30
- if hero.isEnemy and hero.distance < range and hero.dead == false and hero.isTargetable == true and hero.visible == true then
- target = hero
- break
- end
- end
- local checkT = Game.Timer()
- if self.stopOrb == false and self.stopSpell == false and target ~= nil and (checkT + 0.13 > 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(target.pos)
- Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
- Control.mouse_event(MOUSEEVENTF_RIGHTUP)
- self.dActions[GetTickCount()] = { function() Control.SetCursorPos(cPos.x, cPos.y) end, 50 }
- elseif self.stopOrb == false and checkT > self.lMove + 0.2 then--and checkT + 0.05 > 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
- end
- function __gsoOrb:_tick2()
- local checkT = Game.Timer()
- 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((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
- function OnLoad()
- __gsoOrb()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement