Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Ashe Helper v1.6b(fixed) by xkjtx/DeniCevap/ConfidentialitySpice(original script)
- (SBTW)modded/added for there sweetness and autoAttack code! -xkjtx/DeniCevap
- assisted(Ult code) by HeX --Just beautiful!
- -Move to Mouse added on (2-17-2013) -xkjtx
- -Auto Volley <<Hot key Default = Space Bar>>(32)<<(Toggle minionCollision(in menu))>>
- -Auto Frost Shot (Auto) <<(autoAttacks target while holding Space Bar)>>
- -Auto Ult(R) Shot <<(Hot key Default = letter S)>>(83)<<(Change to (32) to burst with Ult)
- -Minion Collision <<(Off by default)>>Toggle in menu<<
- -Target configuration<<(Selecting target with Left Mouse click will focus)>>
- -Press shift to configure
- Explanation of the marks:
- -Green circle: Marks the current target to which you will do the combo
- -Marks focused target(small greenish circle)
- -Marks the targets next position (in light blueish color: always appears in front of target moving)
- -AA Range(purpleish)
- -Volley Range(greenish)
- -Move To Mouse(toggle in menu/off by default) --<< This will mess with the AA'ing, but everything else works fine
- ]]
- if myHero.charName ~= "Ashe" then return end
- --[[ Code ]]
- local range = 750
- local range2 = 1000 --<< Turned down, because auto(hot-key) tries to fire out of range. >>
- local range3 = 20000
- local player = GetMyHero()
- local enemyMinions = {}
- local tick = nil
- -- ts
- local ts
- -- hot keys (SBTW = both hot keys are 32)
- local hotVolly = 32 -- Space bar
- local hotArrow = 83 -- letter 'S'
- -- more locals
- local WREADY = false
- local RREADY = false
- local travelDuration = nil
- local predic = nil
- local startAttackSpeed = 0.625
- local lastBasicAttack = 0
- local swing = 0
- local delay = 200
- local speed = 1.975
- local wWidth = 135 -- <<Increase if W is hitting creeps with collision ON.>>
- function OnLoad()
- PrintChat("Ashe Helper v1.6b: mod(xkjtx)!")
- SCConfig = scriptConfig("Ashe Helper 1.6", "Ashe-perfect--xkjtx--Working")
- SCConfig:addParam("scriptActive", "Volley", SCRIPT_PARAM_ONKEYDOWN, false, hotVolly) -- Space
- SCConfig:addParam("ULTActive", "Arrow", SCRIPT_PARAM_ONKEYDOWN, false, hotArrow) -- S
- SCConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- SCConfig:addParam("checkCollision", "Use minion collision", SCRIPT_PARAM_ONOFF, false) -- off by default
- SCConfig:addParam("moveMouse", "Active Move", SCRIPT_PARAM_ONOFF, false) -- move to Mouse(off by default) -- messes with AA'ing, but will cast W and R when hotkeys are pressed and its on--
- SCConfig:addParam("predicTion", "Prediction OnOff", SCRIPT_PARAM_ONOFF, true) -- On by default because I believe it works better..
- SCConfig:permaShow("scriptActive")
- SCConfig:permaShow("ULTActive")
- SCConfig:permaShow("checkCollision")
- SCConfig:permaShow("moveMouse")
- for i = 0, objManager.maxObjects, 1 do
- local object = objManager:GetObject(i)
- if CollisionCheck(object) then table.insert(enemyMinions, object) end
- end
- -- set to true if you want to GetTarget
- ts = TargetSelector(TARGET_NEAR_MOUSE,range3,DAMAGE_PHYSICAL,true) -- TARGET_NEAR_MOUSE -- TARGET_LOW_HP -- Trying both work good, but Ult seems to work better with TARGET_NEAR_MOUSE = true
- ts.name = "Ashe"
- SCConfig:addTS(ts)
- lastBasicAttack = os.clock()
- end
- function OnCreateObj(object)
- if CollisionCheck(object) then table.insert(enemyMinions, object) end
- end
- --[[function OnProcessSpell(unit, spell)
- if unit.isMe and (spell.name:find("Attack") ~= nil) then
- swing = 1
- lastBasicAttack = os.clock()
- end
- end]]
- function CollisionCheck(object)
- return object and object.valid and object.name:find("Minion_") and object.team ~= myHero.team and object.dead == false
- end
- --[[ -------------------------Stuff that happens when you press hot keys------------------------- ]]--
- function OnTick()
- if myHero.dead then return end
- ts:update()
- if ts.target ~= nil and not myHero.dead then
- travelDuration = (delay + GetDistance(myHero, ts.target)/speed)
- ts:SetPrediction(travelDuration)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- predic = ts.nextPosition
- AttackDelay = 1/(myHero.attackSpeed*startAttackSpeed)
- if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
- swing = 0
- end
- if SCConfig.ULTActive or SCConfig.scriptActive and not SCConfig.moveMouse then
- if GetDistance(ts.target)<=range2 and swing == 0 then
- myHero:Attack(ts.target)
- end
- end
- end
- for i,minion in pairs(enemyMinions) do
- if minion ~= nil and not minion.valid then
- table.remove(enemyMinions, i)
- end
- end
- if SCConfig.scriptActive and SCConfig.predicTion then
- if SCConfig.moveMouse then
- player:MoveTo(mousePos.x, mousePos.z) -- move to mouse
- end
- if WREADY and ts.target ~= nil and not myHero.dead and GetDistance(ts.target)<=range2 then
- if SCConfig.checkCollision and ts.target ~= nil and predic ~= nil and not minionCollision(ts.target, wWidth, enemyMinions, range2) then
- CastSpell(_W, ts.nextPosition.x, ts.nextPosition.z)
- elseif not SCConfig.checkCollision and ts.target ~= nil then
- CastSpell(_W, ts.nextPosition.x, ts.nextPosition.z)
- end
- end
- elseif SCConfig.scriptActive and not SCConfig.predicTion then
- if WREADY and ts.target ~= nil and not myHero.dead and GetDistance(ts.target)<=range2 then
- if SCConfig.checkCollision and ts.target ~= nil and not minionCollision(ts.target, wWidth, enemyMinions, range2) then
- CastSpell(_W, ts.target)
- elseif not SCConfig.checkCollision and ts.target ~= nil then
- CastSpell(_W, ts.target)
- end
- end
- end
- if SCConfig.ULTActive then
- if SCConfig.moveMouse then
- player:MoveTo(mousePos.x, mousePos.z) -- move to mouse
- end
- if RREADY and ts.target ~= nil and not myHero.dead and predic ~= nil and GetDistance(predic)<=range3 then
- CastSpell(_R, ts.nextPosition.x, ts.nextPosition.z)
- end
- end
- end
- --[[---------------------------------Basic Attacks and Q-------------------------------]]--
- function OnProcessSpell(unit, spell)
- if unit.isMe and spell and spell.name:find("BasicAttack")or spell.name:find("CritAttack") and spell.name ~= nil and string.find(spell.name, "attack") then
- swing = 1
- lastBasicAttack = os.clock()
- end
- --[[if unit.isMe and spell.name ~= nil and string.find(spell.name, "attack") then
- swing = 1
- lastBasicAttack = os.clock()
- end]]
- if unit.isMe and spell and string.find(string.lower(spell.name),"attack") then
- for i=1, heroManager.iCount do
- local target = heroManager:GetHero(i)
- if target ~= nil and target.visible and target.team ~= player.team and not target.dead and math.sqrt((target.x - spell.endPos.x)^2 + (target.z - spell.endPos.z)^2) < 80 then
- CastSpell(_Q)
- end
- end
- end
- if unit.isMe and spell and string.find(string.lower(spell.name),"frostarrow") then
- local continueFrost = false
- for i=1, heroManager.iCount do
- local target = heroManager:GetHero(i)
- if target ~= nil and target.visible and target.team ~= player.team and not target.dead and math.sqrt((target.x - spell.endPos.x)^2 + (target.z - spell.endPos.z)^2) < 80 then
- continueFrost = true
- else
- continueFrost = false
- end
- end
- if continueFrost == false then
- CastSpell(_Q)
- end
- end
- end
- --[[---------------------------------Collision Function-------------------------------]]--
- function minionCollision(predic, width, enemyMinions, range)
- for _, minionObjectE in pairs(enemyMinions) do
- if minionObjectE ~= nil and string.find(minionObjectE.name,"Minion_") == 1 and minionObjectE.team ~= player.team and minionObjectE.dead == false and minionObjectE.valid then
- if predic ~= nil and player:GetDistance(minionObjectE) < range2 then
- ex = player.x
- ez = player.z
- tx = predic.x
- tz = predic.z
- dx = ex - tx
- dz = ez - tz
- if dx ~= 0 then
- m = dz/dx
- c = ez - m*ex
- end
- mx = minionObjectE.x
- mz = minionObjectE.z
- distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
- if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
- return true
- end
- end
- end
- end
- return false
- end
- function OnDraw()
- if SCConfig.drawcircles and not myHero.dead then
- DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x9900FF) -- purpleish
- DrawCircle(myHero.x, myHero.y, myHero.z, range2, 0x003300) -- greenish
- if ts.target ~= nil then
- for j=0, 10 do
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
- end
- if predic ~= nil then
- DrawCircle(predic.x, predic.y, predic.z, 100, 0x000099) -- blueish
- end
- end
- end
- end
- function OnSendChat(msg)
- ts:OnSendChat(msg, "pri")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement