Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- MerryGoRound 1.0
- By Kevinkev
- <Because you should be happy running around turret opposite your enemy>
- Description:
- Basically we've all known about juking under turret. Especially at top lane when (s)he wants to dive you.
- Because sometimes juking under turret is what will help you win the fight and ultimately kill him.
- We've probably all succeeded at this sometimes and sometimes we misclick and walk right in to the enemy.
- But what if, there was a way to do it without fail. Provided you turn it on when needed. :P
- Tips:
- -Turn it on when you feel like they will dive you at turret and you want to juke them.
- -Be smart, if they have a gap closer like xin zhao this probably won't work. But then it might to some degree help. (He dashes you flash to other side and proceed to juke)
- HOTKEYS (for different users)
- T-Stay on or off
- V-Hold down to turn on, let go to turn off
- I recommend V. :P
- Notes:
- -Currently supports single targets. Might update later on for 2 targets to determine best position but more than that and I'm pretty sure you should just leave that turret.
- -No dead turret check because you can still juke around the remains of a turret although it'd only buy time..
- ]]--
- function OnLoad()
- --HOTKEYS
- switchHK = string.byte("T") --Press once to turn on/off
- toggleHK = string.byte("V") --Hold to turn on/off
- --RANGES
- rangeFromEnemy = 600 --Range it detects enemies and proceeds to go to the furthest side of the turret
- rangeAroundTurret = 180 --Range it will move around turret.(Whether or not you delay while moving around depends on auto pathing)
- TurretDistance = 1000 --Range it will detect the turret from
- TargetCircleRadius = 100 --Size of destination point circles
- --COLOURS
- SafeColor = 0x00FF00 --Color of safe position if juking
- NeutralColor = 0xF0F8FF --Color of enemy circle on opposite side.
- --TURRETS
- GetIds()
- --MENU
- TJukeConfig = scriptConfig("Merry-Go-Round 1.0", "TJ")
- TJukeConfig:addParam("JukeT", "Juking (toggle)", SCRIPT_PARAM_ONKEYDOWN, false, toggleHK)
- TJukeConfig:addParam("JukeS", "Juking (switch)", SCRIPT_PARAM_ONKEYTOGGLE, false, switchHK)
- TJukeConfig:addParam("DrawCircle", "Draw circles", SCRIPT_PARAM_ONOFF, true)
- TJukeConfig:permaShow("JukeT")
- TJukeConfig:permaShow("JukeS")
- end
- function getClosestTurretXZ()
- x = myHero.x
- z = myHero.z
- for i,Turret in pairs(Turret) do
- if TurretDistance > math.round(math.sqrt((x - Turret.x)^2 + (z - Turret.z)^2)) then
- return Turret.x, Turret.z
- end
- end
- return nil --If nothing is there
- end
- function moveToPredicted(x,y,z)
- myHero:MoveTo(x,z)
- end
- function getPredictionPosition(x,y,z)
- x1,z1 = getClosestTurretXZ()
- gradient = (z - z1)/( x - x1)
- if x1 > x then
- return ((math.cos(math.atan(gradient))) * rangeAroundTurret) + x1,y,((math.sin(math.atan(gradient))) * rangeAroundTurret) + z1
- else
- return -((math.cos(math.atan(gradient))) * rangeAroundTurret) + x1,y,-((math.sin(math.atan(gradient))) * rangeAroundTurret) + z1
- end
- end
- function getPositionOfEnemyOnTurret(x,y,z)
- x1,z1 = getClosestTurretXZ()
- gradient = (z - z1)/( x - x1)
- if x1 > x then
- return -((math.cos(math.atan(gradient))) * rangeAroundTurret) + x1,y,-((math.sin(math.atan(gradient))) * rangeAroundTurret) + z1
- else
- return ((math.cos(math.atan(gradient))) * rangeAroundTurret) + x1,y,((math.sin(math.atan(gradient))) * rangeAroundTurret) + z1
- end
- end
- function OnDraw()
- --If turret is in range
- if getClosestTurretXZ() ~= nil then
- xTurret,zTurret = getClosestTurretXZ()
- DrawCircle(xTurret, myHero.y, zTurret, TurretDistance, SafeColor) --Change color to something you want. (safecolor)
- for j = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(j)
- if TJukeConfig.DrawCircle and ValidTarget(enemyhero) and myHero:GetDistance(enemyhero) <= rangeFromEnemy then
- --Enemy Position
- x,y,z = getPositionOfEnemyOnTurret(enemyhero.x,enemyhero.y,enemyhero.z)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 +1 , NeutralColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 , NeutralColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 -1 , NeutralColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 -2 , NeutralColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 -3 , NeutralColor)
- --Predicted Position
- x,y,z = getPredictionPosition(enemyhero.x,enemyhero.y,enemyhero.z)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 +1 , SafeColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 , SafeColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 -1 , SafeColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 -2 , SafeColor)
- DrawCircle(x,y,z, TargetCircleRadius*0.5 -3 , SafeColor)
- end
- if ValidTarget(enemyhero) and myHero:GetDistance(enemyhero) <= rangeFromEnemy then
- --ACTION
- if TJukeConfig.JukeT or TJukeConfig.JukeS then
- moveToPredicted(getPredictionPosition(enemyhero.x,enemyhero.y,enemyhero.z))
- end
- end
- end
- end
- SC__OnDraw()
- end
- function OnWndMsg(msg,key)
- SC__OnWndMsg(msg,key)
- end
- function GetIds()
- if myHero.team == TEAM_BLUE then
- --Bottom side
- Turret = {
- {name = "Turret_T1_L_03_A", x = 574.65502929688, y = 26.813898086548, z = 10220.470703125},
- {name = "Turret_T1_C_05_A", x = 5439.4682617188, y = 44.099128723145, z = 6175.7666015625},
- {name = "Turret_T1_R_03_A", x = 10097.618164063, y = 41.339515686035, z = 808.73291015625},
- {name = "Turret_T1_L_02_A", x = 1106.2634277344, y = 42.06392288208, z = 6478.5864257813},
- {name = "Turret_T1_C_04_A", x = 4641.4418945313, y = 43.518402099609, z = 4591.9091796875},
- {name = "Turret_T1_R_02_A", x = 6512.52734375, y = 43.320083618164, z = 1262.6145019531},
- {name = "Turret_T1_C_06_A", x = 802.81036376953, y = 96.739608764648, z = 4052.3605957031},
- {name = "Turret_T1_C_03_A", x = 3233.994140625, y = 96.034530639648, z = 3447.2421875},
- {name = "Turret_T1_C_07_A", x = 3747.2548828125, y = 96.264854431152, z = 1041.0439453125},
- {name = "Turret_T1_C_01_A", x = 1341.6325683594, y = 98.230155944824, z = 2029.984375},
- {name = "Turret_T1_C_02_A", x = 1768.1916503906, y = 96.472526550293, z = 1589.4655761719},
- }
- else
- --Top side
- Turret = {
- {name = "Turret_T2_L_03_A", x = 3911.6752929688, y = 13.130361557007, z = 13654.815429688},
- {name = "Turret_T2_C_05_A", x = 8548.8046875, y = 44.313140869141, z = 8289.49609375},
- {name = "Turret_T2_R_03_A", x = 13459.614257813, y = 40.973766326904, z = 4284.2392578125},
- {name = "Turret_T2_L_02_A", x = 7536.5234375, y = 39.184650421143, z = 13190.815429688},
- {name = "Turret_T2_C_04_A", x = 9361.072265625, y = 41.252155303955, z = 9892.6240234375},
- {name = "Turret_T2_R_02_A", x = 12920.7890625, y = 37.775768280029, z = 8005.2919921875},
- {name = "Turret_T2_L_01_A", x = 10261.900390625, y = 95.404235839844, z = 13465.911132813},
- {name = "Turret_T2_C_03_A", x = 10743.580078125, y = 96.524940490723, z = 11010.0625},
- {name = "Turret_T2_R_01_A", x = 13205.825195313, y = 95.759963989258, z = 10474.619140625},
- {name = "Turret_T2_C_02_A", x = 12118.146484375, y = 93.899185180664, z = 12876.62890625},
- {name = "Turret_T2_C_01_A", x = 12662.48828125, y = 93.969276428223, z = 12442.701171875},
- }
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement