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(255, 255, 255, 255)})
- menu_GSO:MenuElement({name = "Color MinionLHS", id = "colminLHS", color = Draw.Color(255, 255, 102, 102)})
- menu_GSO:MenuElement({name = "Color Missile", id = "colmis", color = Draw.Color(255, 255, 102, 0)})
- 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 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 ]]
- --[[ START PREDICTED POS ]]
- local function predictedPosition(speed, pPos, unit)
- local result = unit.pos
- if unit.pathing.hasMovePath == true then
- local uPos = unit.pos
- local ePos = unit.pathing.endPos
- local d_uPos_pPos = pPos:DistanceTo(uPos)
- local d_ePos_pPos = pPos:DistanceTo(ePos)
- if d_ePos_pPos > d_uPos_pPos then
- result = uPos:Extended(ePos, 50+(unit.ms*(d_uPos_pPos / (speed - unit.ms))))
- else
- result = uPos:Extended(ePos, 50+(unit.ms*(d_uPos_pPos / (speed + unit.ms))))
- end
- end
- return result
- end
- --[[ START PREDICTED POS ]]
- --[[
- 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, time)
- local result = 0
- for i = 1, #aMinions do
- local aMinion = aMinions[i]
- local range = 110
- local distance = aMinion.pos:DistanceTo(unit.pos)
- local aMinion_aaData = aMinion.attackData
- local pSpeed = aMinion_aaData.projectileSpeed
- if pSpeed > 600 and pSpeed < 1100 then
- range = 550
- elseif pSpeed > 1100 then
- range = 300
- end
- range = range + aMinion.boundingRadius + unit.boundingRadius
- if distance < range + 500 then
- local dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-unit.flatDamageReduction
- --[[
- if aMinion.pathing.hasMovePath == true then
- result = result + dmg
- end
- if distance < range + 250 then
- result = result + dmg
- end
- --]]
- local aMinion_target = aMinion_aaData.target
- local pStartTime = aMinion_aaData.endTime - aMinion_aaData.windDownTime
- local checkT = Game.Timer()
- local pFlyTime = pSpeed > 0 and distance / pSpeed or 0
- local pEndTime = pStartTime + pFlyTime
- pEndTime = checkT < pEndTime and pEndTime or pEndTime + aMinion_aaData.animationTime
- if aMinion.pathing.hasMovePath == true or unit.health <= 0 or unit.dead == true or not aMinion_target or aMinion_target == nil or aMinion_target <= 0 or checkT > pEndTime or checkT > aMinion_aaData.endTime then
- result = result + dmg
- elseif aMinion_target == unit.handle then
- if pEndTime - checkT < time then
- result = result + dmg
- for j = 1, 10 do
- pEndTime = pEndTime + aMinion_aaData.animationTime
- if checkT < pEndTime and pEndTime - checkT < time then
- result = result + dmg
- else
- break
- end
- end
- end
- end
- end
- end
- return result
- end
- local function setEnemyMinions()
- for i = 1, #eMinions do
- local eMinion = eMinions[i]
- 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) + 0.125
- for k1,v1 in pairs(aAttacks) do
- for k2,v2 in pairs(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 then
- eMinion_health = eMinion_health - v2.dmg
- end
- end
- end
- end
- local myHero_dmg = myHero.totalDamage
- if eMinion_health - myHero_dmg < 0 then
- eMinionsLH[#eMinionsLH+1] = eMinion
- else
- if eMinion.health - getPossibleDmg(eMinion, myHero_aaData.animationTime*2.5) - myHero_dmg - 25 < 0 then
- eMinionsLHS[#eMinionsLHS+1] = eMinion
- else
- eMinionsLC[#eMinionsLC+1] = eMinion
- end
- end
- end
- eMinionsLHD = eMinionsLH
- 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
- if not aAttacks[aMinion_handle] then
- aAttacks[aMinion_handle] = {}
- end
- local aaID = math.floor(aMinion_aaData.endTime)
- if checkT < pStartTime + pFlyTime 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,
- pTime = pFlyTime,
- pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartTime)),
- 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")
- 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,
- pTime = aMinion_aaData.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
- 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 v2.speed == 0 and (not v2.from or v2.from == nil or v2.from.dead) then
- --print("dead")
- aAttacks[k1] = nil
- break
- end
- if v2.canceled == false then
- local ranged = v2.speed > 0
- if ranged == true then
- aAttacks[k1][k2].pTime = v2.fromPos:DistanceTo(predictedPosition(v2.speed, v2.pos, v2.to)) / v2.speed
- end
- if checkT > v2.startTime + aAttacks[k1][k2].pTime - 0.085 or not v2.to or v2.to == nil or v2.to.dead then
- aAttacks[k1][k2] = nil
- elseif ranged == true then
- 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")
- 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 and eMinionLH.distance < myHero.range + myHero.boundingRadius + eMinionLH.boundingRadius - 30 then
- max = maxHP
- result = eMinionLH
- end
- end
- return result
- end
- local function laneClear()
- local result = nil
- local max = 0
- for i = 1, #eMinionsLH do
- local eMinionLH = eMinionsLH[i]
- local maxHP = eMinionLH.maxHealth
- if maxHP > max and eMinionLH.distance < myHero.range + myHero.boundingRadius + eMinionLH.boundingRadius - 30 then
- max = maxHP
- result = eMinionLH
- end
- end
- local countLHS = 0
- for i = 1, #eMinionsLHS do
- local eMinionLHS = eMinionsLHS[i]
- if eMinionLHS.distance < myHero.range + myHero.boundingRadius + eMinionLHS.boundingRadius - 30 then
- countLHS = countLHS + 1
- end
- end
- if result == nil and countLHS == 0 then
- local min = 10000000
- --max = 0
- for i = 1, #eMinionsLC do
- local eMinionLC = eMinionsLC[i]
- local eMinionHP = eMinionLC.health
- --[[
- if eMinionLC.distance < myHero.range + myHero.boundingRadius + eMinionLC.boundingRadius - 30 and eMinionHP > max then--eMinionHP < min and then
- --min = eMinionHP
- max = eMinionHP
- result = eMinionLC
- end
- --]]
- if eMinionLC.distance < myHero.range + myHero.boundingRadius + eMinionLC.boundingRadius - 30 and eMinionHP < min then
- min = eMinionHP
- result = eMinionLC
- end
- end
- end
- 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, 75, 1, menu_GSO.colminLH:Value())
- end
- for i = 1, #eMinionsLHSD do
- local eMinionLHSD = eMinionsLHSD[i]
- Draw.Circle(eMinionLHSD.pos, 75, 1, menu_GSO.colminLHS: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 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, 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