Advertisement
Guest User

Beta3 farming

a guest
Jan 12th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.70 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. --[[ START MENU ]]
  37. local menu_GSO = MenuElement({type = MENU, id = "menugso", name = "TEST"})
  38. menu_GSO:MenuElement({name = "Color MinionLH", id = "colminLH", color = Draw.Color(150, 49, 210, 0)})
  39. menu_GSO:MenuElement({name = "Color MinionLHS", id = "colminLHS", color = Draw.Color(150, 49, 210, 0)})
  40. menu_GSO:MenuElement({name = "Color MinionLC", id = "colminLC", color = Draw.Color(150, 49, 210, 0)})
  41. menu_GSO:MenuElement({name = "Color Missile", id = "colmis", color = Draw.Color(150, 153, 0, 76)})
  42. menu_GSO:MenuElement({id = "lhit", name = "LastHit Key", key = string.byte("X")})
  43. menu_GSO:MenuElement({id = "lclr", name = "LaneClear Key", key = string.byte("V")})
  44. --[[ END MENU ]]
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88. --[[ START VARIABLES ]]
  89. local aAttacks = {} -- activeAttacks
  90. local aMinions = {} -- allyMinions
  91. local eMinions = {} -- enemyMinions
  92. local eMinionsLH = {} -- enemyMinionsLastHitable
  93. local eMinionsLC = {} -- enemyMinionsLaneClearable
  94. local eMinionsLHS = {} -- enemyMinionsLastHitableSoon
  95. local lAttack = 0 -- lastAttackTime
  96. local lMove = 0 -- lastMoveTime
  97. local dMouse = nil -- delayedMouseAction
  98.  
  99. local eMinionsLHD = {}
  100. local eMinionsLCD = {}
  101. local eMinionsLHSD = {}
  102. --[[ END VARIABLES ]]
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. --[[ START OBJECT MANAGER ]]
  152. local function isValidTarget_GSO(range, unit)
  153. local type = unit.type
  154. local isUnit = type == Obj_AI_Hero or type == Obj_AI_Minion or type == Obj_AI_Turret
  155. local isValid = isUnit and unit.valid or true
  156. if unit.distance<=range and not unit.dead and unit.isTargetable and unit.visible and isValid then
  157. return true
  158. end
  159. return false
  160. end
  161.  
  162. local function getAllyMinions_GSO(range)
  163. local result = {}
  164. for i = 1, Game.MinionCount() do
  165. local minion = Game.Minion(i)
  166. if minion.isAlly and isValidTarget_GSO(range, minion) then
  167. result[#result + 1] = minion
  168. end
  169. end
  170. return result
  171. end
  172.  
  173. local function getEnemyMinions_GSO(range)
  174. local result = {}
  175. for i = 1, Game.MinionCount() do
  176. local minion = Game.Minion(i)
  177. local isotherminion = minion.maxHealth <= 6
  178. if minion.isEnemy and not isotherminion and isValidTarget_GSO(range, minion) then
  179. result[#result + 1] = minion
  180. end
  181. end
  182. return result
  183. end
  184. --[[ END OBJECT MANAGER ]]
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251. --[[ START DELAY ACTION ]]
  252. local function doDelayedAction()
  253. if dMouse ~= nil and GetTickCount() - dMouse[2] > dMouse[3] then
  254. dMouse[1]()
  255. dMouse = nil
  256. end
  257. end
  258. --[[ END DELAY ACTION ]]
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323. --[[
  324.  
  325. aAttacks[aMinion_handle][aaID] = {
  326. canceled = false,
  327. speed = pSpeed,
  328. startTime = pStartTime,
  329. endTime = pEndTime,
  330. pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartTime)),
  331. from = aMinion,
  332. to = eMinion,
  333. dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
  334. }
  335.  
  336. local eMinionsLH = {} -- enemyMinionsLastHitable
  337. local eMinionsLC = {} -- enemyMinionsLaneClearable
  338. local eMinionsLHS = {} -- enemyMinionsLastHitableSoon
  339.  
  340. ]]
  341.  
  342.  
  343. --[[ START ENEMIES, ALLIES ]]
  344. local function getPossibleDmg(unit)
  345. local result = 0
  346. for i = 1, #aMinions do
  347. local aMinion = aMinions[i]
  348. local distance = aMinion.pos:DistanceTo(unit.pos)
  349. if distance < aMinion.range + 500 and (aMinion.pathing.hasMovePath == true or aMinion.attackData.target == unit.handle) then
  350. result = result + (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))
  351. end
  352. end
  353. return result
  354. end
  355. local function setEnemyMinions()
  356. for i = 1, #eMinions do
  357. local eMinion = eMinions[i]
  358. local eMinion_handle = eMinion.handle
  359. local eMinion_healthLH = eMinion.health
  360. local myHero_aaData = myHero.attackData
  361. local myHero_pFlyTime = myHero_aaData.windUpTime + (eMinion.distance / myHero_aaData.projectileSpeed) + 0.1
  362. for k1,v1 in pairs(aAttacks) do
  363. for k2,v2 in pairs(aAttacks[k1]) do
  364. local checkT = Game.Timer()
  365. local eMinion_pFlyTime = v2.endTime
  366. if v2.canceled == false and eMinion_handle == v2.to.handle and eMinion_pFlyTime > checkT and eMinion_pFlyTime - checkT < myHero_pFlyTime then
  367. eMinion_healthLH = eMinion_healthLH - v2.dmg
  368. end
  369. end
  370. end
  371. local myHero_dmg = myHero.totalDamage
  372. if eMinion_healthLH - myHero_dmg < 0 then
  373. eMinionsLH[#eMinionsLH+1] = eMinion
  374. else
  375. if eMinion.health - getPossibleDmg(eMinion) - (myHero_dmg*2) < 0 then
  376. eMinionsLHS[#eMinionsLHS+1] = eMinion
  377. else
  378. eMinionsLC[#eMinionsLC+1] = eMinion
  379. end
  380. end
  381. end
  382. eMinionsLHD = eMinionsLH
  383. eMinionsLCD = eMinionsLC
  384. eMinionsLHSD = eMinionsLHS
  385. end
  386. local function addEnemyMinions()
  387. local t = getEnemyMinions_GSO(2000)
  388. for i = 1, #t do
  389. local minion = t[i]
  390. if not eMinions[minion.handle] then
  391. eMinions[i] = minion
  392. end
  393. end
  394. end
  395. local function removeEnemyMinions()
  396. eMinions = {}
  397. eMinionsLC = {}
  398. eMinionsLH = {}
  399. eMinionsLHS = {}
  400. end
  401.  
  402. local function addAllyMinions()
  403. local t = getAllyMinions_GSO(2000)
  404. for i = 1, #t do
  405. local minion = t[i]
  406. aMinions[i] = minion
  407. end
  408. end
  409. local function removeAllyMinions()
  410. aMinions = {}
  411. end
  412. --[[ END ENEMIES, ALLIES ]]
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478. --[[ START ACTIVE ATTACKS ]]
  479. local function setActiveAttacks()
  480. for i = 1, #aMinions do
  481. local aMinion = aMinions[i]
  482. local aMinion_handle = aMinion.handle
  483. local aMinion_aaData = aMinion.attackData
  484. if aMinion_aaData.endTime > Game.Timer() then
  485. for i = 1, #eMinions do
  486. local eMinion = eMinions[i]
  487. local eMinion_handle = eMinion.handle
  488. if eMinion_handle == aMinion_aaData.target then
  489. local checkT = Game.Timer()
  490. -- p -> projectile
  491. local pSpeed = aMinion_aaData.projectileSpeed
  492. local pFlyTime = pSpeed > 0 and aMinion.pos:DistanceTo(eMinion.pos) / pSpeed or 0
  493. local pStartTime = aMinion_aaData.endTime - aMinion_aaData.windDownTime
  494. local pEndTime = pStartTime + pFlyTime
  495. if not aAttacks[aMinion_handle] then
  496. aAttacks[aMinion_handle] = {}
  497. end
  498. local aaID = math.floor(aMinion_aaData.endTime)
  499. if checkT < pEndTime then
  500. if pSpeed > 0 then
  501. if checkT > pStartTime then
  502. if not aAttacks[aMinion_handle][aaID] then
  503. aAttacks[aMinion_handle][aaID] = {
  504. canceled = false,
  505. speed = pSpeed,
  506. startTime = pStartTime,
  507. endTime = pEndTime,
  508. pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartTime)),
  509. from = aMinion,
  510. to = eMinion,
  511. dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
  512. }
  513. end
  514. elseif aMinion.pathing.hasMovePath == true then
  515. --print("attack canceled")
  516. aAttacks[aMinion_handle][aaID] = {
  517. canceled = true,
  518. from = aMinion
  519. }
  520. end
  521. elseif not aAttacks[aMinion_handle][aaID] then
  522. aAttacks[aMinion_handle][aaID] = {
  523. canceled = false,
  524. speed = pSpeed,
  525. startTime = pStartTime - aMinion_aaData.windUpTime,
  526. endTime = pEndTime,
  527. pos = aMinion.pos,
  528. from = aMinion,
  529. to = eMinion,
  530. dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
  531. }
  532. end
  533. end
  534. break
  535. end
  536. end
  537. end
  538. end
  539. end
  540. local function handleActiveAttacks()
  541. local aAttacks2 = aAttacks
  542. for k1,v1 in pairs(aAttacks2) do
  543. local count = 0
  544. local checkT = Game.Timer()
  545. for k2,v2 in pairs(aAttacks[k1]) do
  546. count = count + 1
  547. if not v2.from or v2.from == nil or v2.from.dead then
  548. --print("dead")
  549. aAttacks[k1] = nil
  550. break
  551. end
  552. if v2.canceled == false then
  553. if checkT > v2.endTime - 0.08 or not v2.to or v2.to == nil or v2.to.dead then
  554. aAttacks[k1][k2] = nil
  555. elseif v2.speed > 0 then
  556. aAttacks[k1][k2].pos = v2.from.pos:Extended(v2.to.pos, (checkT-v2.startTime)*v2.speed)
  557. end
  558. end
  559. end
  560. if count == 0 then
  561. --print("no active attacks")
  562. aAttacks[k1] = nil
  563. end
  564. end
  565. end
  566. --[[ END ACTIVE ATTACKS ]]
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635. --[[ START TARGET SELECTOR ]]
  636. local function lastHit()
  637. local result = nil
  638. local max = 0
  639. for i = 1, #eMinionsLH do
  640. local eMinionLH = eMinionsLH[i]
  641. local maxHP = eMinionLH.maxHealth
  642. if maxHP > max then
  643. max = maxHP
  644. result = eMinionLH
  645. end
  646. end
  647. return result
  648. end
  649. local function laneClear()
  650. local result = nil
  651. --
  652. return result
  653. end
  654. --[[ END TARGET SELECTOR ]]
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719. --[[ START ORBWALKER ]]
  720. local function Orb(unit)
  721. local checkT = GetTickCount()
  722. if checkT > lAttack + (myHero.attackData.animationTime*1000) + 125 and unit ~= nil then
  723. local cPos = cursorPos
  724. Control.SetCursorPos(unit.pos)
  725. Control.mouse_event(MOUSEEVENTF_RIGHTDOWN)
  726. Control.mouse_event(MOUSEEVENTF_RIGHTUP)
  727. lAttack = GetTickCount()
  728. lMove = 0
  729. dMouse = { function() Control.SetCursorPos(cPos.x, cPos.y) end, GetTickCount(), 50 }
  730. elseif checkT > lAttack + (myHero.attackData.windUpTime*1000) + 150 and GetTickCount() > lMove + 200 then
  731. Control.mouse_event(0x0008)
  732. Control.mouse_event(0x0010)
  733. lMove = GetTickCount()
  734. end
  735. end
  736. --[[ END ORBWALKER ]]
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836. --[[ START TICK ]]
  837. Callback.Add("Tick", function()
  838. doDelayedAction()
  839. addEnemyMinions()
  840. addAllyMinions()
  841. setActiveAttacks()
  842. handleActiveAttacks()
  843. setEnemyMinions()
  844. local AAtarget = nil
  845. local lh = menu_GSO.lhit:Value()
  846. local lc = menu_GSO.lclr:Value()
  847. if lh then
  848. AAtarget = lastHit()
  849. elseif lc then
  850. AAtarget = laneClear()
  851. end
  852. if lh or lc then
  853. Orb(AAtarget)
  854. end
  855. removeEnemyMinions()
  856. removeAllyMinions()
  857. end)
  858. --[[ END TICK ]]
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911. --[[
  912.  
  913. aAttacks[aMinion_handle][aaID] = {
  914. canceled = false,
  915. speed = pSpeed,
  916. startTime = pStartTime,
  917. endTime = pEndTime,
  918. pos = aMinion.pos:Extended(eMinion.pos, pSpeed*(checkT-pStartTime)),
  919. from = aMinion,
  920. to = eMinion,
  921. dmg = (aMinion.totalDamage*(1+aMinion.bonusDamagePercent))-eMinion.flatDamageReduction
  922. }
  923.  
  924. ]]
  925.  
  926.  
  927.  
  928. --[[ START DRAWS ]]
  929. Callback.Add("Draw", function()
  930. for i = 1, #eMinionsLHD do
  931. local eMinionLHD = eMinionsLHD[i]
  932. Draw.Circle(eMinionLHD.pos, 35, 5, menu_GSO.colminLH:Value())
  933. end
  934. for i = 1, #eMinionsLHSD do
  935. local eMinionLHSD = eMinionsLHSD[i]
  936. Draw.Circle(eMinionLHSD.pos, 35, 5, menu_GSO.colminLHS:Value())
  937. end
  938. for i = 1, #eMinionsLCD do
  939. local eMinionLCD = eMinionsLCD[i]
  940. Draw.Circle(eMinionLCD.pos, 35, 5, menu_GSO.colminLC:Value())
  941. end
  942. for k1,v1 in pairs(aAttacks) do
  943. for k2,v2 in pairs(aAttacks[k1]) do
  944. local checkT = Game.Timer()
  945. if v2.to and not v2.to.dead and checkT > v2.startTime and v2.canceled == false then
  946. if v2.speed > 0 then
  947. Draw.Circle(v2.pos, 10, 10, menu_GSO.colmis:Value())
  948. else
  949. Draw.Circle(v2.from.pos, 10, 10, menu_GSO.colmis:Value())
  950. end
  951. end
  952. end
  953. end
  954. end)
  955. --[[ END DRAWS]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement