Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ START MENU ]]
- local menu_GSO = MenuElement({type = MENU, id = "menugso", name = "TEST"})
- menu_GSO:MenuElement({name = "Color MinionLH", id = "colminLH", color = Draw.Color(150, 49, 210, 0)})
- menu_GSO:MenuElement({name = "Color MinionLHS", id = "colminLHS", color = Draw.Color(150, 49, 210, 0)})
- menu_GSO:MenuElement({name = "Color MinionLC", id = "colminLC", color = Draw.Color(150, 49, 210, 0)})
- menu_GSO:MenuElement({name = "Color Missile", id = "colmis", color = Draw.Color(150, 153, 0, 76)})
- menu_GSO:MenuElement({id = "lhit", name = "LastHit Key", key = string.byte("X")})
- menu_GSO:MenuElement({id = "lclr", name = "LaneClear Key", key = string.byte("V")})
- --[[ END MENU ]]
- --[[ START VARIABLES ]]
- local aAttacks = {} -- activeAttacks
- local aMinions = {} -- allyMinions
- local eMinions = {} -- enemyMinions
- local eMinionsLH = {} -- enemyMinionsLastHitable
- local eMinionsLC = {} -- enemyMinionsLaneClearable
- local eMinionsLHS = {} -- enemyMinionsLastHitableSoon
- local lAttack = 0 -- lastAttackTime
- local lMove = 0 -- lastMoveTime
- local dMouse = nil -- delayedMouseAction
- local eMinionsLHD = {}
- local eMinionsLCD = {}
- local eMinionsLHSD = {}
- --[[ END VARIABLES ]]
- --[[ START OBJECT MANAGER ]]
- local function isValidTarget_GSO(range, unit)
- local type = unit.type
- local isUnit = type == Obj_AI_Hero or type == Obj_AI_Minion or type == Obj_AI_Turret
- local isValid = isUnit and unit.valid or true
- if unit.distance<=range and not unit.dead and unit.isTargetable and unit.visible and isValid then
- return true
- end
- return false
- end
- local function getAllyMinions_GSO(range)
- local result = {}
- for i = 1, Game.MinionCount() do
- local minion = Game.Minion(i)
- if minion.isAlly and isValidTarget_GSO(range, minion) then
- result[#result + 1] = minion
- end
- end
- return result
- end
- local function getEnemyMinions_GSO(range)
- local result = {}
- for i = 1, Game.MinionCount() do
- local minion = Game.Minion(i)
- local isotherminion = minion.maxHealth <= 6
- if minion.isEnemy and not isotherminion and isValidTarget_GSO(range, minion) then
- result[#result + 1] = minion
- end
- end
- return result
- end
- --[[ END OBJECT MANAGER ]]
- --[[ START DELAY ACTION ]]
- local function doDelayedAction()
- if dMouse ~= nil and GetTickCount() - dMouse[2] > dMouse[3] then
- dMouse[1]()
- dMouse = nil
- end
- end
- --[[ END DELAY ACTION ]]
- --[[
- aAttacks[aMinion_handle][aaID] = {
- canceled = false,
- speed = pSpeed,
- startTime = pStartTime,
- endTime = pEndTime,
- pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartTime)),
- from = aMinion,
- to = eMinion,
- dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
- }
- local eMinionsLH = {} -- enemyMinionsLastHitable
- local eMinionsLC = {} -- enemyMinionsLaneClearable
- local eMinionsLHS = {} -- enemyMinionsLastHitableSoon
- ]]
- --[[ START ENEMIES, ALLIES ]]
- local function getPossibleDmg(unit)
- local result = 0
- for i = 1, #aMinions do
- local aMinion = aMinions[i]
- local distance = aMinion.pos:DistanceTo(unit.pos)
- if distance < aMinion.range + 500 and (aMinion.pathing.hasMovePath == true or aMinion.attackData.target == unit.handle) then
- result = result + (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))
- end
- end
- return result
- end
- local function setEnemyMinions()
- for i = 1, #eMinions do
- local eMinion = eMinions[i]
- local eMinion_handle = eMinion.handle
- local eMinion_healthLH = eMinion.health
- local myHero_aaData = myHero.attackData
- local myHero_pFlyTime = myHero_aaData.windUpTime + (eMinion.distance / myHero_aaData.projectileSpeed) + 0.1
- for k1,v1 in pairs(aAttacks) do
- for k2,v2 in pairs(aAttacks[k1]) do
- local checkT = Game.Timer()
- local eMinion_pFlyTime = v2.endTime
- if v2.canceled == false and eMinion_handle == v2.to.handle and eMinion_pFlyTime > checkT and eMinion_pFlyTime - checkT < myHero_pFlyTime then
- eMinion_healthLH = eMinion_healthLH - v2.dmg
- end
- end
- end
- local myHero_dmg = myHero.totalDamage
- if eMinion_healthLH - myHero_dmg < 0 then
- eMinionsLH[#eMinionsLH+1] = eMinion
- else
- if eMinion.health - getPossibleDmg(eMinion) - (myHero_dmg*2) < 0 then
- eMinionsLHS[#eMinionsLHS+1] = eMinion
- else
- eMinionsLC[#eMinionsLC+1] = eMinion
- end
- end
- end
- eMinionsLHD = eMinionsLH
- eMinionsLCD = eMinionsLC
- eMinionsLHSD = eMinionsLHS
- end
- local function addEnemyMinions()
- local t = getEnemyMinions_GSO(2000)
- for i = 1, #t do
- local minion = t[i]
- if not eMinions[minion.handle] then
- eMinions[i] = minion
- end
- end
- end
- local function removeEnemyMinions()
- eMinions = {}
- eMinionsLC = {}
- eMinionsLH = {}
- eMinionsLHS = {}
- end
- local function addAllyMinions()
- local t = getAllyMinions_GSO(2000)
- for i = 1, #t do
- local minion = t[i]
- aMinions[i] = minion
- end
- end
- local function removeAllyMinions()
- aMinions = {}
- end
- --[[ END ENEMIES, ALLIES ]]
- --[[ START ACTIVE ATTACKS ]]
- local function setActiveAttacks()
- for i = 1, #aMinions do
- local aMinion = aMinions[i]
- local aMinion_handle = aMinion.handle
- local aMinion_aaData = aMinion.attackData
- if aMinion_aaData.endTime > Game.Timer() then
- for i = 1, #eMinions do
- local eMinion = eMinions[i]
- local eMinion_handle = eMinion.handle
- if eMinion_handle == aMinion_aaData.target then
- local checkT = Game.Timer()
- -- p -> projectile
- local pSpeed = aMinion_aaData.projectileSpeed
- local pFlyTime = pSpeed > 0 and aMinion.pos:DistanceTo(eMinion.pos) / pSpeed or 0
- local pStartTime = aMinion_aaData.endTime - aMinion_aaData.windDownTime
- local pEndTime = pStartTime + pFlyTime
- if not aAttacks[aMinion_handle] then
- aAttacks[aMinion_handle] = {}
- end
- local aaID = math.floor(aMinion_aaData.endTime)
- if checkT < pEndTime then
- if pSpeed > 0 then
- if checkT > pStartTime then
- if not aAttacks[aMinion_handle][aaID] then
- aAttacks[aMinion_handle][aaID] = {
- canceled = false,
- speed = pSpeed,
- startTime = pStartTime,
- endTime = pEndTime,
- pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartTime)),
- from = aMinion,
- to = eMinion,
- dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
- }
- end
- elseif aMinion.pathing.hasMovePath == true then
- --print("attack canceled")
- aAttacks[aMinion_handle][aaID] = {
- canceled = true,
- from = aMinion
- }
- end
- elseif not aAttacks[aMinion_handle][aaID] then
- aAttacks[aMinion_handle][aaID] = {
- canceled = false,
- speed = pSpeed,
- startTime = pStartTime - aMinion_aaData.windUpTime,
- endTime = pEndTime,
- pos = aMinion.pos,
- from = aMinion,
- to = eMinion,
- dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
- }
- end
- end
- break
- end
- end
- end
- end
- end
- local function handleActiveAttacks()
- local aAttacks2 = aAttacks
- for k1,v1 in pairs(aAttacks2) do
- local count = 0
- local checkT = Game.Timer()
- for k2,v2 in pairs(aAttacks[k1]) do
- count = count + 1
- if not v2.from or v2.from == nil or v2.from.dead then
- --print("dead")
- aAttacks[k1] = nil
- break
- end
- if v2.canceled == false then
- if checkT > v2.endTime - 0.08 or not v2.to or v2.to == nil or v2.to.dead then
- aAttacks[k1][k2] = nil
- elseif v2.speed > 0 then
- aAttacks[k1][k2].pos = v2.from.pos:Extended(v2.to.pos, (checkT-v2.startTime)*v2.speed)
- end
- end
- end
- if count == 0 then
- --print("no active attacks")
- aAttacks[k1] = nil
- end
- end
- end
- --[[ END ACTIVE ATTACKS ]]
- --[[ START TARGET SELECTOR ]]
- local function lastHit()
- local result = nil
- local max = 0
- for i = 1, #eMinionsLH do
- local eMinionLH = eMinionsLH[i]
- local maxHP = eMinionLH.maxHealth
- if maxHP > max then
- max = maxHP
- result = eMinionLH
- end
- end
- return result
- end
- local function laneClear()
- local result = nil
- --
- return result
- end
- --[[ END TARGET SELECTOR ]]
- --[[ START ORBWALKER ]]
- local function Orb(unit)
- local checkT = GetTickCount()
- if checkT > lAttack + (myHero.attackData.animationTime*1000) + 125 and unit ~= nil then
- local cPos = cursorPos
- Control.SetCursorPos(unit.pos)
- Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
- Control.mouse_event(MOUSEEVENTF_RIGHTUP)
- lAttack = GetTickCount()
- lMove = 0
- dMouse = { function() Control.SetCursorPos(cPos.x, cPos.y) end, GetTickCount(), 50 }
- elseif checkT > lAttack + (myHero.attackData.windUpTime*1000) + 150 and GetTickCount() > lMove + 200 then
- Control.mouse_event(0x0008)
- Control.mouse_event(0x0010)
- lMove = GetTickCount()
- end
- end
- --[[ END ORBWALKER ]]
- --[[ START TICK ]]
- Callback.Add("Tick", function()
- doDelayedAction()
- addEnemyMinions()
- addAllyMinions()
- setActiveAttacks()
- handleActiveAttacks()
- setEnemyMinions()
- local AAtarget = nil
- local lh = menu_GSO.lhit:Value()
- local lc = menu_GSO.lclr:Value()
- if lh then
- AAtarget = lastHit()
- elseif lc then
- AAtarget = laneClear()
- end
- if lh or lc then
- Orb(AAtarget)
- end
- removeEnemyMinions()
- removeAllyMinions()
- end)
- --[[ END TICK ]]
- --[[
- aAttacks[aMinion_handle][aaID] = {
- canceled = false,
- speed = pSpeed,
- startTime = pStartTime,
- endTime = pEndTime,
- pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartTime)),
- from = aMinion,
- to = eMinion,
- dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
- }
- ]]
- --[[ START DRAWS ]]
- Callback.Add("Draw", function()
- for i = 1, #eMinionsLHD do
- local eMinionLHD = eMinionsLHD[i]
- Draw.Circle(eMinionLHD.pos, 35, 5, menu_GSO.colminLH:Value())
- end
- for i = 1, #eMinionsLHSD do
- local eMinionLHSD = eMinionsLHSD[i]
- Draw.Circle(eMinionLHSD.pos, 35, 5, menu_GSO.colminLHS:Value())
- end
- for i = 1, #eMinionsLCD do
- local eMinionLCD = eMinionsLCD[i]
- Draw.Circle(eMinionLCD.pos, 35, 5, menu_GSO.colminLC:Value())
- end
- for k1,v1 in pairs(aAttacks) do
- for k2,v2 in pairs(aAttacks[k1]) do
- local checkT = Game.Timer()
- if v2.to and not v2.to.dead and checkT > v2.startTime and v2.canceled == false then
- if v2.speed > 0 then
- Draw.Circle(v2.pos, 10, 10, menu_GSO.colmis:Value())
- else
- Draw.Circle(v2.from.pos, 10, 10, menu_GSO.colmis:Value())
- end
- end
- end
- end
- end)
- --[[ END DRAWS]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement