Advertisement
encoree1996

Untitled

Mar 30th, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 91.68 KB | None | 0 0
  1. --[[
  2. Sida's Auto Reborn
  3. ]]
  4.  
  5. local AutoCarryGlobal = {}
  6. AutoCarryGlobal.Data = {}
  7. _G.AutoCarry = AutoCarryGlobal.Data
  8.  
  9. local DoneInit = false
  10. function OnTick()
  11.  
  12. if not DoneInit then
  13. if not Init() then
  14. return
  15. end
  16. end
  17.  
  18. if Keys.LastHit then
  19. Minions:LastHit()
  20. end
  21.  
  22. if Keys.AutoCarry then
  23. Items:UseAll(Crosshair.Attack_Crosshair.target)
  24. Skills:CastAll(Crosshair:GetTarget())
  25. Orbwalker:Orbwalk(Crosshair.Attack_Crosshair.target)
  26. end
  27.  
  28. if Keys.LaneClear then
  29. Skills:CastAll(Crosshair:GetTarget())
  30. if LaneClearMenu.MinionPriority and Orbwalker:CanOrbwalkTarget(Minions.KillableMinion) then
  31. Orbwalker:Orbwalk(Minions.KillableMinion)
  32. elseif Orbwalker:CanOrbwalkTarget(Crosshair.Attack_Crosshair.target) then
  33. Items:UseAll(Crosshair.Attack_Crosshair.target)
  34. Orbwalker:Orbwalk(Crosshair.Attack_Crosshair.target)
  35. elseif Orbwalker:CanOrbwalkTarget(Jungle:GetAttackableMonster()) then
  36. Orbwalker:Orbwalk(Jungle:GetAttackableMonster())
  37. else
  38. Minions:LaneClear()
  39. end
  40. end
  41.  
  42. if Keys.MixedMode then
  43. Skills:CastAll(Crosshair:GetTarget())
  44. if MixedModeMenu.MinionPriority and Orbwalker:CanOrbwalkTarget(Minions.KillableMinion) then
  45. Orbwalker:Orbwalk(Minions.KillableMinion)
  46. elseif Orbwalker:CanOrbwalkTarget(Crosshair.Attack_Crosshair.target) then
  47. Items:UseAll(Crosshair.Attack_Crosshair.target)
  48. Orbwalker:Orbwalk(Crosshair.Attack_Crosshair.target)
  49. else
  50. Minions:LastHit()
  51. end
  52. end
  53. end
  54.  
  55. AdvancedCallback:bind('OnLoseVision', function(unit) end)
  56. AdvancedCallback:bind('OnGainVision', function(unit) end)
  57. AdvancedCallback:bind('OnDash', function(unit) end)
  58. AdvancedCallback:bind('OnGainBuff', function(unit, buff) end)
  59. AdvancedCallback:bind('OnLoseBuff', function(unit, buff) end)
  60. AdvancedCallback:bind('OnUpdateBuff', function(unit, buff) end)
  61.  
  62.  
  63. MODE_AUTOCARRY = 0
  64. MODE_MIXEDMODE = 1
  65. MODE_LASTHIT = 2
  66. MODE_LANECLEAR = 3
  67. AutoCarry.MODE_AUTOCARRY = 0
  68. AutoCarry.MODE_MIXEDMODE = 1
  69. AutoCarry.MODE_LASTHIT = 2
  70. AutoCarry.MODE_LANECLEAR = 3
  71.  
  72. --[[
  73. Orbwalker Class
  74. ]]
  75. class '_Orbwalker' Orbwalker = nil
  76.  
  77. STAGE_SHOOT = 0
  78. STAGE_MOVE = 1
  79. STAGE_SHOOTING = 2
  80. RegisteredOnAttacked = {}
  81.  
  82. function _Orbwalker:__init()
  83. self.LastAttack = 0
  84. self.LastWindUp = 0
  85. self.AttackCooldown = 0
  86. self.AttackCompletesAt = 0
  87. self.AttackBufferMin = 50
  88. self.AttackBufferMax = 400
  89. self.AfterAttackTime = 0
  90. self.FleeingEnemyRangeBuffer = 0
  91. self.Stage = 0
  92. self.LastEnemyAttacked = nil
  93. Orbwalker = self
  94.  
  95. AddTickCallback(function() self:_OnTick() end)
  96. AddProcessSpellCallback(function(Unit, Spell) self:_OnProcessSpell(Unit, Spell) end)
  97. AddAnimationCallback(function(Unit, Animation) self:_OnAnimation(Unit, Animation) end)
  98. end
  99.  
  100. local lastTick = 0
  101. function _Orbwalker:_OnTick()
  102. --self.Boost = ConfigMenu.Boost - (myHero.attackSpeed * 15) - (Helper.Latency * 0.5)
  103. --self.AttackBoost = ConfigMenu.AttackBoost
  104. lastTick = GetTickCount()
  105. if Helper.Tick + Helper.Latency / 2 > self.LastAttack + self.AttackCooldown then
  106. self.Stage = STAGE_SHOOT
  107. elseif Helper.Tick + Helper.Latency / 2 > self.LastAttack + self.LastWindUp + self.AttackBufferMin + (Data.ChampionData[myHero.charName] and Data.ChampionData[myHero.charName].BugDelay or 0) then
  108. self.Stage = STAGE_MOVE
  109. end
  110.  
  111. if self.Stage == STAGE_MOVE and Helper.Tick + Helper.Latency < self.LastAttack + self.LastWindUp + self.AttackBufferMax then
  112. self.AfterAttackTime = self.LastAttack + self.LastWindUp + self.AttackBufferMax
  113. Orbwalker:_OnAttacked()
  114. end
  115. end
  116.  
  117. function _Orbwalker:_OnProcessSpell(Unit, Spell)
  118. if Unit.isMe then
  119. if Data:IsAttack(Spell) then
  120. self.LastAttack = Helper.Tick
  121. self.LastWindUp = Spell.windUpTime * 1000
  122. self.AttackCooldown = Spell.animationTime * 1000
  123. self.AttackCompletesAt = self.LastAttack + self.LastWindUp
  124. self.LastAttackSpeed = myHero.attackSpeed
  125. self.Stage = STAGE_SHOOTING
  126. self.SlowChecked = false
  127. elseif Data:IsResetSpell(Spell) then
  128. self:ResetAttackTimer()
  129. end
  130. elseif Spell.target and Spell.name == "SummonerExhaust" and Spell.target.isMe then
  131. self.AttackCooldown = self.AttackCooldown * 1.5
  132. elseif Spell.target and Spell.name == "Wither" and Spell.target.isMe then
  133. self.AttackCooldown = self.AttackCooldown * 1.35
  134. end
  135. end
  136.  
  137. function _Orbwalker:_OnAttacked()
  138. for _, func in pairs(RegisteredOnAttacked) do
  139. func()
  140. end
  141. end
  142.  
  143. function _Orbwalker:_OnAnimation(Unit, Animation)
  144. if Helper.Tick < Orbwalker.AttackCompletesAt and Unit.isMe and (Animation == "Run" or Animation == "Idle") then
  145. Orbwalker:ResetAttackTimer()
  146. end
  147. end
  148.  
  149. function _Orbwalker:Orbwalk(target)
  150. if target and self.Stage == STAGE_SHOOT and self:CanOrbwalkTarget(target) then
  151. MyHero:Attack(target)
  152. elseif self.Stage ~= STAGE_SHOOTING then
  153. MyHero:Move()
  154. end
  155. end
  156.  
  157. function _Orbwalker:OrbwalkIgnoreChecks(target)
  158. if target and self.Stage == STAGE_SHOOT then
  159. MyHero:Attack(target)
  160. elseif self.Stage == STAGE_MOVE then
  161. MyHero:Move()
  162. end
  163. end
  164.  
  165. function _Orbwalker:ResetAttackTimer()
  166. self.LastAttack = Helper.Tick - Helper.Latency / 2 - self.AttackCooldown
  167. end
  168.  
  169. function _Orbwalker:GetNextAttackTime()
  170. return self.LastAttack + self.AttackCooldown - Helper.Latency / 2
  171. end
  172.  
  173. function _Orbwalker:IsAfterAttack()
  174. if self then
  175. return Helper.Tick + Helper.Latency / 2 < self.AfterAttackTime
  176. end
  177. end
  178.  
  179. function _Orbwalker:CanOrbwalkTarget(Target)
  180. if ValidTarget(Target) then
  181. if Target.type == myHero.type then
  182. local predPos = AutoCarry.GetPrediction({range=MyHero.TrueRange, speed=math.huge, delay=Orbwalker.LastWindUp}, Target)
  183. if predPos and GetDistance(predPos) - Data:GetGameplayCollisionRadius(Target.charName) + self.FleeingEnemyRangeBuffer > MyHero.TrueRange then
  184. return false
  185. end
  186. end
  187. local CheckRange
  188. if MyHero.IsMelee and Target.type ~= myHero.type then
  189. CheckRange = MyHero.TrueRange + 75
  190. else
  191. CheckRange = MyHero.TrueRange
  192. end
  193. return GetDistance(Target) - Data:GetGameplayCollisionRadius(Target.charName) < CheckRange
  194. end
  195. return false
  196. end
  197.  
  198. function _Orbwalker:IsShooting()
  199. return self.Stage == STAGE_SHOOTING
  200. end
  201.  
  202. function RegisterOnAttacked(func)
  203. table.insert(RegisteredOnAttacked, func)
  204. end
  205.  
  206. --[[
  207. _MyHero Class
  208. ]]
  209.  
  210. class '_MyHero' MyHero = nil
  211.  
  212. function _MyHero:__init()
  213. self.Range = myHero.range
  214. self.HitBox = GetDistance(myHero.minBBox)
  215. self.GameplayCollisionRadius = Data:GetGameplayCollisionRadius(myHero.charName)
  216. self.TrueRange = self.Range + self.GameplayCollisionRadius
  217. self.IsMelee = myHero.range < 300
  218. self.MoveDistance = 480
  219. self.LastHitDamageBuffer = -10 --TODO
  220. self.ChampionAdditionalLastHitDamage = 0
  221. self.ItemAdditionalLastHitDamage = 0
  222. self.MasteryAdditionalLastHitDamage = 0
  223. self.Team = myHero.team == 100 and "Blue" or "Red"
  224. self.ProjectileSpeed = Data:GetProjectileSpeed(myHero.charName)
  225. self.LastMoved = 0
  226. self.MoveDelay = 50
  227. self.CanMove = true
  228. self.CanAttack = true
  229. self.InStandZone = false
  230. self.HasStopped = false
  231. MyHero = self
  232.  
  233. AddTickCallback(function() self:_OnTick() end)
  234. end
  235.  
  236. function _MyHero:_OnTick()
  237. if myHero.range ~= self.Range then
  238. if myHero.range and myHero.range > 0 and myHero.range < 1500 then
  239. self.Range = myHero.range
  240. self.TrueRange = self.Range + self.GameplayCollisionRadius - 10
  241. self.IsMelee = myHero.range < 300
  242. end
  243. end
  244. if GetDistance(mousePos) < ExtrasMenu["StandZone"..myHero.charName] then
  245. self.InStandZone = true
  246. else
  247. self.InStandZone = false
  248. end
  249. self:CheckStopMovement()
  250. end
  251.  
  252. function _MyHero:GetTimeToHitTarget(Target)
  253. local AttackTime = (GetDistance(Target) / self.ProjectileSpeed) + (Helper.Latency / 2)
  254. local NextAttack = Helper.Tick
  255. return AttackTime + NextAttack
  256. end
  257.  
  258. function _MyHero:GetTotalAttackDamageAgainstTarget(Target, LastHit)
  259. local MyDamage = myHero:CalcDamage(Target, myHero.totalDamage)
  260. if LastHit then
  261. MyDamage = MyDamage + self.ChampionAdditionalLastHitDamage -- TODO
  262. MyDamage = MyDamage + self.ItemAdditionalLastHitDamage
  263. MyDamage = MyDamage + self:GetMasteryAdditionalLastHitDamage(MyDamage, Target)
  264. MyDamage = MyDamage + self.LastHitDamageBuffer
  265. end
  266. return MyDamage
  267. end
  268.  
  269. function _MyHero:GetMasteryAdditionalLastHitDamage(Damage, Target)
  270. local _Damage = Damage
  271. _Damage = _Damage + Items:GetBotrkBonusLastHitDamage(_Damage, Target)
  272. _Damage = ConfigMenu.Spellblade and _Damage + (myHero.ap * 0.05) or _Damage
  273. _Damage = (ConfigMenu.Executioner and Target.health / Target.maxHealth < 0.5) and _Damage + (_Damage * 0.05) or _Damage
  274. _Damage = _Damage + (ConfigMenu.Butcher * 2)
  275. return _Damage - Damage - 1
  276. end
  277.  
  278. function _MyHero:Move()
  279. if self:HeroCanMove() and not Helper:IsEvading() then
  280. if Helper.Tick > self.LastMoved + self.MoveDelay then
  281. Streaming:OnMove()
  282. local Distance = self.MoveDistance + Helper.Latency / 10
  283. if self.IsMelee and Crosshair.Target and Crosshair.Target.type == myHero.type and GetDistance(Crosshair.Target) < 80 then
  284. return
  285. elseif GetDistance(mousePos) < Distance and GetDistance(mousePos) > 100 then
  286. Distance = GetDistance(mousePos)
  287. end
  288.  
  289. local MoveSqr = math.sqrt((mousePos.x - myHero.x) ^ 2 + (mousePos.z - myHero.z) ^ 2)
  290. local MoveX = myHero.x + Distance * ((mousePos.x - myHero.x) / MoveSqr)
  291. local MoveZ = myHero.z + Distance * ((mousePos.z - myHero.z) / MoveSqr)
  292.  
  293. myHero:MoveTo(MoveX, MoveZ)
  294. self.LastMoved = Helper.Tick
  295. self.HasStopped = false
  296. end
  297. end
  298. end
  299.  
  300. function _MyHero:Attack(target)
  301. if self.CanAttack and not Helper:IsEvading() then
  302. if target.type ~= myHero.type then
  303. MuramanaOff()
  304. end
  305.  
  306. for _, func in pairs(Plugins.RegisteredPreAttack) do
  307. func(target)
  308. end
  309.  
  310. myHero:Attack(target)
  311. Orbwalker.LastEnemyAttacked = target
  312. end
  313. end
  314.  
  315. function _MyHero:MovementEnabled(canMove)
  316. self.CanMove = canMove
  317. end
  318.  
  319. function _MyHero:AttacksEnabled(canAttack)
  320. self.CanAttack = canAttack
  321. end
  322.  
  323. function _MyHero:HeroCanMove()
  324. return not self.InStandZone and self.CanMove
  325. end
  326.  
  327. function _MyHero:CheckStopMovement()
  328. if not MyHero:HeroCanMove() and not self.HasStopped then
  329. myHero:HoldPosition()
  330. self.HasStopped = true
  331. end
  332. end
  333.  
  334. --[[
  335. _Crosshair Class
  336. ]]
  337.  
  338. class '_Crosshair' Crosshair = nil
  339.  
  340. --[[
  341. Initialise _Crosshair class
  342.  
  343. damageType DAMAGE_PHYSICAL or DAMAGE_MAGIC
  344. attackRange Integer
  345. skillRange Integer
  346. targetFocused Boolean. Whether targets selected with left click should be focused.
  347. isCaster Boolean. Whether spells should be prioritised over auto attacks.
  348. ]]
  349.  
  350. function _Crosshair:__init(damageType, attackRange, skillRange, targetFocused, isCaster)
  351. self.DamageType = damageType and damageType or DAMAGE_PHYSICAL
  352. self.AttackRange = attackRange
  353. self.SkillRange = skillRange
  354. self.TargetFocused = targetFocused
  355. self.IsCaster = isCaster
  356. self.Target = nil
  357. self.TargetMinion = nil
  358. self.Attack_Crosshair = TargetSelector(TARGET_LOW_HP_PRIORITY, attackRange, DAMAGE_PHYSICAL, self.TargetFocused)
  359. self.Skills_Crosshair = TargetSelector(TARGET_LOW_HP_PRIORITY, skillRange, self.DamageType, self.TargetFocused)
  360. self.Attack_Crosshair:SetBBoxMode(true)
  361. self.Attack_Crosshair:SetDamages(0, myHero.totalDamage, 0)
  362. self:ArrangePriorities()
  363. self.RangeScaling = true
  364. Crosshair = self
  365.  
  366. self:UpdateCrosshairRange()
  367. self:LoadTargetSelector()
  368.  
  369. AddTickCallback(function() self:_OnTick() end)
  370. AddUnloadCallback(function() self:_OnUnload() end)
  371. end
  372.  
  373. function _Crosshair:_OnTick()
  374. self.Attack_Crosshair:update()
  375. if self.Attack_Crosshair.range ~= MyHero.TrueRange then
  376. self.Attack_Crosshair.range = MyHero.TrueRange
  377. end
  378. if self.Attack_Crosshair.target then
  379. self.Target = self.Attack_Crosshair.target
  380. else
  381. self.Skills_Crosshair:update()
  382. self.Target = self.Skills_Crosshair.target
  383. end
  384. if ConfigMenu.Focused ~= self.TargetFocused then
  385. self.TargetFocused = ConfigMenu.Focused
  386. self.Attack_Crosshair.targetSelected = self.TargetFocused
  387. self.Skills_Crosshair.targetSelected = self.targetFocused
  388. end
  389. self.TargetMinion = Minions.Target
  390. end
  391.  
  392. function _Crosshair:_OnUnload()
  393. self:SaveTargetSelector()
  394. end
  395.  
  396. function _Crosshair:GetTarget()
  397. if ValidTarget(self.Attack_Crosshair.target) and not self.IsCaster then
  398. return self.Attack_Crosshair.target
  399. elseif ValidTarget(self.Skills_Crosshair.target) then
  400. return self.Skills_Crosshair.target
  401. end
  402. end
  403.  
  404. function _Crosshair:HasOrbwalkTarget()
  405. return self and self.Target and self.Attack_Crosshair.Target and self.Target == self.Attack_Crosshair.target
  406. end
  407.  
  408. function _Crosshair:ArrangePriorities()
  409. if #GetEnemyHeroes() < 5 then return end
  410. for _, Champion in pairs(Data.ChampionData) do
  411. TS_SetHeroPriority(Champion.Priority, Champion.Name)
  412. end
  413. end
  414.  
  415. function _Crosshair:SetSkillCrosshairRange(Range)
  416. self.RangeScaling = false
  417. self.Skills_Crosshair.range = Range
  418. end
  419.  
  420. function _Crosshair:UpdateCrosshairRange()
  421. for _, Skill in pairs(Skills.SkillsList) do
  422. if Skill:GetRange() > self.Skills_Crosshair.range then
  423. self.Skills_Crosshair.range = Skill:GetRange()
  424. end
  425. end
  426. end
  427.  
  428. function _Crosshair:SaveTargetSelector()
  429. local save = GetSave("SidasAutoCarry")
  430. save.TargetSelectorMode = Crosshair.Attack_Crosshair.mode
  431. save:Save()
  432. end
  433.  
  434. function _Crosshair:LoadTargetSelector()
  435. local save = GetSave("SidasAutoCarry")
  436. if save.TargetSelectorMode then
  437. Crosshair.Attack_Crosshair.mode = save.TargetSelectorMode
  438. Crosshair.Skills_Crosshair.mode = save.TargetSelectorMode
  439. end
  440. end
  441.  
  442. --[[
  443. _Minions Class
  444. ]]
  445.  
  446. class '_Minions' Minions = nil
  447.  
  448. function _Minions:__init()
  449. self.ScanRange = 3000
  450. self.MinionHealthBuffer = 1.5
  451. self.EnemyMinions = minionManager(MINION_ENEMY, MyHero.TrueRange + 65, myHero, MINION_SORT_HEALTH_ASC)
  452. self.AllyMinions = minionManager(MINION_ALLY, self.ScanRange, myHero, MINION_SORT_HEALTH_ASC)
  453. self.IncomingDamage = {}
  454. Minions = self
  455.  
  456. AddTickCallback(function() self:_OnTick() end)
  457. AddProcessSpellCallback(function(Unit, Spell)self:_OnProcessSpell(Unit, Spell) end)
  458. end
  459.  
  460. function _Minions:_OnTick()
  461. self.EnemyMinions:update()
  462. self.AllyMinions:update()
  463.  
  464. if not Orbwalker:CanOrbwalkTarget(self.KillableMinion) then
  465. local _Menu = MenuManager:GetActiveMenu()
  466. if _Menu and ConfigMenu.Freeze and (_Menu.name ~= "sidasaclaneclear") then
  467. Killable, AlmostKillable = self:GetKillableMinionFreeze()
  468. else
  469. Killable, AlmostKillable = self:GetKillableMinion()
  470. end
  471.  
  472. if Orbwalker:CanOrbwalkTarget(Killable) then
  473. self.KillableMinion = Killable
  474. elseif Orbwalker:CanOrbwalkTarget(AlmostKillable) then
  475. self.AlmostKillable = AlmostKillable
  476. else
  477. self.KillableMinion = nil
  478. self.AlmostKillable = nil
  479. end
  480. end
  481. end
  482.  
  483. function _Minions:_OnProcessSpell(Unit, Spell)
  484. if Unit and Spell.target and Unit.team == myHero.team and (Data.MinionData[Unit.charName] or Data.MinionData[Unit.type]) and GetDistance(Unit) <= self.ScanRange then
  485. self.IncomingDamage[Unit.networkID] = _Attack(Unit, Spell)
  486. end
  487. end
  488.  
  489. function _Minions:LaneClear()
  490. if Orbwalker:CanOrbwalkTarget(self.KillableMinion) then
  491. Orbwalker:Orbwalk(self.KillableMinion)
  492. elseif self.AlmostKillable then
  493. MyHero:Move()
  494. elseif Structures:CanOrbwalkStructure() then
  495. Orbwalker:OrbwalkIgnoreChecks(Structures:GetTargetStructure())
  496. else
  497. Orbwalker:Orbwalk(self:GetSecondLowestHealthMinion())
  498. end
  499. end
  500.  
  501. function _Minions:LastHit()
  502. Orbwalker:Orbwalk(self.KillableMinion)
  503. end
  504.  
  505. function _Minions:GetPredictedDamage(Attack)
  506. if not ValidTarget(Attack.Source, self.ScanRange, false) or not ValidTarget(Attack.Target) or Helper.Tick > Attack.LandsAt then
  507. self.IncomingDamage[Attack.Source.networkID] = nil
  508. return 0, 0
  509. elseif GetDistance(Attack.Source, Attack.Origin) > 3 then
  510. return 0, 0
  511. else
  512. local TimeToHit = 0
  513. if MyHero.IsMelee then
  514. TimeToHit = Orbwalker.LastWindUp
  515. else
  516. TimeToHit = MyHero:GetTimeToHitTarget(Attack.Target)
  517. end
  518. if TimeToHit > Attack.LandsAt then
  519. return Attack.Damage, Attack.Damage
  520. else
  521. return 0, Attack.Damage
  522. end
  523. end
  524. end
  525.  
  526. function _Minions:GetKillableMinion(Freeze)
  527. for _, EnemyMinion in ipairs(self.EnemyMinions.objects) do
  528. local Damage, TotalDamage, MyDamage = 0, 0, 0
  529.  
  530. if Freeze then
  531. MyDamage = MyHero:GetTotalAttackDamageAgainstTarget(EnemyMinion, true)
  532. MyDamage = MyDamage < 50 and MyDamage or 50
  533. else
  534. MyDamage = MyHero:GetTotalAttackDamageAgainstTarget(EnemyMinion, true)
  535. end
  536.  
  537. if Orbwalker:CanOrbwalkTarget(EnemyMinion) or (MyHero.IsMelee and GetDistance(EnemyMinion) < MyHero.TrueRange + 75) then
  538. if EnemyMinion.health < MyDamage then
  539. return EnemyMinion, nil
  540. else
  541. for _, Attack in pairs(self.IncomingDamage) do
  542. if Attack.Target.networkID == EnemyMinion.networkID then
  543. local _Damage, _TotalDamage = self:GetPredictedDamage(Attack)
  544. Damage = Damage + _Damage
  545. TotalDamage = TotalDamage + _TotalDamage
  546. end
  547. end
  548.  
  549. if EnemyMinion.health - Damage + self.MinionHealthBuffer < MyDamage then
  550. return EnemyMinion, nil
  551. end
  552. if not Freeze then
  553. for _, func in pairs(Plugins.RegisteredBonusLastHitDamage) do
  554. if EnemyMinion.health - Damage + self.MinionHealthBuffer < MyDamage + func(EnemyMinion) then
  555. return EnemyMinion, nil
  556. end
  557. end
  558. end
  559. if EnemyMinion.health - TotalDamage < MyDamage then
  560. return nil, EnemyMinion
  561. end
  562. end
  563. end
  564. end
  565. end
  566.  
  567. function _Minions:GetKillableMinionFreeze()
  568. return self:GetKillableMinion(true)
  569. end
  570.  
  571. function _Minions:GetLowestHealthMinion()
  572. for i =1, #self.EnemyMinions.objects, 1 do
  573. local Minion = self.EnemyMinions.objects[i]
  574. if Orbwalker:CanOrbwalkTarget(Minion) then
  575. return Minion
  576. end
  577. end
  578. end
  579.  
  580. function _Minions:GetSecondLowestHealthMinion()
  581. local found = nil
  582. for i =1, #self.EnemyMinions.objects, 1 do
  583. local Minion = self.EnemyMinions.objects[i]
  584. if Orbwalker:CanOrbwalkTarget(Minion) and found then
  585. return Minion
  586. elseif Orbwalker:CanOrbwalkTarget(Minion) then
  587. found = Minion
  588. end
  589. end
  590. return found
  591. end
  592.  
  593. --[[
  594. _Attack Class
  595. ]]
  596.  
  597. class '_Attack'
  598.  
  599. function _Attack:__init(Source, Spell)
  600. self.Source = Source
  601. self.Target = Spell.target
  602. self.Damage = Source:CalcDamage(self.Target)
  603. self.Started = Helper.Tick
  604. self.Delay = Spell.windUpTime * 1000
  605. self.Speed = Data.MinionData[Source.charName] and Data.MinionData[Source.charName].ProjectileSpeed or Data.MinionData[Source.type].ProjectileSpeed
  606. self.LandsAt = ((self.Speed == 0 and self.Delay or self.Delay + GetDistance(Source, self.Target) / self.Speed) + Helper.Tick)
  607. self.FiresAt = Helper.Tick + self.Delay
  608. self.Origin = {x = Source.x, z = Source.z}
  609. self.IsTowerShot = false
  610. end
  611.  
  612. --[[
  613. _Jungle Class
  614. ]]
  615.  
  616. class '_Jungle' Jungle = nil
  617.  
  618. function _Jungle:__init()
  619. self.JungleMonsters = {}
  620. Jungle = self
  621. for i = 0, objManager.maxObjects do
  622. local object = objManager:getObject(i)
  623. if Data:IsJungleMinion(object) then
  624. table.insert(self.JungleMonsters, object)
  625. end
  626. end
  627.  
  628. AddCreateObjCallback(function(Object) self:_OnCreateObj(Object) end)
  629. AddDeleteObjCallback(function(Object) self:_OnDeleteObj(Object) end)
  630. end
  631.  
  632. function _Jungle:_OnCreateObj(Object)
  633. if Data:IsJungleMinion(Object) then
  634. table.insert(self.JungleMonsters, Object)
  635. end
  636. end
  637.  
  638. function _Jungle:_OnDeleteObj(Object)
  639. if Data:IsJungleMinion(Object) then
  640. for i, Obj in pairs(self.JungleMonsters) do
  641. if obj == Object then
  642. table.remove(self.JungleMonsters, i)
  643. end
  644. end
  645. end
  646. end
  647.  
  648. function _Jungle:GetJungleMonsters()
  649. return self.JungleMonsters
  650. end
  651.  
  652. function _Jungle:GetAttackableMonster()
  653. local HighestPriorityMonster = nil
  654. local Priority = 0
  655. for _, Monster in pairs(self.JungleMonsters) do
  656. if Orbwalker:CanOrbwalkTarget(Monster) then
  657. local CurrentPriority = Data:GetJunglePriority(Monster.name)
  658. if Monster.health < MyHero:GetTotalAttackDamageAgainstTarget(Monster) then
  659. return Monster
  660. elseif not HighestPriorityMonster then
  661. HighestPriorityMonster = Monster
  662. Priority = CurrentPriority
  663. else
  664. if CurrentPriority < Priority then
  665. HighestPriorityMonster = Monster
  666. Priority = CurrentPriority
  667. end
  668. end
  669. end
  670. end
  671. return HighestPriorityMonster
  672. end
  673.  
  674. class '_Structures' Structures = nil
  675.  
  676. function _Structures:__init()
  677. Structures = self
  678. self.TowerCollisionRange = 88.4
  679. self.InhibCollisionRange = 205
  680. self.NexusCollisionRange = 300
  681. end
  682.  
  683. function _Structures:TowerTargetted()
  684. return GetTarget() and GetTarget().type == "obj_AI_Turret" and GetTarget().team ~= myHero.team
  685. end
  686.  
  687. function _Structures:InhibTargetted()
  688. return GetTarget() and GetTarget().type == "obj_BarracksDampener" and GetTarget().team ~= myHero.team
  689. end
  690.  
  691. function _Structures:NexusTargetted()
  692. return GetTarget() and GetTarget().type == "obj_HQ" and GetTarget().team ~= myHero.team
  693. end
  694.  
  695. function _Structures:CanOrbwalkStructure()
  696. return self:CanOrbwalkTower() or self:CanOrbwalkInhib() or self:CanOrbwalkNexus()
  697. end
  698.  
  699. function _Structures:GetTargetStructure()
  700. return GetTarget()
  701. end
  702.  
  703. function _Structures:CanOrbwalkTower()
  704. return self:TowerTargetted() and GetDistance(GetTarget()) - self.TowerCollisionRange < MyHero.TrueRange
  705. end
  706.  
  707. function _Structures:CanOrbwalkInhib()
  708. return self:InhibTargetted() and GetDistance(GetTarget()) - self.InhibCollisionRange < MyHero.TrueRange
  709. end
  710.  
  711. function _Structures:CanOrbwalkNexus()
  712. return self:NexusTargetted() and GetDistance(GetTarget()) - self.NexusCollisionRange < MyHero.TrueRange
  713. end
  714.  
  715. --[[
  716. _Skills Class
  717. ]]
  718.  
  719. class '_Skills' Skills = nil
  720.  
  721. function _Skills:__init()
  722. self.SkillsList = {}
  723. Skills = self
  724. if VIP_USER then require "Collision" end
  725. AddTickCallback(function() self:_OnTick() end)
  726. end
  727.  
  728. function _Skills:_OnTick()
  729. for _, Skill in pairs(self.SkillsList) do
  730. if Keys.AutoCarry and AutoCarryMenu[Skill.RawName.."AutoCarry"] or
  731. Keys.MixedMode and MixedModeMenu[Skill.RawName.."MixedMode"] or
  732. Keys.LaneClear and LaneClearMenu[Skill.RawName.."LaneClear"] then
  733. Skill.Active = true
  734. else
  735. Skill.Active = false
  736. end
  737. end
  738. self:SortSkillOrder()
  739. end
  740.  
  741. function _Skills:CastAll(Target)
  742. for _, Skill in ipairs(self.SkillsList) do
  743. if Skill.Enabled then
  744. Skill:Cast(Target)
  745. end
  746. end
  747. end
  748.  
  749. function _Skills:GetSkill(Key)
  750. for _, Skill in pairs(self.SkillsList) do
  751. if Skill.Key == Key then
  752. return Skill
  753. end
  754. end
  755. end
  756.  
  757. function _Skills:GetSkillMenu(Key)
  758. if MenuManager.SkillMenu[Key] then
  759. return MenuManager.SkillMenu[Key]
  760. else
  761. return {CastPrio = 0}
  762. end
  763. end
  764.  
  765. function _Skills:SortSkillOrder()
  766. table.sort(self.SkillsList, function(a, b) return self:GetSkillMenu(a.Key).CastPrio < self:GetSkillMenu(b.Key).CastPrio end)
  767. end
  768.  
  769. function _Skills:HasSkillReady()
  770. for _, Skill in pairs(self.SkillsList) do
  771. if Skill.Ready then
  772. return true
  773. end
  774. end
  775. end
  776.  
  777. function _Skills:NewSkill(enabled, key, range, displayName, type, minMana, afterAttack, reqAttackTarget, speed, delay, width, collision)
  778. return _Skill(enabled, key, range, displayName, type, minMana, afterAttack, reqAttackTarget, speed, delay, width, collision, true)
  779. end
  780.  
  781. function _Skills:DisableAll()
  782. for _, Skill in pairs(self.SkillsList) do
  783. Skill.Enabled = false
  784. end
  785. end
  786.  
  787. --[[
  788. _Skill Class
  789. ]]
  790.  
  791. class '_Skill'
  792.  
  793. SPELL_TARGETED = 1
  794. SPELL_LINEAR = 2
  795. SPELL_CIRCLE = 3
  796. SPELL_CONE = 4
  797. SPELL_LINEAR_COL = 5
  798. SPELL_SELF = 6
  799. SPELL_SELF_AT_MOUSE = 7
  800. AutoCarry.SPELL_TARGETED = 1
  801. AutoCarry.SPELL_LINEAR = 2
  802. AutoCarry.SPELL_CIRCLE = 3
  803. AutoCarry.SPELL_CONE = 4
  804. AutoCarry.SPELL_LINEAR_COL = 5
  805. AutoCarry.SPELL_SELF = 6
  806. AutoCarry.SPELL_SELF_AT_MOUSE = 7
  807.  
  808. -- --[[
  809. -- Initialise _Skill class
  810.  
  811. -- enabled Boolean - set true for auto carry to automatically cast it, false for manual control in plugin
  812. -- key Spell key, e.g _Q
  813. -- range Spell range
  814. -- displayName The name to display in menus
  815. -- type SPELL_TARGETED, SPELL_LINEAR, SPELL_CIRCLE, SPELL_CONE, SPELL_LINEAR_COL, SPELL_SELF, SPELL_SELF_AT_MOUSE
  816. -- minMana Minimum percentage mana before cast is allowed
  817. -- afterAttack Boolean - set true to only cast right after an auto attack
  818. -- reqAttackTarget Boolean - set true to only cast if a target is in attack range
  819. -- speed Speed of the projectile for skillshots
  820. -- delay Delay of the spell for skillshots
  821. -- width Width of the projectile for skillshots
  822. -- collision Boolean - set true to check minion collision before casting
  823.  
  824. -- ]]
  825. function _Skill:__init(enabled, key, range, displayName, type, minMana, afterAttack, reqAttackTarget, speed, delay, width, collision, custom)
  826. self.Key = key
  827. self.Range = range
  828. self.DisplayName = displayName
  829. self.RawName = self.DisplayName:gsub("[^A-Za-z0-9]", "")
  830. self.Type = type
  831. self.MinMana = minMana or 0
  832. self.AfterAttack = afterAttack or false
  833. self.ReqAttackTarget = reqAttackTarget or false
  834. self.Speed = speed or 0
  835. self.Delay = delay or 0
  836. self.Width = width or 0
  837. self.Collision = collision
  838. self.IsCustom = custom
  839. self.Active = true
  840. self.Enabled = enabled or false
  841. self.Ready = false
  842. if VIP_USER then
  843. self.KloPredCallback = function(unit, pos, castSpell)
  844. if GetDistanceSqr(pos, castSpell.Source) < castSpell.RangeSqr and myHero:CanUseSpell(castSpell.Name) == READY and myHero:GetSpellData(castSpell.Name).mana < myHero.mana then
  845. if (self.Collision and not self:GetCollision(pos)) or not self.Collision then
  846. CastSpell(castSpell.Name, pos.x, pos.z)
  847. end
  848. end
  849. end
  850.  
  851. self.KloPred = ProdictManager.GetInstance():AddProdictionObject(self.Key, self.Range, self.Speed * 1000, self.Delay / 1000, self.Width, myHero, self.KloPredCallback)
  852. end
  853.  
  854. AddTickCallback(function() self:_OnTick() end)
  855.  
  856. table.insert(Skills.SkillsList, self)
  857. end
  858.  
  859. function _Skill:_OnTick()
  860. if self.Enabled then
  861. if Skills:GetSkillMenu(self.Key).ManualCast and Crosshair:GetTarget() then
  862. self:ForceCast(Crosshair:GetTarget())
  863. end
  864. end
  865. self.Ready = myHero:CanUseSpell(self.Key) == READY
  866. if self.Enabled and not self.IsCustom then
  867. self.reqAttackTarget = Skills:GetSkillMenu(self.Key).RequiresTarget
  868. end
  869. end
  870.  
  871. function _Skill:Cast(Target, ForceCast)
  872. if not ForceCast then
  873. if (not self.Active and self.Enabled) or (not self.Enabled and not self.IsCustom) then
  874. return
  875. elseif self.AfterAttack and not Orbwalker:IsAfterAttack() then
  876. return
  877. elseif not self:ValidSkillTarget(Target) then
  878. return
  879. elseif (self.ReqAttackTarget and not Orbwalker:CanOrbwalkTarget(Target)) then
  880. return
  881. end
  882. end
  883. if not self:IsReady() then
  884. return
  885. end
  886.  
  887.  
  888. if self.Type == SPELL_SELF then
  889. CastSpell(self.Key)
  890. elseif self.Type == SPELL_SELF_AT_MOUSE then
  891. CastSpell(self.Key, mousePos.x, mousePos.z)
  892. elseif self.Type == SPELL_TARGETED then
  893. if ValidTarget(Target, self.Range) then
  894. CastSpell(self.Key, Target)
  895. end
  896. elseif self.Type == SPELL_CONE then
  897. if ValidTarget(Target, self.Range) then
  898. if not VIP_USER then
  899. local predPos = self:GetPrediction(Target)
  900. if predPos then
  901. CastSpell(self.Key, predPos.x, predPos.z)
  902. end
  903. else
  904. self.KloPred:EnableTarget(Target, true)
  905. end
  906. end
  907. elseif self.Type == SPELL_LINEAR or self.Type == SPELL_CIRCLE then
  908. if ValidTarget(Target) then
  909. if not VIP_USER then
  910. local predPos = self:GetPrediction(Target)
  911. if predPos then
  912. CastSpell(self.Key, predPos.x, predPos.z)
  913. end
  914. else
  915. self.KloPred:EnableTarget(Target, true)
  916. end
  917. end
  918. elseif self.Type == SPELL_LINEAR_COL then
  919. if ValidTarget(Target) then
  920.  
  921. if self.Collision then
  922. if not VIP_USER then
  923. local predPos = self:GetPrediction(Target)
  924. if predPos then
  925. local collision = self:GetCollision(predPos)
  926. if not collision or ForceCast then
  927. CastSpell(self.Key, predPos.x, predPos.z)
  928. end
  929. end
  930. else
  931. self.KloPred:EnableTarget(Target, true)
  932. end
  933. end
  934. end
  935. end
  936. end
  937.  
  938. function _Skill:ForceCast(Target)
  939. self:Cast(Target, true)
  940. end
  941.  
  942. function _Skill:GetPrediction(Target)
  943. if VIP_USER then
  944. pred = TargetPredictionVIP(self.Range, self.Speed*1000, self.Delay/1000, self.Width)
  945. if pred and pred:GetHitChance(Target) > ConfigMenu.HitChance/100 then
  946. return pred:GetPrediction(Target)
  947. end
  948. elseif not VIP_USER then
  949. pred = TargetPrediction(self.Range, self.Speed, self.Delay, self.Width)
  950. return pred:GetPrediction(Target)
  951. end
  952. end
  953.  
  954. function _Skill:GetCollision(pos)
  955. if VIP_USER and self.Collision then
  956. local col = Collision(self.Range, self.Speed*1000, self.Delay/1000, self.Width)
  957. return col:GetMinionCollision(myHero, pos)
  958. elseif self.Collision then
  959. for _, Minion in pairs(Minions.EnemyMinions.objects) do
  960. if ValidTarget(Minion) and myHero.x ~= Minion.x then
  961. local myX = myHero.x
  962. local myZ = myHero.z
  963. local tarX = pos.x
  964. local tarZ = pos.z
  965. local deltaX = myX - tarX
  966. local deltaZ = myZ - tarZ
  967. local m = deltaZ/deltaX
  968. local c = myX - m*myX
  969. local minionX = Minion.x
  970. local minionZ = Minion.z
  971. local distanc = (math.abs(minionZ - m*minionX - c))/(math.sqrt(m*m+1))
  972. if distanc < self.Width and ((tarX - myX)*(tarX - myX) + (tarZ - myZ)*(tarZ - myZ)) > ((tarX - minionX)*(tarX - minionX) + (tarZ - minionZ)*(tarZ - minionZ)) then
  973. return true
  974. end
  975. end
  976. end
  977. return false
  978. end
  979. end
  980.  
  981. function _Skill:GetHitChance(pred)
  982. if VIP_USER then
  983. return pred:GetHitChance(target) > ConfigMenu.HitChance/100
  984. end
  985. end
  986.  
  987. function _Skill:ValidSkillTarget(Target)
  988. if not self.IsCustom then
  989. local _Menu = Skills:GetSkillMenu(self.Key)
  990. if not Target or myHero.mana / myHero.maxMana * 100 < _Menu.MinMana or Target.health / Target.maxHealth * 100 < _Menu.MinHealth or Target.health / Target.maxHealth * 100 > _Menu.MaxHealth then
  991. return false
  992. end
  993. return true
  994. end
  995. return true
  996. end
  997.  
  998. function _Skill:GetRange()
  999. return self.reqAttackTarget and MyHero.TrueRange or self.Range
  1000. end
  1001.  
  1002. function _Skill:IsReady()
  1003. return myHero:CanUseSpell(self.Key) == READY
  1004. end
  1005.  
  1006. --[[
  1007. _Items Class
  1008. ]]
  1009.  
  1010. class '_Items' Items = nil
  1011.  
  1012. function _Items:__init()
  1013. self.ItemList = {}
  1014. Items = self
  1015.  
  1016. AddTickCallback(function() self:_OnTick() end)
  1017. end
  1018.  
  1019. function _Items:_OnTick()
  1020. for _, Item in pairs(self.ItemList) do
  1021. if Keys.AutoCarry and AutoCarryMenu[Item.RawName.."AutoCarry"] or
  1022. Keys.MixedMode and MixedModeMenu[Item.RawName.."MixedMode"] or
  1023. Keys.LaneClear and LaneClearMenu[Item.RawName.."LaneClear"] then
  1024. Item.Active = true
  1025. else
  1026. Item.Active = false
  1027. end
  1028. end
  1029. end
  1030.  
  1031. function _Items:UseAll(Target)
  1032. if Target and Target.type == myHero.type then
  1033. for _, Item in pairs(self.ItemList) do
  1034. Item:Use(Target)
  1035. end
  1036. end
  1037. end
  1038.  
  1039. function _Items:UseItem(ID, Target)
  1040. for _, Item in pairs(self.ItemList) do
  1041. if Item.ID == ID then
  1042. Item:Use(Target)
  1043. end
  1044. end
  1045. end
  1046.  
  1047. function _Items:GetItem(ID)
  1048. for _, Item in pairs(self.ItemList) do
  1049. if Item.ID == ID then
  1050. return Item
  1051. end
  1052. end
  1053. end
  1054.  
  1055. function _Items:GetBotrkBonusLastHitDamage(StartingDamage, Target)
  1056. local _BonusDamage = 0
  1057. if GetInventoryHaveItem(3153) then
  1058. if ValidTarget(Target) then
  1059. _BonusDamage = Target.health / 20
  1060. if _BonusDamage >= 60 then
  1061. _BonusDamage = 60
  1062. end
  1063. end
  1064. end
  1065. return _BonusDamage
  1066. end
  1067.  
  1068. --[[
  1069. _Item Class
  1070. ]]
  1071.  
  1072. class '_Item'
  1073.  
  1074. --TODO: Add Muramana
  1075. function _Item:__init(_Name, _ID, _RequiresTarget, _Range, _Override)
  1076. self.Name = _Name
  1077. self.RawName = self.Name:gsub("[^A-Za-z0-9]", "")
  1078. self.ID = _ID
  1079. self.RequiresTarget = _RequiresTarget
  1080. self.Range = _Range
  1081. self.Slot = nil
  1082. self.Override = _Override
  1083. self.Active = true
  1084. self.Enabled = true
  1085.  
  1086. table.insert(Items.ItemList, self)
  1087. end
  1088.  
  1089. function _Item:Use(Target)
  1090. if self.Override then
  1091. return self.Override()
  1092. end
  1093. if self.RequiresTarget and not Target then
  1094. return
  1095. end
  1096. if not self.Active or not self.Enabled then
  1097. return
  1098. end
  1099.  
  1100. self.Slot = GetInventorySlotItem(self.ID)
  1101.  
  1102. if self.Slot then
  1103. if self.ID == 3153 then -- BRK
  1104. local _Menu = MenuManager:GetActiveMenu()
  1105. if _Menu and _Menu.botrkSave then
  1106. if myHero.health <= myHero.maxHealth * 0.65 then
  1107. CastSpell(self.Slot, Target)
  1108. end
  1109. else
  1110. CastSpell(self.Slot, Target)
  1111. end
  1112. elseif self.ID == 3042 then -- Muramana
  1113. if not MuramanaIsActive() then
  1114. MuramanaOn()
  1115. end
  1116. elseif not self.RequiresTarget and Orbwalker:CanOrbwalkTarget(Target) then
  1117. CastSpell(self.Slot)
  1118. elseif self.RequiresTarget and ValidTarget(Target) and GetDistance(Target) <= self.Range then
  1119. CastSpell(self.Slot, Target)
  1120. end
  1121. end
  1122. end
  1123.  
  1124. --[[
  1125. _Helper Class
  1126. ]]
  1127.  
  1128. class '_Helper' Helper = nil
  1129.  
  1130. function _Helper:__init()
  1131. self.Tick = 0
  1132. self.Latency = 0
  1133. self.Colour = {Green = 0x00FF00}
  1134. self.EnemyTable = {}
  1135. Helper = self
  1136. self.EnemyTable = GetEnemyHeroes()
  1137. AddTickCallback(function() self:_OnTick() end)
  1138. end
  1139.  
  1140. function _Helper:_OnTick()
  1141. self.Tick = GetTickCount()
  1142. self.Latency = GetLatency()
  1143. end
  1144.  
  1145. function _Helper:StringContains(string, contains)
  1146. return string:lower():find(contains)
  1147. end
  1148.  
  1149. function _Helper:DrawCircleObject(Object, Range, Colour, Thickness)
  1150. Thickness = Thickness and Thickness or 0
  1151. for i = 0, Thickness do
  1152. if DrawingMenu.LowFPS then
  1153. self:DrawCircle2(Object.x, Object.y, Object.z, Range + i, Colour)
  1154. else
  1155. DrawCircle(Object.x, Object.y, Object.z, Range + i, Colour)
  1156. end
  1157. end
  1158. end
  1159.  
  1160. -- Low fps circles by barasia, vadash and viseversa
  1161. function _Helper:DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
  1162. radius = radius or 300
  1163. quality = math.max(8,self:round(180/math.deg((math.asin((chordlength/(2*radius)))))))
  1164. quality = 2 * math.pi / quality
  1165. radius = radius*.92
  1166. local points = {}
  1167. for theta = 0, 2 * math.pi + quality, quality do
  1168. local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
  1169. points[#points + 1] = D3DXVECTOR2(c.x, c.y)
  1170. end
  1171. DrawLines2(points, width or 1, color or 4294967295)
  1172. end
  1173.  
  1174. function _Helper:round(num)
  1175. if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end
  1176. end
  1177.  
  1178. function _Helper:DrawCircle2(x, y, z, radius, color)
  1179. local vPos1 = Vector(x, y, z)
  1180. local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
  1181. local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
  1182. local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
  1183. if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y }) then
  1184. self:DrawCircleNextLvl(x, y, z, radius, 1, color, 75)
  1185. end
  1186. end
  1187.  
  1188. function _Helper:GetHitBoxDistance(Target)
  1189. return GetDistance(Target) - GetDistance(Target, Target.minBBox)
  1190. end
  1191.  
  1192. function _Helper:TrimString(s)
  1193. return s:find'^%s*$' and '' or s:match'^%s*(.*%S)'
  1194. end
  1195.  
  1196. function _Helper:GetClasses()
  1197. return AutoCarry.Skills, AutoCarry.Keys, AutoCarry.Items, AutoCarry.Data, AutoCarry.Jungle, AutoCarry.Helper, AutoCarry.MyHero, AutoCarry.Minions, AutoCarry.Crosshair, AutoCarry.Orbwalker
  1198. end
  1199.  
  1200. function _Helper:ArgbFromMenu(menu)
  1201. return ARGB(menu[1], menu[2], menu[3], menu[4])
  1202. end
  1203.  
  1204. function _Helper:DecToHex(Dec)
  1205. local B, K, Hex, I, D = 16, "0123456789ABCDEF", "", 0
  1206. while Dec > 0 do
  1207. I = I + 1
  1208. Dec, D = math.floor(Dec / B), math.fmod(Dec, B) + 1
  1209. Hex = string.sub(K, D, D)..Hex
  1210. end
  1211. return Hex
  1212. end
  1213.  
  1214. function _Helper:HexFromMenu(menu)
  1215. local argb = {}
  1216. argb["a"] = menu[1]
  1217. argb["r"] = menu[2]
  1218. argb["g"] = menu[3]
  1219. argb["b"] = menu[4]
  1220. return tonumber(self:DecToHex(argb["a"]) .. self:DecToHex(argb["r"]) .. self:DecToHex(argb["g"]) .. self:DecToHex(argb["b"]), 16);
  1221. end
  1222.  
  1223. function _Helper:IsEvading()
  1224. return _G.evade
  1225. end
  1226.  
  1227. --[[
  1228. Keys Class
  1229. ]]
  1230.  
  1231. class '_Keys' Keys = nil
  1232.  
  1233. function _Keys:__init()
  1234. self.KEYS_KEY = 0
  1235. self.KEYS_MENUKEY = 1
  1236. self.AutoCarry = false
  1237. self.MixedMode = false
  1238. self.LastHit = false
  1239. self.LaneClear = false
  1240. self.AutoCarryKeys = {}
  1241. self.MixedModeKeys = {}
  1242. self.LastHitKeys = {}
  1243. self.LaneClearKeys = {}
  1244. Keys = self
  1245.  
  1246. AddTickCallback(function() self:_OnTick() end)
  1247. end
  1248.  
  1249. function _Keys:_OnTick()
  1250. self.AutoCarry = self:IsKeyEnabled(self.AutoCarryKeys)
  1251. self.MixedMode = self:IsKeyEnabled(self.MixedModeKeys)
  1252. self.LastHit = self:IsKeyEnabled(self.LastHitKeys)
  1253. self.LaneClear = self:IsKeyEnabled(self.LaneClearKeys)
  1254. end
  1255.  
  1256. function _Keys:IsKeyEnabled(List)
  1257. for _, Key in pairs(List) do
  1258. if Key.Type == self.KEYS_KEY then
  1259. if IsKeyDown(Key.Key) then
  1260. return true
  1261. end
  1262. elseif Key.Type == self.KEYS_MENUKEY then
  1263. if Key.Menu[Key.Param] then
  1264. return true
  1265. end
  1266. end
  1267. end
  1268. return false
  1269. end
  1270.  
  1271. function _Keys:RegisterMenuKey(Menu, Param, Mode)
  1272. local MenuKey = _MenuKey(Menu, Param)
  1273. self:Insert(MenuKey, Mode)
  1274. end
  1275.  
  1276. function _Keys:RegisterKey(key, Mode)
  1277. local Key = _Key(key)
  1278. self:Insert(Key, Mode)
  1279. end
  1280.  
  1281. function _Keys:Insert(Key, Mode)
  1282. if Mode == MODE_AUTOCARRY then
  1283. table.insert(self.AutoCarryKeys, Key)
  1284. elseif Mode == MODE_MIXEDMODE then
  1285. table.insert(self.MixedModeKeys, Key)
  1286. elseif Mode == MODE_LASTHIT then
  1287. table.insert(self.LastHitKeys, Key)
  1288. elseif Mode == MODE_LANECLEAR then
  1289. table.insert(self.LaneClearKeys, Key)
  1290. end
  1291. end
  1292.  
  1293. --[[
  1294. Key Class
  1295. ]]
  1296.  
  1297. class '_Key'
  1298.  
  1299. function _Key:__init(key)
  1300. self.Key = key
  1301. self.Type = Keys.KEYS_KEY
  1302. end
  1303.  
  1304. --[[
  1305. MenuKey Class
  1306. ]]
  1307.  
  1308. class '_MenuKey'
  1309.  
  1310. function _MenuKey:__init(menu, param)
  1311. self.Menu = menu
  1312. self.Param = param
  1313. self.Type = Keys.KEYS_MENUKEY
  1314. end
  1315.  
  1316. --[[
  1317. _SwingTimer Class
  1318. ]]
  1319.  
  1320. class '_SwingTimer' SwingTimer = nil
  1321.  
  1322. function _SwingTimer:__init()
  1323. self.bar_green = GetSprite("SidasAutoCarry\\bar_green.dds")
  1324. self.bar_red = GetSprite("SidasAutoCarry\\bar_red.dds")
  1325. self.Width = 300
  1326. self.X = WINDOW_W/2 - (self.Width/2)
  1327. self.Y = WINDOW_H/2
  1328. self.Height = self.bar_green.height
  1329. self.ResizeButtonWidth = 30
  1330. self.Moving = false
  1331. self.Resizing = false
  1332. self.Save = GetSave("SidasAutoCarry").SwingTimer
  1333. SwingTimer = self
  1334.  
  1335. if self.Save then
  1336. self.X = self.Save.X
  1337. self.Y = self.Save.Y
  1338. self.Width = self.Save.Width
  1339. end
  1340. AddMsgCallback(function(Msg, Key) self:_OnWndMsg(Msg, Key) end)
  1341. AddDrawCallback(function() self:_OnDraw() end)
  1342. AddTickCallback(function() self:_OnTick() end)
  1343. end
  1344.  
  1345. function _SwingTimer:_OnDraw()
  1346. if not ExtrasMenu.ShowSwingTimer then return end
  1347. local Difference = (Helper.Tick - Orbwalker.LastAttack) / (Orbwalker:GetNextAttackTime() - Orbwalker.LastAttack)
  1348. if Difference > 1 or Difference < 0 then
  1349. self:_DrawBar(self.X, self.Y, self.Width, 1)
  1350. else
  1351. self:_DrawBar(self.X, self.Y, self.Width, Difference)
  1352. end
  1353. if IsKeyDown(16) then
  1354. DrawRectangleOutline(self.X + self.Width + 5, self.Y, self.ResizeButtonWidth, self.Height, ARGB(0xFF,0xFF,0xFF,0xFF), 3)
  1355. end
  1356. end
  1357.  
  1358. function _SwingTimer:_OnWndMsg(Msg, Key)
  1359. if Msg == WM_LBUTTONDOWN and IsKeyDown(16) then
  1360. if CursorIsUnder(self.X, self.Y, self.Width, self.Height) then
  1361. self.Moving = true
  1362. elseif CursorIsUnder(self.X + self.Width + 5, self.Y, self.ResizeButtonWidth, self.Height) then
  1363. self.Resizing = true
  1364. end
  1365. elseif Msg == WM_LBUTTONUP and (self.Moving or self.Resizing) then
  1366. self.Moving = false
  1367. self.Resizing = false
  1368. GetSave("SidasAutoCarry").SwingTimer = {X = self.X, Y = self.Y, Height = self.Height, Width = self.Width}
  1369. end
  1370. end
  1371.  
  1372. function _SwingTimer:_OnTick()
  1373. if self.Moving then
  1374. self.X = GetCursorPos().x - self.Width / 2
  1375. self.Y = GetCursorPos().y
  1376. elseif self.Resizing then
  1377. self.Width = GetCursorPos().x - self.X - self.ResizeButtonWidth / 2
  1378. end
  1379. end
  1380.  
  1381. function _SwingTimer:_DrawBar(x, y, barLen, percentage)
  1382. DrawRectangleOutline(x-1, y-1, barLen+3, self.Height+2, ARGB(0x00,0xFF,0xFF,0xFF), 1)
  1383. self.bar_green:DrawEx(Rect(0, 0, barLen*percentage, self.Height), D3DXVECTOR3(0,0,0), D3DXVECTOR3(x,y,0), 0xFF)
  1384. self.bar_red:DrawEx(Rect(barLen*percentage, 0, barLen, self.Height), D3DXVECTOR3(0,0,0), D3DXVECTOR3(x+barLen*percentage,y,0), 0xFF)
  1385. DrawTextA(math.floor(percentage*100).."%", 12, x+(barLen/2), y-1, ARGB(255,255,255,255), "center")
  1386. end
  1387.  
  1388. --[[
  1389. _Streaming Class
  1390. ]]
  1391.  
  1392. class '_Streaming'
  1393.  
  1394. function _Streaming:__init()
  1395. self.Save = GetSave("SidasAutoCarry")
  1396.  
  1397. AddTickCallback(function()self:_OnTick() end)
  1398. AddMsgCallback(function(msg, key)self:_OnWndMsg(msg, key) end)
  1399.  
  1400. if self.Save.StreamingMode then
  1401. self:EnableStreaming()
  1402. else
  1403. self:DisableStreaming()
  1404. end
  1405. end
  1406.  
  1407. function _Streaming:_OnTick()
  1408. if self.StreamingMenu then
  1409. self.StreamingMenu._param[4].text = self.StreamingMenu.Colour == 0 and "Green" or "Red"
  1410. end
  1411. if self.StreamEnabled then
  1412. self:EnableStreaming()
  1413. end
  1414. end
  1415.  
  1416. function _Streaming:_OnWndMsg(msg, key)
  1417. if msg == KEY_DOWN and key == 118 then
  1418. if not self.StreamEnabled then
  1419. self:EnableStreaming()
  1420. else
  1421. self:DisableStreaming()
  1422. end
  1423. end
  1424. end
  1425.  
  1426. function _Streaming:EnableStreaming()
  1427. self.Save.StreamingMode = true
  1428. self.StreamEnabled = true
  1429. if not self.ChatTimeout then
  1430. self.ChatTimeout = GetTickCount() + 3000
  1431. elseif GetTickCount() < self.ChatTimeout then
  1432. self:DisableOverlay()
  1433. for i = 0, 15 do
  1434. PrintChat("")
  1435. end
  1436. else
  1437. _G.PrintChat = function() end
  1438. end
  1439. end
  1440.  
  1441. function _Streaming:DisableStreaming()
  1442. self.Save.StreamingMode = false
  1443. self.StreamEnabled = false
  1444. if self.ChatTimeout then
  1445. EnableOverlay()
  1446. self.ChatTimeout = nil
  1447. end
  1448. end
  1449.  
  1450. function _Streaming:OnMove()
  1451. if not self.MenuCreated then return end
  1452. if self.StreamingMenu.MinRand > self.StreamingMenu.MaxRand then
  1453. print("Reborn: Min cannot be higher than Max in Streaming Menu")
  1454. elseif self.StreamingMenu.ShowClick and (not self.NextClick or Helper.Tick > self.NextClick) then
  1455. if self.StreamingMenu.Colour == 0 then
  1456. ShowGreenClick(mousePos)
  1457. else
  1458. ShowRedClick(mousePos)
  1459. end
  1460. self.nextClick = Helper.Tick + math.random(self.StreamingMenu.MinRand, self.StreamingMenu.MaxRand)
  1461. end
  1462. end
  1463.  
  1464. function _Streaming:CreateMenu()
  1465. self.StreamingMenu = scriptConfig("Sida's Auto Carry: Streaming", "sidasacstreaming")
  1466. self.StreamingMenu:addParam("ShowClick", "Show Fake Click Marker", SCRIPT_PARAM_ONOFF, false)
  1467. self.StreamingMenu:addParam("MinRand", "Minimum Time Between Clicks", SCRIPT_PARAM_SLICE, 150, 0, 1000, 0)
  1468. self.StreamingMenu:addParam("MaxRand", "Maximum Time Between Clicks", SCRIPT_PARAM_SLICE, 650, 0, 1000, 0)
  1469. self.StreamingMenu:addParam("Colour", "Green", SCRIPT_PARAM_SLICE, 0, 0, 1, 0)
  1470. self.StreamingMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1471. self.StreamingMenu:addParam("sep", "Toggle Streaming Mode with F7", SCRIPT_PARAM_INFO, "")
  1472. self.MenuCreated = true
  1473. end
  1474.  
  1475. function _Streaming:DisableOverlay()
  1476. _G.DrawText,
  1477. _G.PrintFloatText,
  1478. _G.DrawLine,
  1479. _G.DrawArrow,
  1480. _G.DrawCircle,
  1481. _G.DrawRectangle,
  1482. _G.DrawLines,
  1483. _G.DrawLines2 = function() end,
  1484. function() end,
  1485. function() end,
  1486. function() end,
  1487. function() end,
  1488. function() end,
  1489. function() end
  1490. end
  1491.  
  1492. Streaming = _Streaming()
  1493.  
  1494. --[[
  1495. _MenuManager Class
  1496. ]]
  1497.  
  1498. --[[
  1499. _Summoner Class
  1500. ]]
  1501.  
  1502. class '_Summoner'
  1503.  
  1504. function _Summoner:__init()
  1505.  
  1506. end
  1507.  
  1508. class '_MenuManager' MenuManager = nil
  1509.  
  1510. function _MenuManager:__init()
  1511. self.AutoCarry = false
  1512. self.MixedMode = false
  1513. self.LastHit = false
  1514. self.LaneClear = false
  1515. self.SkillMenu = {}
  1516.  
  1517. AddTickCallback(function() self:OnTick() end)
  1518. AddMsgCallback(function(msg, key) self:OnWndMsg(msg, key) end)
  1519. AddUnloadCallback(function() self:_OnUnload() end)
  1520. AddBugsplatCallback(function() self:_OnBugsplat() end)
  1521. AddExitCallback(function() self:_OnExit() end)
  1522. MenuManager = self
  1523.  
  1524. --[[ Auto Carry Menu ]]
  1525.  
  1526. AutoCarryMenu = scriptConfig("Sida's Auto Carry: Auto Carry", "sidasacautocarry")
  1527. AutoCarryMenu:addParam("title", " Sida's Auto Carry: Reborn", SCRIPT_PARAM_INFO, "")
  1528. AutoCarryMenu:addParam("sep", "-- Settings--", SCRIPT_PARAM_INFO, "")
  1529. AutoCarryMenu:addParam("Toggle", "Toggle mode (requires reload)", SCRIPT_PARAM_ONOFF, false)
  1530. AutoCarryMenu:addParam("Active", "Auto Carry", AutoCarryMenu.Toggle and SCRIPT_PARAM_ONKEYTOGGLE or SCRIPT_PARAM_ONKEYDOWN, false, 219)
  1531. AutoCarryMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1532. AutoCarryMenu:addParam("sep", "-- Skills --", SCRIPT_PARAM_INFO, "")
  1533. AutoCarryMenu:permaShow("title")
  1534. AutoCarryMenu:permaShow("Active")
  1535. AutoCarryMenu:addTS(Crosshair.Attack_Crosshair)
  1536. Keys:RegisterMenuKey(AutoCarryMenu, "Active", MODE_AUTOCARRY)
  1537.  
  1538. if #Skills.SkillsList > 0 then
  1539. for _, Skill in pairs(Skills.SkillsList) do
  1540. AutoCarryMenu:addParam(Skill.RawName.."AutoCarry", "Use "..Skill.DisplayName, SCRIPT_PARAM_ONOFF, self:LoadSkill(AutoCarryMenu, Skill.RawName, "AutoCarry"))
  1541. end
  1542. else
  1543. AutoCarryMenu:addParam("sep", "No supported skills for "..myHero.charName, SCRIPT_PARAM_INFO, "")
  1544. end
  1545.  
  1546. AutoCarryMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1547. AutoCarryMenu:addParam("sep", "-- Items --", SCRIPT_PARAM_INFO, "")
  1548. for _, Item in pairs(Items.ItemList) do
  1549. AutoCarryMenu:addParam(Item.RawName.."AutoCarry", "Use "..Item.Name, SCRIPT_PARAM_ONOFF, true)
  1550. end
  1551. AutoCarryMenu:addParam("botrkSave", "Save BotRK for max heal", SCRIPT_PARAM_ONOFF, true)
  1552.  
  1553.  
  1554. --[[ Last Hit Menu ]]
  1555.  
  1556. LastHitMenu = scriptConfig("Sida's Auto Carry: Last Hit", "sidasaclasthit")
  1557. LastHitMenu:addParam("sep", "-- Settings--", SCRIPT_PARAM_INFO, "")
  1558. LastHitMenu:addParam("Toggle", "Toggle mode (requires reload)", SCRIPT_PARAM_ONOFF, false)
  1559. LastHitMenu:addParam("Active", "Last Hit", LastHitMenu.Toggle and SCRIPT_PARAM_ONKEYTOGGLE or SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  1560. LastHitMenu:permaShow("Active")
  1561. Keys:RegisterMenuKey(LastHitMenu, "Active", MODE_LASTHIT)
  1562.  
  1563.  
  1564. --[[ Mixed Mode Menu ]]
  1565.  
  1566. MixedModeMenu = scriptConfig("Sida's Auto Carry: Mixed Mode", "sidasacmixedmode")
  1567. MixedModeMenu:addParam("sep", "-- Settings--", SCRIPT_PARAM_INFO, "")
  1568. MixedModeMenu:addParam("Toggle", "Toggle mode (requires reload)", SCRIPT_PARAM_ONOFF, false)
  1569. MixedModeMenu:addParam("Active", "Mixed Mode", MixedModeMenu.Toggle and SCRIPT_PARAM_ONKEYTOGGLE or SCRIPT_PARAM_ONKEYDOWN, false, string.byte("D"))
  1570. MixedModeMenu:addParam("MinionPriority", "Prioritise Last Hit Over Harass", SCRIPT_PARAM_ONOFF, true)
  1571. MixedModeMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1572. MixedModeMenu:addParam("sep", "-- Skills (Against Champions Only) --", SCRIPT_PARAM_INFO, "")
  1573. MixedModeMenu:permaShow("Active")
  1574. Keys:RegisterMenuKey(MixedModeMenu, "Active", MODE_MIXEDMODE)
  1575.  
  1576. if #Skills.SkillsList > 0 then
  1577. for _, Skill in pairs(Skills.SkillsList) do
  1578. MixedModeMenu:addParam(Skill.RawName.."MixedMode", "Use "..Skill.DisplayName, SCRIPT_PARAM_ONOFF, self:LoadSkill(MixedModeMenu, Skill.RawName, "MixedMode"))
  1579. end
  1580. else
  1581. MixedModeMenu:addParam("sep", "No supported skills for "..myHero.charName, SCRIPT_PARAM_INFO, "")
  1582. end
  1583.  
  1584. MixedModeMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1585. MixedModeMenu:addParam("sep", "-- Items (Against Champions Only) --", SCRIPT_PARAM_INFO, "")
  1586. for _, Item in pairs(Items.ItemList) do
  1587. MixedModeMenu:addParam(Item.RawName.."MixedMode", "Use "..Item.Name, SCRIPT_PARAM_ONOFF, true)
  1588. end
  1589. MixedModeMenu:addParam("botrkSave", "Save BotRK for max heal", SCRIPT_PARAM_ONOFF, true)
  1590.  
  1591.  
  1592. --[[ Lane Clear Menu ]]
  1593.  
  1594. LaneClearMenu = scriptConfig("Sida's Auto Carry: Lane Clear", "sidasaclaneclear")
  1595. LaneClearMenu:addParam("sep", "-- Settings--", SCRIPT_PARAM_INFO, "")
  1596. LaneClearMenu:addParam("Toggle", "Toggle mode (requires reload)", SCRIPT_PARAM_ONOFF, false)
  1597. LaneClearMenu:addParam("Active", "Lane Clear", LaneClearMenu.Toggle and SCRIPT_PARAM_ONKEYTOGGLE or SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
  1598. LaneClearMenu:addParam("MinionPriority", "Prioritise Last Hit Over Harass", SCRIPT_PARAM_ONOFF, true)
  1599. LaneClearMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1600. LaneClearMenu:addParam("sep", "-- Skills (Against Champions Only) --", SCRIPT_PARAM_INFO, "")
  1601. LaneClearMenu:permaShow("Active")
  1602. Keys:RegisterMenuKey(LaneClearMenu, "Active", MODE_LANECLEAR)
  1603.  
  1604. if #Skills.SkillsList > 0 then
  1605. for _, Skill in pairs(Skills.SkillsList) do
  1606. LaneClearMenu:addParam(Skill.RawName.."LaneClear", "Use "..Skill.DisplayName, SCRIPT_PARAM_ONOFF, self:LoadSkill(LaneClearMenu, Skill.RawName, "LaneClear"))
  1607. end
  1608. else
  1609. LaneClearMenu:addParam("sep", "No supported skills for "..myHero.charName, SCRIPT_PARAM_INFO, "")
  1610. end
  1611.  
  1612. LaneClearMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1613. LaneClearMenu:addParam("sep", "-- Items (Against Champions Only) --", SCRIPT_PARAM_INFO, "")
  1614. for _, Item in pairs(Items.ItemList) do
  1615. LaneClearMenu:addParam(Item.RawName.."LaneClear", "Use "..Item.Name, SCRIPT_PARAM_ONOFF, true)
  1616. end
  1617. LaneClearMenu:addParam("botrkSave", "Save BotRK for max heal", SCRIPT_PARAM_ONOFF, true)
  1618.  
  1619. --[[ Skills Menus ]]
  1620. for _, Skill in pairs(Skills.SkillsList) do
  1621. self.SkillMenu[Skill.Key] = scriptConfig("Sida's Auto Carry: Skill "..Skill.DisplayName, Skill.RawName)
  1622. self.SkillMenu[Skill.Key]:addParam("sep", "-- Against Champions --", SCRIPT_PARAM_INFO, "")
  1623. self.SkillMenu[Skill.Key]:addParam("CastPrio", "Cast Priority (0 Is Cast First)", SCRIPT_PARAM_SLICE, 0, 0, 3, 0)
  1624. self.SkillMenu[Skill.Key]:addParam("MinMana", "Mana Must Be Above %", SCRIPT_PARAM_SLICE, 0, 0, 100, 0)
  1625. self.SkillMenu[Skill.Key]:addParam("MinHealth", "Enemy Health Must Be Above %", SCRIPT_PARAM_SLICE, 0, 0, 100, 0)
  1626. self.SkillMenu[Skill.Key]:addParam("MaxHealth", "Enemy Health Must Be Below %", SCRIPT_PARAM_SLICE, 100, 0, 100, 0)
  1627. self.SkillMenu[Skill.Key]:addParam("RequiresTarget", "Target Must Be In Attack Range", SCRIPT_PARAM_ONOFF, Skill.ReqAttackTarget)
  1628. self.SkillMenu[Skill.Key]:addParam("ManualCast", "Manual Cast", SCRIPT_PARAM_ONKEYDOWN, false, 119)
  1629. -- self.SkillMenu[Skill.Key]:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1630. -- self.SkillMenu[Skill.Key]:addParam("sep", "-- Against Minions --", SCRIPT_PARAM_INFO, "")
  1631. -- self.SkillMenu[Skill.Key]:addParam("LastHit", "Last Hit With This Skill", SCRIPT_PARAM_ONOFF, false)
  1632. -- self.SkillMenu[Skill.Key]:addParam("MinManaMinions", "Minimum Mana %", SCRIPT_PARAM_SLICE, 0, 0, 100, 0)
  1633. end
  1634.  
  1635. --[[Configuration Menu ]]
  1636. ConfigMenu = scriptConfig("Sida's Auto Carry: Configuration", "sidasacconfig")
  1637. ConfigMenu:addParam("Focused", "Focus Selected Target", SCRIPT_PARAM_ONOFF, false)
  1638. ConfigMenu:addParam("Butcher", "Butcher Mastery", SCRIPT_PARAM_SLICE, 0, 0, 2, 0)
  1639. ConfigMenu:addParam("Spellblade", "Spellblade Mastery", SCRIPT_PARAM_ONOFF, true)
  1640. ConfigMenu:addParam("Executioner", "Executioner Mastery", SCRIPT_PARAM_ONOFF, true)
  1641. if VIP_USER then
  1642. ConfigMenu:addParam("HitChance", "Ability Hitchance", SCRIPT_PARAM_SLICE, 60, 0, 100, 0)
  1643. end
  1644. ConfigMenu:addParam("Freeze", "Lane Freeze Toggle", SCRIPT_PARAM_ONKEYTOGGLE, false, 112)
  1645.  
  1646. -- ConfigMenu:addParam("Boost", "Turbo Boost: Attack", SCRIPT_PARAM_SLICE, 0, 0, 1000, 0)
  1647. -- ConfigMenu:addParam("AttackBoost", "Turbo Boost: Movement", SCRIPT_PARAM_SLICE, 0, 0, 1000, 0)
  1648.  
  1649. --[[ Drawing Menu ]]
  1650. DrawingMenu = scriptConfig("Sida's Auto Carry: Drawing", "sidasacdrawing")
  1651. DrawingMenu:addParam("RangeCircle", "Champion Range Circle", SCRIPT_PARAM_ONOFF, true)
  1652. DrawingMenu:addParam("RangeCircleColour", "Colour", SCRIPT_PARAM_COLOR, {255, 0, 189, 22})
  1653. DrawingMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1654. DrawingMenu:addParam("CastRangeCircle", "Spell Range Circle", SCRIPT_PARAM_ONOFF, true)
  1655. DrawingMenu:addParam("CastRangeCircleColour", "Colour", SCRIPT_PARAM_COLOR, {183, 0, 26, 173})
  1656. DrawingMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1657. DrawingMenu:addParam("TargetCircle", "Circle Around Target", SCRIPT_PARAM_ONOFF, true)
  1658. DrawingMenu:addParam("TargetCircleColour", "Colour", SCRIPT_PARAM_COLOR, {255, 0, 112, 95})
  1659. DrawingMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1660. DrawingMenu:addParam("MinionCircle", "Minion Marker With Prediction", SCRIPT_PARAM_ONOFF, true)
  1661. DrawingMenu:addParam("MinionCircleColour", "Colour", SCRIPT_PARAM_COLOR, {183, 0, 26, 173})
  1662. DrawingMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1663. DrawingMenu:addParam("ArrowToTarget", "Line To Target", SCRIPT_PARAM_ONOFF, true)
  1664. DrawingMenu:addParam("ArrowToTargetColour", "Colour", SCRIPT_PARAM_COLOR, {100, 255, 100, 100})
  1665. DrawingMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1666. DrawingMenu:addParam("StandZone", "Stand & Shoot Range", SCRIPT_PARAM_ONOFF, true)
  1667. DrawingMenu:addParam("StandZoneColour", "Stand Zone Colour", SCRIPT_PARAM_COLOR, {183, 0, 26, 173})
  1668. DrawingMenu:addParam("sep", "", SCRIPT_PARAM_INFO, "")
  1669. DrawingMenu:addParam("LowFPS", "Use Low FPS Circles", SCRIPT_PARAM_ONOFF, false)
  1670.  
  1671. --[[ Extras Menu ]]
  1672. ExtrasMenu = scriptConfig("Sida's Auto Carry: Extras", "sidasacextras")
  1673. ExtrasMenu:addParam("sep", "-- May Cause FPS Drops--", SCRIPT_PARAM_INFO, "")
  1674. ExtrasMenu:addParam("ShowSwingTimer", "Show Swing Timer", SCRIPT_PARAM_ONOFF, true)
  1675. ExtrasMenu:addParam("StandZone"..myHero.charName, "Stand Still And Shoot Range", SCRIPT_PARAM_SLICE, self:LoadStandRange(), 0, MyHero.TrueRange, 0)
  1676.  
  1677. self:DisableAllModes()
  1678. -- self.Boost = ConfigMenu.Boost
  1679. -- self.AttackBoost = ConfigMenu.AttackBoost
  1680. end
  1681.  
  1682. function _MenuManager:OnTick()
  1683. -- if self.Boost ~= ConfigMenu.Boost then
  1684. -- print("Hyper Charge: Attack - When you start cancelling attacks, you've gone too high!")
  1685. -- self.Boost = ConfigMenu.Boost
  1686. -- end
  1687.  
  1688. -- if self.AttackBoost ~= ConfigMenu.AttackBoost then
  1689. -- print("Hyper Charge: Movement - When you stand still before each attack, you've gone too high!")
  1690. -- self.AttackBoost = ConfigMenu.AttackBoost
  1691. -- end
  1692.  
  1693. if AutoCarryMenu.Active ~= self.AutoCarry and not self.AutoCarry then
  1694. self:SetToggles(true, false, false, false)
  1695. elseif MixedModeMenu.Active ~= self.MixedMode and not self.MixedMode then
  1696. self:SetToggles(false, true, false, false)
  1697. elseif LastHitMenu.Active ~= self.LastHit and not self.LastHit then
  1698. self:SetToggles(false, false, true, false)
  1699. elseif LaneClearMenu.Active ~= self.LaneClear and not self.LaneClear then
  1700. self:SetToggles(false, false, false, true)
  1701. end
  1702.  
  1703. if ConfigMenu.Freeze then
  1704. MixedModeMenu._param[3].text = "Mixed Mode (Lane Freeze)"
  1705. LastHitMenu._param[3].text = "Last Hit (Lane Freeze)"
  1706. else
  1707. MixedModeMenu._param[3].text = "Mixed Mode"
  1708. LastHitMenu._param[3].text = "Last Hit"
  1709. end
  1710. end
  1711.  
  1712. function _MenuManager:OnWndMsg(msg, key)
  1713. if msg == WM_RBUTTONDOWN then
  1714. local _Menu = self:GetActiveMenu()
  1715. if _Menu and _Menu.Toggle then
  1716. self:DisableAllModes()
  1717. end
  1718. end
  1719. end
  1720.  
  1721. function _MenuManager:_OnUnload()
  1722. self:SaveSkills()
  1723. self:SaveStandRange()
  1724. end
  1725.  
  1726. function _MenuManager:_OnBugsplat()
  1727. self:SaveSkills()
  1728. self:SaveStandRange()
  1729. end
  1730.  
  1731. function _MenuManager:_OnExit()
  1732. self:SaveSkills()
  1733. self:SaveStandRange()
  1734. end
  1735.  
  1736. function _MenuManager:SetToggles(ac, mm, lh, lc)
  1737. AutoCarryMenu.Active, self.AutoCarry = ac, ac
  1738. MixedModeMenu.Active, self.MixedMode = mm, mm
  1739. LastHitMenu.Active, self.LastHit = lh, lh
  1740. LaneClearMenu.Active, self.LaneClear = lc, lc
  1741. end
  1742.  
  1743. function _MenuManager:DisableAllModes()
  1744. AutoCarryMenu.Active = false
  1745. MixedModeMenu.Active = false
  1746. LastHitMenu.Active = false
  1747. LaneClearMenu.Active = false
  1748. end
  1749.  
  1750. function _MenuManager:GetActiveMenu()
  1751. if AutoCarryMenu.Active then
  1752. return AutoCarryMenu
  1753. elseif MixedModeMenu.Active then
  1754. return MixedModeMenu
  1755. elseif LastHitMenu.Active then
  1756. return LastHitMenu
  1757. elseif LaneClearMenu.Active then
  1758. return LaneClearMenu
  1759. end
  1760. end
  1761.  
  1762. function _MenuManager:SaveSkills()
  1763. local _skills = {}
  1764.  
  1765. for _, Skill in pairs(Skills.SkillsList) do
  1766. if AutoCarryMenu[Skill.RawName.."AutoCarry"] ~= nil then
  1767. table.insert(_skills , {mode = "AutoCarry", name=Skill.RawName, value=AutoCarryMenu[Skill.RawName.."AutoCarry"]})
  1768. end
  1769. if MixedModeMenu[Skill.RawName.."MixedMode"] ~= nil then
  1770. table.insert(_skills , {mode = "MixedMode", name=Skill.RawName, value=MixedModeMenu[Skill.RawName.."MixedMode"]})
  1771. end
  1772. if LaneClearMenu[Skill.RawName.."LaneClear"] ~= nil then
  1773. table.insert(_skills , {mode = "LaneClear", name=Skill.RawName, value=LaneClearMenu[Skill.RawName.."LaneClear"]})
  1774. end
  1775. end
  1776.  
  1777. local save = GetSave("SidasAutoCarry")
  1778. save[myHero.charName] = _skills
  1779. save:Save()
  1780. end
  1781.  
  1782. function _MenuManager:LoadSkill(Menu, Name, Mode)
  1783. local save = GetSave("SidasAutoCarry")[myHero.charName]
  1784. if not save then return false end
  1785. for _, Skill in pairs(save) do
  1786. if Skill.name == Name and Skill.mode == Mode then
  1787. return Skill.value
  1788. end
  1789. end
  1790. return false
  1791. end
  1792.  
  1793. function _MenuManager:SaveStandRange()
  1794. local save = GetSave("SidasAutoCarry")
  1795.  
  1796. save.HoldZone = ExtrasMenu["StandZone"..myHero.charName]
  1797. save:Save()
  1798. end
  1799.  
  1800. function _MenuManager:LoadStandRange()
  1801. local save = GetSave("SidasAutoCarry")
  1802.  
  1803. if save.HoldZone then
  1804. return save.HoldZone
  1805. else
  1806. return 0
  1807. end
  1808. end
  1809.  
  1810. --[[
  1811. _Plugins Class
  1812. ]]
  1813.  
  1814. class '_Plugins' Plugins = nil
  1815.  
  1816. function _Plugins:__init()
  1817. self.Plugins = {}
  1818. self.RegisteredBonusLastHitDamage = {}
  1819. self.RegisteredPreAttack = {}
  1820. Plugins = self
  1821. end
  1822.  
  1823. function _Plugins:RegisterPlugin(plugin, name)
  1824. if plugin.OnTick then
  1825. AddTickCallback(function() plugin:OnTick() end)
  1826. end
  1827. if plugin.OnDraw then
  1828. AddDrawCallback(function() plugin:OnDraw() end)
  1829. end
  1830. if plugin.OnCreateObj then
  1831. AddCreateObjCallback(function(obj) plugin:OnCreateObj(obj) end)
  1832. end
  1833. if plugin.OnDeleteObj then
  1834. AddDeleteObjCallback(function(obj) plugin:OnDeleteObj(obj) end)
  1835. end
  1836. if plugin.OnLoad then
  1837. plugin:OnLoad()
  1838. end
  1839. if plugin.OnUnload then
  1840. AddUnloadCallback(function() plugin.OnUnload() end)
  1841. end
  1842. if plugin.OnWndMsg then
  1843. AddMsgCallback(function(msg, key) plugin:OnWndMsg(msg, key) end)
  1844. end
  1845. if plugin.OnProcessSpell then
  1846. AddProcessSpellCallback(function(unit, spell) plugin:OnProcessSpell(unit, spell) end)
  1847. end
  1848. if plugin.OnSendChat then
  1849. AddChatCallback(function(text) plugin:OnSendChat(text) end)
  1850. end
  1851. if plugin.OnBugsplat then
  1852. AddBugsplatCallback(function() plugin:OnBugsplat() end)
  1853. end
  1854. if plugin.OnAnimation then
  1855. AddAnimationCallback(function(unit, anim) plugin:OnAnimation(unit, anim) end)
  1856. end
  1857. if plugin.OnSendPacket then
  1858. AddSendPacketCallback(function(packet) plugin:OnSendPacket(packet) end)
  1859. end
  1860. if plugin.OnRecvPacket then
  1861. AddRecvPacketCallback(function(packet) plugin:OnRecvPacket(packet) end)
  1862. end
  1863. if name then
  1864. self.Plugins[name] = scriptConfig("Sida's Auto Carry Plugin: "..name, "sidasacautocarryplugin"..name)
  1865. return self.Plugins[name]
  1866. end
  1867. end
  1868.  
  1869. function _Plugins:RegisterBonusLastHitDamage(func)
  1870. table.insert(self.RegisteredBonusLastHitDamage, func)
  1871. end
  1872.  
  1873. function _Plugins:RegisterPreAttack(func)
  1874. table.insert(self.RegisteredPreAttack, func)
  1875. end
  1876.  
  1877. function _Plugins:RegisterOnAttacked(func)
  1878. RegisterOnAttacked(func)
  1879. end
  1880.  
  1881. function _Plugins:GetProdiction(Key, Range, Speed, Delay, Width, Source, Callback)
  1882. return ProdictManager.GetInstance():AddProdictionObject(Key, Range, Speed * 1000, Delay / 1000, Width, myHero, Callback)
  1883. end
  1884.  
  1885. --[[
  1886. Drawing Class
  1887. ]]
  1888.  
  1889. class '_Drawing'
  1890.  
  1891. function _Drawing:__init()
  1892. AddDrawCallback(function() self:_OnDraw() end)
  1893. end
  1894.  
  1895. function _Drawing:_OnDraw()
  1896. if DrawingMenu.RangeCircle then
  1897. Helper:DrawCircleObject(myHero, MyHero.TrueRange, Helper:ArgbFromMenu(DrawingMenu.RangeCircleColour))
  1898. end
  1899.  
  1900. if DrawingMenu.CastRangeCircle and Crosshair.Skills_Crosshair.range ~= MyHero.TrueRange then
  1901. Helper:DrawCircleObject(myHero, Crosshair.Skills_Crosshair.range, Helper:ArgbFromMenu(DrawingMenu.CastRangeCircleColour))
  1902. end
  1903.  
  1904. if DrawingMenu.TargetCircle and Crosshair.Target then
  1905. Helper:DrawCircleObject(Crosshair.Target, 100, Helper:ArgbFromMenu(DrawingMenu.TargetCircleColour), 6)
  1906. end
  1907.  
  1908. if DrawingMenu.MinionCircle and Minions.KillableMinion then
  1909. Helper:DrawCircleObject(Minions.KillableMinion, 80, Helper:ArgbFromMenu(DrawingMenu.MinionCircleColour), 6)
  1910. end
  1911.  
  1912. if DrawingMenu.ArrowToTarget and Crosshair.Target then
  1913. self:DrawArrows(myHero, Crosshair.Target)
  1914. end
  1915.  
  1916. if DrawingMenu.StandZone and ExtrasMenu["StandZone"..myHero.charName] > 0 then
  1917. Helper:DrawCircleObject(myHero, ExtrasMenu["StandZone"..myHero.charName], Helper:ArgbFromMenu(DrawingMenu.StandZoneColour))
  1918. end
  1919. end
  1920.  
  1921. function _Drawing:DrawArrows(Start, End)
  1922. if Start and End then
  1923. DrawArrows(D3DXVECTOR3(Start.x, Start.y, Start.z), D3DXVECTOR3(End.x, End.y, End.z), 60, Helper:HexFromMenu(DrawingMenu.ArrowToTargetColour), 100)
  1924. end
  1925. end
  1926.  
  1927. --[[
  1928. _AutoUpdate Class
  1929. ]]
  1930.  
  1931. class '_AutoUpdate' AutoUpdate = nil
  1932.  
  1933. function _AutoUpdate:__init()
  1934. AutoUpdate = self
  1935. self.CurrentVersion = 38
  1936. self.Path = BOL_PATH.."Scripts\\Common\\RebornBetaVersion.beta"
  1937.  
  1938. AddLoadCallback(function() self:_OnLoad() end)
  1939. end
  1940.  
  1941. function _AutoUpdate:_OnLoad()
  1942. WriteFile("Revision="..self.CurrentVersion..";", self.Path)
  1943. end
  1944.  
  1945. _AutoUpdate()
  1946.  
  1947. --[[
  1948. _Data Class
  1949. ]]
  1950.  
  1951.  
  1952. class '_Data' Data = nil
  1953.  
  1954. function _Data:__init()
  1955. self.ResetSpells = {}
  1956. self.SpellAttacks = {}
  1957. self.NoneAttacks = {}
  1958. self.ChampionData = {}
  1959. self.MinionData = {}
  1960. self.JungleData = {}
  1961. self.ItemData = {}
  1962. self.Skills = {}
  1963. Data = self
  1964.  
  1965. self:__GenerateNoneAttacks()
  1966. self:__GenerateSpellAttacks()
  1967. self:__GenerateResetSpells()
  1968. self:_GenerateMinionData()
  1969. self:_GenerateJungleData()
  1970. self:_GenerateItemData()
  1971. self:__GenerateChampionData()
  1972. self:__GenerateSkillData()
  1973. end
  1974.  
  1975. function _Data:__GenerateResetSpells()
  1976. self:AddResetSpell("Powerfist")
  1977. self:AddResetSpell("DariusNoxianTacticsONH")
  1978. self:AddResetSpell("Takedown")
  1979. self:AddResetSpell("Ricochet")
  1980. self:AddResetSpell("BlindingDart")
  1981. self:AddResetSpell("VayneTumble")
  1982. self:AddResetSpell("JaxEmpowerTwo")
  1983. self:AddResetSpell("MordekaiserMaceOfSpades")
  1984. self:AddResetSpell("SiphoningStrikeNew")
  1985. self:AddResetSpell("RengarQ")
  1986. self:AddResetSpell("MonkeyKingDoubleAttack")
  1987. self:AddResetSpell("YorickSpectral")
  1988. self:AddResetSpell("ViE")
  1989. self:AddResetSpell("GarenSlash3")
  1990. self:AddResetSpell("HecarimRamp")
  1991. self:AddResetSpell("XenZhaoComboTarget")
  1992. self:AddResetSpell("LeonaShieldOfDaybreak")
  1993. self:AddResetSpell("ShyvanaDoubleAttack")
  1994. self:AddResetSpell("shyvanadoubleattackdragon")
  1995. self:AddResetSpell("TalonNoxianDiplomacy")
  1996. self:AddResetSpell("TrundleTrollSmash")
  1997. self:AddResetSpell("VolibearQ")
  1998. self:AddResetSpell("PoppyDevastatingBlow")
  1999. self:AddResetSpell("SivirW")
  2000. end
  2001.  
  2002. function _Data:__GenerateSpellAttacks()
  2003. self:AddSpellAttack("frostarrow")
  2004. self:AddSpellAttack("CaitlynHeadshotMissile")
  2005. self:AddSpellAttack("QuinnWEnhanced")
  2006. self:AddSpellAttack("TrundleQ")
  2007. self:AddSpellAttack("XenZhaoThrust")
  2008. self:AddSpellAttack("XenZhaoThrust2")
  2009. self:AddSpellAttack("XenZhaoThrust3")
  2010. self:AddSpellAttack("GarenSlash2")
  2011. self:AddSpellAttack("RenektonExecute")
  2012. self:AddSpellAttack("RenektonSuperExecute")
  2013. self:AddSpellAttack("KennenMegaProc")
  2014. end
  2015.  
  2016. function _Data:__GenerateNoneAttacks()
  2017. self:AddNoneAttack("shyvanadoubleattackdragon")
  2018. self:AddNoneAttack("ShyvanaDoubleAttack")
  2019. self:AddNoneAttack("MonkeyKingDoubleAttack")
  2020. end
  2021.  
  2022. function _Data:_GenerateMinionData()
  2023. self:AddMinionData((myHero.team == 100 and "Blue" or "Red").."_Minion_Basic", 400, 0)
  2024. self:AddMinionData((myHero.team == 100 and "Blue" or "Red").."_Minion_Caster", 484, 0.68)
  2025. self:AddMinionData((myHero.team == 100 and "Blue" or "Red").."_Minion_Wizard", 484, 0.68)
  2026. self:AddMinionData((myHero.team == 100 and "Blue" or "Red").."_Minion_MechCannon", 365, 1.18)
  2027. self:AddMinionData("obj_AI_Turret", 150, 1.14)
  2028. end
  2029.  
  2030. function _Data:_GenerateJungleData()
  2031. self:AddJungleMonster("Worm12.1.1", 1) -- Baron
  2032. self:AddJungleMonster("Dragon6.1.1", 1) -- Dragon
  2033. self:AddJungleMonster("AncientGolem1.1.1", 1) -- Blue Buff
  2034. self:AddJungleMonster("AncientGolem7.1.1", 1) -- Blue Buff
  2035. self:AddJungleMonster("YoungLizard1.1.2", 2) -- Blue Buff Add
  2036. self:AddJungleMonster("YoungLizard7.1.3", 2) -- Blue Buff Add
  2037. self:AddJungleMonster("YoungLizard1.1.3", 2) -- Blue Buff Add
  2038. self:AddJungleMonster("YoungLizard7.1.2", 2) -- Blue Buff Add
  2039. self:AddJungleMonster("LizardElder4.1.1", 1) -- Red Buff
  2040. self:AddJungleMonster("LizardElder10.1.1", 1) -- Red Buff
  2041. self:AddJungleMonster("YoungLizard4.1.2", 2) -- Red Buff Add
  2042. self:AddJungleMonster("YoungLizard4.1.3", 2) -- Red Buff Add
  2043. self:AddJungleMonster("YoungLizard10.1.2", 2) -- Red Buff Add
  2044. self:AddJungleMonster("YoungLizard10.1.3", 2) -- Red Buff Add
  2045. self:AddJungleMonster("GiantWolf2.1.3", 1) -- Big Wolf
  2046. self:AddJungleMonster("GiantWolf8.1.3", 1) -- Big Wolf
  2047. self:AddJungleMonster("wolf2.1.1", 2) -- Small Wolf
  2048. self:AddJungleMonster("wolf2.1.2", 2) -- Small Wolf
  2049. self:AddJungleMonster("wolf8.1.1", 2) -- Small Wolf
  2050. self:AddJungleMonster("wolf8.1.2", 2) -- Small Wolf
  2051. self:AddJungleMonster("Wraith3.1.3", 1) -- Big Wraith
  2052. self:AddJungleMonster("Wraith9.1.3", 1) -- Big Wraith
  2053. self:AddJungleMonster("LesserWraith3.1.1", 2) -- Small Wraith
  2054. self:AddJungleMonster("LesserWraith3.1.2", 2) -- Small Wraith
  2055. self:AddJungleMonster("LesserWraith3.1.4", 2) -- Small Wraith
  2056. self:AddJungleMonster("LesserWraith9.1.1", 2) -- Small Wraith
  2057. self:AddJungleMonster("LesserWraith9.1.2", 2) -- Small Wraith
  2058. self:AddJungleMonster("LesserWraith9.1.4", 2) -- Small Wraith
  2059. self:AddJungleMonster("Golem5.1.2", 1) -- Big Golem
  2060. self:AddJungleMonster("Golem11.1.2", 1) -- Big Golem
  2061. self:AddJungleMonster("SmallGolem5.1.1", 2) -- Small Golem
  2062. self:AddJungleMonster("SmallGolem11.1.1", 2) -- Small Golem
  2063. end
  2064.  
  2065. function _Data:_GenerateItemData()
  2066. self:AddItemData("Blade of the Ruined King", 3153, true, 500)
  2067. self:AddItemData("Bilgewater Cutlass", 3144, true, 500)
  2068. self:AddItemData("Deathfire Grasp", 3128, true, 750)
  2069. self:AddItemData("Hextech Gunblade", 3146, true, 400)
  2070. self:AddItemData("Blackfire Torch", 3188, true, 750)
  2071. self:AddItemData("Ravenous Hydra", 3074, false)
  2072. self:AddItemData("Sword of the Divine", 3131, false)
  2073. self:AddItemData("Tiamat", 3077, false)
  2074. self:AddItemData("Entropy", 3184, false)
  2075. self:AddItemData("Youmuu's Ghostblade", 3142, false)
  2076. self:AddItemData("Muramana", 3042, false)
  2077. end
  2078.  
  2079. ROLE_AD_CARRY = 1
  2080. ROLE_AP = 2
  2081. ROLE_SUPPORT = 3
  2082. ROLE_BRUISER = 4
  2083. ROLE_TANK = 5
  2084.  
  2085. function _Data:__GenerateChampionData()
  2086. -- Champion, Projectile Speed, GameplayCollisionRadius Anti-bug delay Role
  2087. self:AddChampionData("Aatrox", 0, 65, 0, ROLE_BRUISER)
  2088. self:AddChampionData("Ahri", 1.6, 65, 0, ROLE_AP)
  2089. self:AddChampionData("Akali", 0, 65, 0, ROLE_AP)
  2090. self:AddChampionData("Alistar", 0, 80, 0, ROLE_SUPPORT)
  2091. self:AddChampionData("Amumu", 0, 55, 0, ROLE_TANK)
  2092. self:AddChampionData("Anivia", 1.05, 65, 0, ROLE_AP)
  2093. self:AddChampionData("Annie", 1, 55, 0, ROLE_AP)
  2094. self:AddChampionData("Ashe", 2, 65, 0, ROLE_AD_CARRY)
  2095. self:AddChampionData("Blitzcrank", 0, 80, 0, ROLE_SUPPORT)
  2096. self:AddChampionData("Brand", 1.975, 65, 0, ROLE_AP)
  2097. self:AddChampionData("Caitlyn", 2.5, 65, 0, ROLE_AD_CARRY)
  2098. self:AddChampionData("Cassiopeia", 1.22, 65, 0, ROLE_AP)
  2099. self:AddChampionData("Chogath", 0, 80, 0, ROLE_TANK)
  2100. self:AddChampionData("Corki", 2, 65, 0, ROLE_AD_CARRY)
  2101. self:AddChampionData("Darius", 0, 80, 0, ROLE_BRUISER)
  2102. self:AddChampionData("Diana", 0, 65, 0, ROLE_AP)
  2103. self:AddChampionData("DrMundo", 0, 80, 0, ROLE_TANK)
  2104. self:AddChampionData("Draven", 1.4, 65, 0, ROLE_AD_CARRY)
  2105. self:AddChampionData("Elise", 0, 65, 0, ROLE_BRUISER)
  2106. self:AddChampionData("Evelynn", 0, 65, 0, ROLE_AP)
  2107. self:AddChampionData("Ezreal", 2, 65, 0, ROLE_AD_CARRY)
  2108. self:AddChampionData("FiddleSticks", 1.75, 65, 0, ROLE_AP)
  2109. self:AddChampionData("Fiora", 0, 65, 0, ROLE_BRUISER)
  2110. self:AddChampionData("Fizz", 0, 65, 0, ROLE_AP)
  2111. self:AddChampionData("Galio", 0, 80, 0, ROLE_TANK)
  2112. self:AddChampionData("Gangplank", 0, 65, 0, ROLE_BRUISER)
  2113. self:AddChampionData("Garen", 0, 65, 0, ROLE_BRUISER)
  2114. self:AddChampionData("Gragas", 0, 80, 0, ROLE_AP)
  2115. self:AddChampionData("Graves", 3, 65, 0, ROLE_AD_CARRY)
  2116. self:AddChampionData("Hecarim", 0, 80, 0, ROLE_TANK)
  2117. self:AddChampionData("Heimerdinger", 1.4, 55, 0, ROLE_AP)
  2118. self:AddChampionData("Irelia", 0, 65, 0, ROLE_BRUISER)
  2119. self:AddChampionData("Janna", 1.2, 65, 0, ROLE_SUPPORT)
  2120. self:AddChampionData("JarvanIV", 0, 65, 0, ROLE_BRUISER)
  2121. self:AddChampionData("Jax", 0, 65, 0, ROLE_BRUISER)
  2122. self:AddChampionData("Jayce", 2.2, 65, 0, ROLE_AD_CARRY)
  2123. self:AddChampionData("Jinx", 2, 65, 0, ROLE_AD_CARRY)
  2124. self:AddChampionData("Karma", 1.2, 65, 0, ROLE_SUPPORT)
  2125. self:AddChampionData("Karthus", 1.25, 65, 0, ROLE_AP)
  2126. self:AddChampionData("Kassadin", 0, 65, 0, ROLE_AP)
  2127. self:AddChampionData("Katarina", 0, 65, 0, ROLE_AP)
  2128. self:AddChampionData("Kayle", 1.8, 65, 0, ROLE_AP)
  2129. self:AddChampionData("Kennen", 1.35, 55, 0, ROLE_AP)
  2130. self:AddChampionData("Khazix", 0, 65, 0, ROLE_BRUISER)
  2131. self:AddChampionData("KogMaw", 1.8, 65, 0, ROLE_AD_CARRY)
  2132. self:AddChampionData("Leblanc", 1.7, 65, 0, ROLE_AP)
  2133. self:AddChampionData("LeeSin", 0, 65, 0, ROLE_BRUISER)
  2134. self:AddChampionData("Leona", 0, 65, 0, ROLE_SUPPORT)
  2135. self:AddChampionData("Lissandra", 0, 65, 0, ROLE_AP)
  2136. self:AddChampionData("Lucian", 2, 65, 0, ROLE_AD_CARRY)
  2137. self:AddChampionData("Lulu", 2.5, 65, 0, ROLE_SUPPORT)
  2138. self:AddChampionData("Lux", 1.55, 65, 0, ROLE_AP)
  2139. self:AddChampionData("Malphite", 0, 80, 0, ROLE_TANK)
  2140. self:AddChampionData("Malzahar", 1.5, 65, 0, ROLE_AP)
  2141. self:AddChampionData("Maokai", 0, 80, 0, ROLE_TANK)
  2142. self:AddChampionData("MasterYi", 0, 65, 0, ROLE_AP)
  2143. self:AddChampionData("MissFortune", 2, 65, 0, ROLE_AD_CARRY)
  2144. self:AddChampionData("MonkeyKing", 0, 65, 0, ROLE_BRUISER)
  2145. self:AddChampionData("Mordekaiser", 0, 80, 0, ROLE_AP)
  2146. self:AddChampionData("Morgana", 1.6, 65, 0, ROLE_AP)
  2147. self:AddChampionData("Nami", 0, 65, 0, ROLE_SUPPORT)
  2148. self:AddChampionData("Nasus", 0, 80, 0, ROLE_TANK)
  2149. self:AddChampionData("Nautilus", 0, 80, 0, ROLE_BRUISER)
  2150. self:AddChampionData("Nidalee", 1.7, 65, 0, ROLE_AP)
  2151. self:AddChampionData("Nocturne", 0, 65, 0, ROLE_BRUISER)
  2152. self:AddChampionData("Nunu", 0, 65, 0, ROLE_SUPPORT)
  2153. self:AddChampionData("Olaf", 0, 65, 0, ROLE_BRUISER)
  2154. self:AddChampionData("Orianna", 1.4, 65, 0, ROLE_AP)
  2155. self:AddChampionData("Pantheon", 0, 65, 0, ROLE_AD_CARRY)
  2156. self:AddChampionData("Poppy", 0, 55, 0, ROLE_BRUISER)
  2157. self:AddChampionData("Quinn", 1.85, 65, 0, ROLE_AD_CARRY)
  2158. self:AddChampionData("Rammus", 0, 65, 0, ROLE_TANK)
  2159. self:AddChampionData("Renekton", 0, 80, 0, ROLE_BRUISER)
  2160. self:AddChampionData("Rengar", 0, 65, 0, ROLE_BRUISER)
  2161. self:AddChampionData("Riven", 0, 65, 0, ROLE_BRUISER)
  2162. self:AddChampionData("Rumble", 0, 80, 0, ROLE_AP)
  2163. self:AddChampionData("Ryze", 2.4, 65, 0, ROLE_AP)
  2164. self:AddChampionData("Sejuani", 0, 80, 0, ROLE_TANK)
  2165. self:AddChampionData("Shaco", 0, 65, 0, ROLE_AD_CARRY)
  2166. self:AddChampionData("Shen", 0, 65, 0, ROLE_TANK)
  2167. self:AddChampionData("Shyvana", 0, 50, 0, ROLE_BRUISER)
  2168. self:AddChampionData("Singed", 0, 65, 0, ROLE_TANK)
  2169. self:AddChampionData("Sion", 0, 80, 0, ROLE_AP)
  2170. self:AddChampionData("Sivir", 1.4, 65, 0, ROLE_AD_CARRY)
  2171. self:AddChampionData("Skarner", 0, 80, 0, ROLE_TANK)
  2172. self:AddChampionData("Sona", 1.6, 65, 0, ROLE_SUPPORT)
  2173. self:AddChampionData("Soraka", 1, 65, 0, ROLE_SUPPORT)
  2174. self:AddChampionData("Swain", 1.6, 65, 0, ROLE_AP)
  2175. self:AddChampionData("Syndra", 1.2, 65, 0, ROLE_AP)
  2176. self:AddChampionData("Talon", 0, 65, 0, ROLE_AD_CARRY)
  2177. self:AddChampionData("Taric", 0, 65, 0, ROLE_SUPPORT)
  2178. self:AddChampionData("Teemo", 1.3, 55, 0, ROLE_AP)
  2179. self:AddChampionData("Thresh", 0, 55, 0, ROLE_SUPPORT)
  2180. self:AddChampionData("Tristana", 2.25, 55, 0, ROLE_AD_CARRY)
  2181. self:AddChampionData("Trundle", 0, 65, 0, ROLE_BRUISER)
  2182. self:AddChampionData("Tryndamere", 0, 65, 0, ROLE_BRUISER)
  2183. self:AddChampionData("TwistedFate", 1.5, 65, 0, ROLE_AP)
  2184. self:AddChampionData("Twitch", 2.5, 65, 0, ROLE_AD_CARRY)
  2185. self:AddChampionData("Udyr", 0, 65, 0, ROLE_BRUISER)
  2186. self:AddChampionData("Urgot", 1.3, 80, 0, ROLE_AD_CARRY)
  2187. self:AddChampionData("Varus", 2, 65, 0, ROLE_AD_CARRY)
  2188. self:AddChampionData("Vayne", 2, 65, 0, ROLE_AD_CARRY)
  2189. self:AddChampionData("Veigar", 1.05, 55, 0, ROLE_AP)
  2190. self:AddChampionData("Vi", 0, 50, 0, ROLE_BRUISER)
  2191. self:AddChampionData("Viktor", 2.25, 65, 0, ROLE_AP)
  2192. self:AddChampionData("Vladimir", 1.4, 65, 0, ROLE_AP)
  2193. self:AddChampionData("Volibear", 0, 80, 0, ROLE_TANK)
  2194. self:AddChampionData("Warwick", 0, 65, 0, ROLE_TANK)
  2195. self:AddChampionData("Xerath", 1.2, 65, 0, ROLE_AP)
  2196. self:AddChampionData("XinZhao", 0, 65, 0, ROLE_BRUISER)
  2197. self:AddChampionData("Yorick", 0, 80, 0, ROLE_TANK)
  2198. self:AddChampionData("Zac", 0, 65, 0, ROLE_TANK)
  2199. self:AddChampionData("Zed", 0, 65, 0, ROLE_AD_CARRY)
  2200. self:AddChampionData("Ziggs", 1.5, 55, 0, ROLE_AP)
  2201. self:AddChampionData("Zilean", 1.25, 65, 0, ROLE_SUPPORT)
  2202. self:AddChampionData("Zyra", 1.7, 65, 0, ROLE_AP)
  2203. end
  2204.  
  2205. --TODO: Complete the table
  2206. function _Data:__GenerateSkillData()
  2207. --Name Enabled Key Range Display Name Type MinMana Reset Require Attack Target Speed Delay Width Collision
  2208. self:AddSkillData("Ezreal", true, _Q, 1100, "Q (Mystic Shot)", SPELL_LINEAR_COL, 0, false, false, 2, 250, 70, true)
  2209. self:AddSkillData("Ezreal", true, _W, 1050, "W (Essence Flux)", SPELL_LINEAR, 0, false, false, 1.6, 250, 90, false)
  2210. self:AddSkillData("KogMaw", true, _Q, 625, "Q (Caustic Spittle)", SPELL_TARGETED, 0, true, true, 1.3, 260, 200, false)
  2211. self:AddSkillData("KogMaw", true, _W, 625, "W (Bio-Arcane Barrage)", SPELL_SELF, 0, false, false, 1.3, 260, 200, false)
  2212. self:AddSkillData("KogMaw", true, _E, 850, "E (Void Ooze)", SPELL_LINEAR, 0, false, false, 1.3, 260, 200, false)
  2213. self:AddSkillData("KogMaw", true, _R, 1700, "R (Living Artillery)", SPELL_LINEAR, 0, false, false, math.huge, 1000, 200, false)
  2214. self:AddSkillData("Sivir", true, _Q, 1000, "Q (Boomerang Blade)", SPELL_LINEAR, 0, false, false, 1.33, 250, 120, false)
  2215. self:AddSkillData("Sivir", true, _W, 900, "W (Ricochet)", SPELL_SELF, 0, true, true, 1, 0, 200, false)
  2216. self:AddSkillData("Graves", true, _Q, 750, "Q (Buck Shot)", SPELL_CONE, 0, false, false, 2, 250, 200, false)
  2217. self:AddSkillData("Graves", true, _W, 700, "W (Smoke Screen)", SPELL_CIRCLE, 0, false, false, 1400, 300, 500, false)
  2218. self:AddSkillData("Graves", true, _E, 580, "E (Quick Draw)", SPELL_SELF_AT_MOUSE, 0, true, true, 1450, 250, 200, false)
  2219. self:AddSkillData("Caitlyn", true, _Q, 1300, "Q (Piltover Peacemaker)", SPELL_LINEAR, 0, false, false, 2.1, 625, 100, true)
  2220. self:AddSkillData("Corki", true, _Q, 600, "Q (Phosphorus Bomb)", SPELL_CIRCLE, 0, false, false, 2, 200, 500, false)
  2221. self:AddSkillData("Corki", true, _R, 1225, "R (Missile Barrage)", SPELL_LINEAR_COL, 0, false, false, 2, 200, 50, true)
  2222. self:AddSkillData("Teemo", true, _Q, 580, "Q (Blinding Dart)", SPELL_TARGETED, 0, false, false, 2, 0, 200, false)
  2223. self:AddSkillData("TwistedFate", true, _Q, 1200, "Q (Wild Cards)", SPELL_LINEAR, 0, false, false, 1.45, 250, 200, false)
  2224. self:AddSkillData("Vayne", true, _Q, 750, "Q (Tumble)", SPELL_SELF_AT_MOUSE, 0, true, true, 1.45, 250, 200, false)
  2225. self:AddSkillData("Vayne", true, _R, 580, "R (Final Hour)", SPELL_SELF, 0, false, true, 1.45, 250, 200, false)
  2226. self:AddSkillData("MissFortune", true, _Q, 650, "Q (Double Up)", SPELL_TARGETED, 0, true, true, 1.45, 250, 200, false)
  2227. self:AddSkillData("MissFortune", true, _W, 580, "W (Impure Shots)", SPELL_SELF, 0, false, true, 1.45, 250, 200, false)
  2228. self:AddSkillData("MissFortune", true, _E, 800, "E (Make It Rain)", SPELL_CIRCLE, 0, false, false, math.huge, 500, 500, false)
  2229. self:AddSkillData("Tristana", true, _Q, 580, "Q (Rapid Fire)", SPELL_SELF, 0, false, true, 1.45, 250, 200, false)
  2230. self:AddSkillData("Tristana", true, _E, 550, "E (Explosive Shot)", SPELL_TARGETED, 0, false, false, 1.45, 250, 200, false)
  2231. self:AddSkillData("Draven", true, _E, 950, "E (Stand Aside)", SPELL_LINEAR, 0, false, false, 1.37, 300, 130, false)
  2232. self:AddSkillData("Kennen", true, _Q, 1050, "Q (Thundering Shuriken)", SPELL_LINEAR_COL, 0, false, false, 1.65, 180, 80, true)
  2233. self:AddSkillData("Ashe", true, _W, 1200, "W (Volley)", SPELL_LINEAR_COL, 0, false, false, 2, 120, 85, true)
  2234. self:AddSkillData("Syndra", true, _Q, 800, "Q (Dark Sphere)", SPELL_CIRCLE, 0, false, false, math.huge, 400, 100, false)
  2235. self:AddSkillData("Jayce", true, _Q, 1600, "Q (Shock Blast)", SPELL_LINEAR_COL, 0, false, false, 2, 350, 90, true)
  2236. self:AddSkillData("Nidalee", true, _Q, 1500, "Q (Javelin Toss)", SPELL_LINEAR_COL, 0, false, false, 1.3, 125, 80, true)
  2237. self:AddSkillData("Varus", true, _E, 925, "E (Hail of Arrows)", SPELL_CIRCLE, 0, false, false, 1.75, 240, 235, false)
  2238. self:AddSkillData("Quinn", true, _Q, 1050, "Q (Blinding Assault)", SPELL_LINEAR_COL, 0, false, false, 1.55, 220, 90, true)
  2239. self:AddSkillData("LeeSin", true, _Q, 975, "Q (Sonic Wave)", SPELL_LINEAR_COL, 0, false, false, 1.5, 250, 70, true)
  2240. self:AddSkillData("Gangplank", true, _Q, 625, "Q (Parley)", SPELL_TARGETED, 0, false, false, 1.45, 250, 200, false)
  2241. self:AddSkillData("Twitch", true, _W, 950, "W (Venom Cask)", SPELL_CIRCLE, 0, false, false, 1.4, 250, 275, false)
  2242. self:AddSkillData("Darius", true, _W, 300, "W (Crippling Strike)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2243. self:AddSkillData("Hecarim", true, _Q, 300, "Q (Rampage)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2244. self:AddSkillData("Warwick", true, _Q, 300, "Q (Hungering Strike)", SPELL_TARGETED, 0, true, true, 2, 0, 200, true)
  2245. self:AddSkillData("MonkeyKing", true, _Q, 300, "Q (Crushing Blow)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2246. self:AddSkillData("Poppy", true, _Q, 300, "Q (Devastating Blow)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2247. self:AddSkillData("Talon", true, _Q, 300, "Q (Noxian Diplomacy)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2248. self:AddSkillData("Nautilus", true, _W, 300, "W (Titans Wrath)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2249. self:AddSkillData("Gangplank", true, _Q, 300, "Q (Parlay)", SPELL_TARGETED, 0, true, true, 2, 0, 200, true)
  2250. self:AddSkillData("Vi", true, _E, 300, "E (Excessive Force)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2251. self:AddSkillData("Rengar", true, _Q, 300, "Q (Savagery)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2252. self:AddSkillData("Trundle", true, _Q, 300, "Q (Chomp)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2253. self:AddSkillData("Leona", true, _Q, 300, "Q (Shield Of Daybreak)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2254. self:AddSkillData("Fiora", true, _E, 300, "E (Burst Of Speed)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2255. self:AddSkillData("Blitzcrank", true, _E, 300, "E (Power Fist)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2256. self:AddSkillData("Shyvana", true, _Q, 300, "Q (Twin Blade)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2257. self:AddSkillData("Renekton", true, _W, 300, "W (Ruthless Predator)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2258. self:AddSkillData("Jax", true, _W, 300, "W (Empower)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2259. self:AddSkillData("XinZhao", true, _Q, 300, "Q (Three Talon Strike)", SPELL_SELF, 0, true, true, 2, 0, 200, true)
  2260. self:AddSkillData("Nunu", true, _E, 300, "E (Snowball)", SPELL_TARGETED, 0, false, false, 1.45, 250, 200, false)
  2261. self:AddSkillData("Khazix", true, _Q, 300, "Q (Taste Their Fear)", SPELL_TARGETED, 0, true, true, 1.45, 250, 200, false)
  2262. self:AddSkillData("Shen", true, _Q, 300, "Q (Vorpal Blade)", SPELL_TARGETED, 0, false, false, 1.45, 250, 200, false)
  2263. end
  2264.  
  2265. function _Data:AddResetSpell(name)
  2266. self.ResetSpells[name] = true
  2267. end
  2268.  
  2269. function _Data:AddSpellAttack(name)
  2270. self.SpellAttacks[name] = true
  2271. end
  2272.  
  2273. function _Data:AddNoneAttack(name)
  2274. self.NoneAttacks[name] = true
  2275. end
  2276.  
  2277. function _Data:AddChampionData(Champion, ProjSpeed, _GameplayCollisionRadius, Delay, _Priority)
  2278. self.ChampionData[Champion] = {Name = Champion, ProjectileSpeed = ProjSpeed, GameplayCollisionRadius = _GameplayCollisionRadius, BugDelay = Delay and Delay or 0, Priority = _Priority }
  2279. end
  2280.  
  2281. function _Data:AddMinionData(Name, delay, ProjSpeed)
  2282. self.MinionData[Name] = {Delay = delay, ProjectileSpeed = ProjSpeed}
  2283. end
  2284.  
  2285. function _Data:AddJungleMonster(Name, Priority)
  2286. self.JungleData[Name] = Priority
  2287. end
  2288.  
  2289. function _Data:GetJunglePriority(Name)
  2290. return self.JungleData[Name]
  2291. end
  2292.  
  2293. function _Data:AddItemData(Name, ID, RequiresTarget, Range)
  2294. self.ItemData[ID] = _Item(Name, ID, RequiresTarget, Range)
  2295. end
  2296.  
  2297. function _Data:AddSkillData(Name, Enabled, Key, Range, DisplayName, Type, MinMana, AfterAttack, ReqAttackTarget, Speed, Delay, Width, Collision)
  2298. if myHero.charName == Name then
  2299. local skill = _Skill(Enabled, Key, Range, DisplayName, Type, MinMana, AfterAttack, ReqAttackTarget, Speed, Delay, Width, Collision)
  2300. table.insert(self.Skills, skill)
  2301. end
  2302. end
  2303.  
  2304. function _Data:GetProjectileSpeed(name)
  2305. return self.ChampionData[name] and self.ChampionData[name].ProjectileSpeed or nil
  2306. end
  2307.  
  2308. function _Data:GetGameplayCollisionRadius(name)
  2309. return self.ChampionData[name] and self.ChampionData[name].GameplayCollisionRadius or 65
  2310. end
  2311.  
  2312. function _Data:IsResetSpell(Spell)
  2313. return self.ResetSpells[Spell.name]
  2314. end
  2315.  
  2316. function _Data:IsAttack(Spell)
  2317. return (self.SpellAttacks[Spell.name] or Helper:StringContains(Spell.name, "attack")) and not self.NoneAttacks[Spell.name]
  2318. end
  2319.  
  2320. function _Data:IsJungleMinion(Object)
  2321. return Object and Object.name and self.JungleData[Object.name] ~= nil
  2322. end
  2323.  
  2324. --[[ Initialize Classes ]]
  2325. function Init()
  2326. if VIP_USER then
  2327. if FileExist(SCRIPT_PATH..'Common/Prodiction.lua') then
  2328. require "Prodiction"
  2329. else
  2330. print("[Reborn]: You need the Prodiction library from the forums!")
  2331. return false
  2332. end
  2333. end
  2334. AutoCarry.Skills = _Skills()
  2335. AutoCarry.Keys = _Keys()
  2336. AutoCarry.Items = _Items()
  2337. AutoCarry.Data = _Data()
  2338. AutoCarry.Jungle = _Jungle()
  2339. AutoCarry.Helper = _Helper()
  2340. AutoCarry.MyHero = _MyHero()
  2341. AutoCarry.Minions = _Minions()
  2342. AutoCarry.Crosshair = _Crosshair(DAMAGE_PHYSICAL, MyHero.TrueRange, 0, false, false)
  2343. AutoCarry.Orbwalker = _Orbwalker()
  2344. AutoCarry.Plugins = _Plugins()
  2345. Skills, Keys, Items, Data, Jungle, Helper, MyHero, Minions, Crosshair, Orbwalker = Helper:GetClasses()
  2346. SwingTimer = _SwingTimer()
  2347. _MenuManager()
  2348. _Drawing()
  2349. _Structures()
  2350. Streaming:CreateMenu()
  2351. local _, files = ScanDirectory(BOL_PATH.."Scripts\\SidasAutoCarryPlugins")
  2352. for _, file in pairs(files) do
  2353. dofile(BOL_PATH.."Scripts\\SidasAutoCarryPlugins\\"..AutoCarry.Helper:TrimString(file))
  2354. end
  2355.  
  2356. PrintChat("<font color='#CCCCCC'> >> Valid license found! <<</font>")
  2357. PrintChat("<font color='#CCCCCC'> >> Sida's Auto Carry - Reborn, loaded! <<</font>")
  2358. PrintChat("<font color='#CCCCCC'> >> Loaded as "..(VIP_USER and "VIP" or "Non-VIP").." user <<</font>")
  2359.  
  2360.  
  2361. --[[
  2362. Legacy Plugin Support
  2363. Plugins should be updated, this may be removed after a few months.
  2364. ]]
  2365.  
  2366. --AutoCarry.Orbwalker = AutoCarry.Crosshair.Attack_Crosshair
  2367. AutoCarry.SkillsCrosshair = AutoCarry.Crosshair.Skills_Crosshair
  2368. AutoCarry.CanMove = true
  2369. AutoCarry.CanAttack = true
  2370. AutoCarry.MainMenu = {}
  2371. AutoCarry.PluginMenu = nil
  2372. AutoCarry.EnemyTable = GetEnemyHeroes()
  2373. AutoCarry.shotFired = false
  2374. AutoCarry.OverrideCustomChampionSupport = false
  2375. AutoCarry.CurrentlyShooting = false
  2376. DoneInit = true
  2377.  
  2378.  
  2379. class '_LegacyPlugin'
  2380.  
  2381. function _LegacyPlugin:__init()
  2382. AutoCarry.PluginMenu = scriptConfig("Sida's Auto Carry Plugin: "..myHero.charName, "sidasacplugin"..myHero.charName)
  2383. require("SidasAutoCarryPlugin - "..myHero.charName)
  2384. PrintChat(">> Sida's Auto Carry: Loaded "..myHero.charName.." plugin!")
  2385. AddTickCallback(function() self:_OnTick() end)
  2386.  
  2387. if PluginOnTick then
  2388. AddTickCallback(function() PluginOnTick() end)
  2389. end
  2390. if PluginOnDraw then
  2391. AddDrawCallback(function() PluginOnDraw() end)
  2392. end
  2393. if PluginOnCreateObj then
  2394. AddCreateObjCallback(function(obj) PluginOnCreateObj(obj) end)
  2395. end
  2396. if PluginOnDeleteObj then
  2397. AddDeleteObjCallback(function(obj) PluginOnDeleteObj(obj) end)
  2398. end
  2399. if PluginOnLoad then
  2400. PluginOnLoad()
  2401. end
  2402. if PluginOnUnload then
  2403. AddUnloadCallback(function() PluginOnUnload() end)
  2404. end
  2405. if PluginOnWndMsg then
  2406. AddMsgCallback(function(msg, key) PluginOnWndMsg(msg, key) end)
  2407. end
  2408. if PluginOnProcessSpell then
  2409. AddProcessSpellCallback(function(unit, spell) PluginOnProcessSpell(unit, spell) end)
  2410. end
  2411. if PluginOnSendChat then
  2412. AddChatCallback(function(text) PluginOnSendChat(text) end)
  2413. end
  2414. if PluginOnBugsplat then
  2415. AddBugsplatCallback(function() PluginOnBugsplat() end)
  2416. end
  2417. if PluginOnAnimation then
  2418. AddAnimationCallback(function(unit, anim) PluginOnAnimation(unit, anim) end)
  2419. end
  2420. if PluginOnSendPacket then
  2421. AddSendPacketCallback(function(packet) PluginOnSendPacket(packet) end)
  2422. end
  2423. if PluginOnRecvPacket then
  2424. AddRecvPacketCallback(function(packet) PluginOnRecvPacket(packet) end)
  2425. end
  2426. if PluginOnApplyParticle then
  2427. AddParticleCallback(function(unit, particle) PluginOnApplyParticle(unit, particle) end)
  2428. end
  2429. if OnAttacked then
  2430. RegisterOnAttacked(OnAttacked)
  2431. end
  2432. if PluginBonusLastHitDamage then
  2433. Plugins:RegisterBonusLastHitDamage(PluginBonusLastHitDamage)
  2434. end
  2435.  
  2436. if CustomAttackEnemy then
  2437. Plugins:RegisterPreAttack(CustomAttackEnemy)
  2438. end
  2439. end
  2440.  
  2441. function _LegacyPlugin:_OnTick()
  2442. AutoCarry.MainMenu.AutoCarry = AutoCarryMenu.Active
  2443. AutoCarry.MainMenu.LastHit = LastHitMenu.Active
  2444. AutoCarry.MainMenu.MixedMode = MixedModeMenu.Active
  2445. AutoCarry.MainMenu.LaneClear = LaneClearMenu.Active
  2446. MyHero:MovementEnabled(AutoCarry.CanMove)
  2447. MyHero:AttacksEnabled(AutoCarry.CanAttack)
  2448. if #AutoCarry.EnemyTable < #Helper.EnemyTable then
  2449. AutoCarry.EnemyTable = Helper.EnemyTable
  2450. end
  2451. end
  2452.  
  2453. AutoCarry.GetAttackTarget = function(isCaster)
  2454. return Crosshair:GetTarget()
  2455. end
  2456.  
  2457. AutoCarry.GetKillableMinion = function()
  2458. return Minions.KillableMinion
  2459. end
  2460.  
  2461. AutoCarry.GetMinionTarget = function()
  2462. return nil
  2463. end
  2464.  
  2465. AutoCarry.EnemyMinions = function()
  2466. return Minions.EnemyMinions
  2467. end
  2468.  
  2469. AutoCarry.AllyMinions = function()
  2470. return Minions.AllyMinions
  2471. end
  2472.  
  2473. AutoCarry.GetJungleMobs = function()
  2474. return Jungle.JungleMonsters
  2475. end
  2476.  
  2477. AutoCarry.GetLastAttacked = function()
  2478. return Orbwalker.LastEnemyAttacked
  2479. end
  2480.  
  2481. AutoCarry.GetNextAttackTime = function()
  2482. return Orbwalker:GetNextAttackTime()
  2483. end
  2484.  
  2485. AutoCarry.CastSkillshot = function (skill, target)
  2486. if VIP_USER then
  2487. pred = TargetPredictionVIP(skill.range, skill.speed*1000, (skill.delay/1000 - (GetLatency()/2)/1000), skill.width)
  2488. elseif not VIP_USER then
  2489. pred = TargetPrediction(skill.range, skill.speed, skill.delay, skill.width)
  2490. end
  2491. local predPos = pred:GetPrediction(target)
  2492. if predPos and GetDistance(predPos) <= skill.range then
  2493. if VIP_USER and pred:GetHitChance(target) > ConfigMenu.HitChance/100 then --TODO
  2494. if not skill.minions or not AutoCarry.GetCollision(skill, myHero, predPos) then
  2495. CastSpell(skill.spellKey, predPos.x, predPos.z)
  2496. end
  2497. elseif not VIP_USER then
  2498. if not skill.minions or not AutoCarry.GetCollision(skill, myHero, predPos) then
  2499. CastSpell(skill.spellKey, predPos.x, predPos.z)
  2500. end
  2501. end
  2502. end
  2503. end
  2504.  
  2505. AutoCarry.GetCollision = function (skill, source, destination)
  2506. if VIP_USER then
  2507. local col = Collision(skill.range, skill.speed*1000 , (skill.delay/1000 - (GetLatency()/2)/1000), skill.width)
  2508. return col:GetMinionCollision(source, destination)
  2509. else
  2510. return willHitMinion(destination, skill.width)
  2511. end
  2512. end
  2513.  
  2514. AutoCarry.GetPrediction = function(skill, target)
  2515. if VIP_USER then
  2516. pred = TargetPredictionVIP(skill.range, skill.speed*1000, skill.delay/1000, skill.width)
  2517. elseif not VIP_USER then
  2518. pred = TargetPrediction(skill.range, skill.speed, skill.delay, skill.width)
  2519. end
  2520. return pred:GetPrediction(target)
  2521. end
  2522.  
  2523. AutoCarry.IsValidHitChance = function(skill, target)
  2524. return true
  2525. end
  2526.  
  2527. AutoCarry.GetProdiction = function(Key, Range, Speed, Delay, Width, Source, Callback)
  2528. return AutoCarry.Plugins:GetProdiction(Key, Range, Speed, Delay, Width, Source, Callback)
  2529. end
  2530.  
  2531. function willHitMinion(predic, width)
  2532. for _, minion in pairs(Minions.EnemyMinions.objects) do
  2533. if minion ~= nil and minion.valid and string.find(minion.name,"Minion_") == 1 and minion.team ~= player.team and minion.dead == false then
  2534. if predic ~= nil then
  2535. ex = player.x
  2536. ez = player.z
  2537. tx = predic.x
  2538. tz = predic.z
  2539. dx = ex - tx
  2540. dz = ez - tz
  2541. if dx ~= 0 then
  2542. m = dz/dx
  2543. c = ez - m*ex
  2544. end
  2545. mx = minion.x
  2546. mz = minion.z
  2547. distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  2548. 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
  2549. return true
  2550. end
  2551. end
  2552. end
  2553. end
  2554. return false
  2555. end
  2556.  
  2557. if FileExist(LIB_PATH .."SidasAutoCarryPlugin - "..myHero.charName..".lua") then
  2558. _LegacyPlugin()
  2559. end
  2560. end
  2561.  
  2562. function OnLoad()
  2563. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement