Advertisement
Guest User

Dr-Mundo-helper-SBTW--v0.15c.lua

a guest
Feb 23rd, 2013
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.  
  3.         **SBTW** Dr. Mundo helper v0.15c (Made by xkjtx) Oh Billy!
  4.  
  5.         --**Pressing hot key will do the following:
  6.             -** 'Auto' Cast Q on target with prediction (WITHOUT MINION COLLISION - Make sure minions are not in the way)
  7.             -** 'Auto' Cast E when in eRange
  8.             -** 'Auto' AA'ing when in qbRange
  9.             -** 'Toggle' Cast W when in wRange and turn off when out of range(credits to jbman for fixing)
  10.             -** 'Toggle' Cast Ult(R) when health is at 15%(you can change this to what you like)
  11.             -** 'Hot-Key' Q Harass with prediction (default letter S for harass)
  12.  
  13. ]]
  14.  
  15. if myHero.charName ~= "DrMundo" then return end
  16.  
  17. local player = GetMyHero()
  18. local range = 125 -- Basic Attack Range
  19. local qRange = 1050 -- Q range
  20. local qbRange = 400 -- Auto Attack in this range (when holding hot-key you will start AA'ing)
  21. local eRange = 300 -- Turn on E when in this range
  22. local wRange = 325 -- Turn on W when target is in this range
  23. local wbRange = 355 -- Turn off W when target is out of this range
  24. local pRange = 100 -- for prediction circle
  25.  
  26. --Hotkeys
  27. local hotQEWkey = 32 -- Space bar
  28. local hotQharass = string.byte("S")
  29.  
  30. -- more locals
  31. local QREADY, EREADY, WREADY, RREADY = false, false, false, false
  32. local wUsed = false
  33. local travelDuration, buffCount, predic = nil, nil, nil
  34. local ts
  35. local delay = 300
  36. local speed = 1.975
  37. local HUNDRED = 100
  38. local healthPercentage = 20 -- Health percentage (18%) this is when Ult will activate
  39.  
  40.  
  41. function OnLoad()
  42.     PrintChat("Dr. Mundo Helper v0.15c: (xkjtx) Oh Billy!)")
  43.     DMConfig = scriptConfig("Dr. Mundo Q Helper 0.15c", "Dr-Mundo-helper-SBTW--v0.15c")
  44.     DMConfig:addParam("qActive", "Infected Cleaver", SCRIPT_PARAM_ONKEYDOWN, false, hotQEWkey) -- Space
  45.     DMConfig:addParam("qHarass", "Cleaver Harass", SCRIPT_PARAM_ONKEYDOWN, false, hotQharass) -- Letter 'S'
  46.     DMConfig:addParam("toggleW", "Turn W Casting On/Off", SCRIPT_PARAM_ONOFF, false) -- Off by default
  47.     DMConfig:addParam("autoUlt", "Use Ult When Low Health", SCRIPT_PARAM_ONOFF, true)
  48.     DMConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  49.     DMConfig:permaShow("qActive")
  50.     DMConfig:permaShow("qHarass")
  51.     DMConfig:permaShow("toggleW")
  52.     DMConfig:permaShow("autoUlt")
  53.     ts = TargetSelector(TARGET_LOW_HP,qRange,DAMAGE_PHYSICAL,true) -- So you can select target if you want(left clicking on the ground will default ts)
  54.     ts.name = "DrMundo"
  55.     DMConfig:addTS(ts)
  56.     wUsed = false
  57. end
  58.  
  59. function OnTick()
  60.     if myHero.dead then
  61.         return
  62.     end
  63.  
  64.     ts:update()
  65.    
  66.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  67.     EREADY = (myHero:CanUseSpell(_E) == READY)
  68.     WREADY = (myHero:CanUseSpell(_W) == READY)
  69.     RREADY = (player:CanUseSpell(_R) == READY)
  70.  
  71.     if DMConfig.autoUlt then
  72.         if not player.dead and ((player.health * HUNDRED ) / player.maxHealth) <= healthPercentage and RREADY then
  73.             CastSpell(_R)
  74.         end
  75.     end
  76.    
  77.     if ts.target ~= nil and not myHero.dead then
  78.         travelDuration = (delay + GetDistance(myHero, ts.target)/speed)
  79.         ts:SetPrediction(travelDuration)
  80.         predic = ts.nextPosition
  81.         if DMConfig.qActive then
  82.             if predic ~= nil and QREADY and GetDistance(predic) < qRange then
  83.                 CastSpell(_Q, predic.x, predic.z)
  84.             end
  85.             if GetDistance(ts.target) <= eRange and EREADY then
  86.                 CastSpell(_E)
  87.             end
  88.             if GetDistance(ts.target) < qbRange then
  89.                 myHero:Attack(ts.target)
  90.             end
  91.         end
  92.         if DMConfig.qHarass then
  93.             if predic ~= nil and QREADY and GetDistance(predic) < qRange then
  94.                 CastSpell(_Q, predic.x, predic.z)
  95.             end
  96.         end
  97.     end
  98.  
  99.     if DMConfig.toggleW and DMConfig.qActive and not myHero.dead then
  100.         if ts.target == nil then
  101.             if wUsed and WREADY then
  102.                 CastSpell(_W)
  103.             end
  104.         elseif ts.target ~= nil then
  105.             if GetDistance(ts.target) <= wRange and wUsed == false and WREADY then
  106.                 CastSpell(_W)
  107.             elseif ts.target.dead or GetDistance(ts.target) > wbRange and wUsed and WREADY then
  108.                 CastSpell(_W)
  109.             end
  110.         end
  111.     end
  112. end
  113.  
  114. function OnProcessSpell(unit, spell)
  115.     if unit.isMe and wUsed == false and spell and spell.name:find("BurningAgony") then
  116.         wUsed = true
  117.     elseif unit.isMe and wUsed == true and spell and spell.name:find("BurningAgony") then
  118.         wUsed = false  
  119.     end
  120. end
  121.  
  122. function OnDraw()
  123.     if DMConfig.drawcircles and not myHero.dead then
  124.         DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x990099)
  125.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x003300)
  126.         DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x003300)
  127.         if ts.target ~= nil then
  128.             for j=0, 10 do
  129.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  130.             end
  131.             if predic ~= nil then
  132.                 DrawCircle(predic.x, predic.y, predic.z, pRange, 0x000099)
  133.             end
  134.         end
  135.     end
  136. end
  137.  
  138. function OnSendChat(msg)
  139.     ts:OnSendChat(msg, "pri")
  140. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement