Advertisement
H3stia

Lux.lua

Feb 24th, 2013
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.68 KB | None | 0 0
  1. -- AUTO LUX HELPER v1.1 --
  2. if myHero.charName ~= "Lux" then return end
  3.  
  4. local ts = TargetSelector(TARGET_LESS_CAST,1200,DAMAGE_MAGIC,false)
  5. local tp = TargetPrediction(1200,1.2,265)
  6. local hp = TargetPrediction(1200,1,240)
  7. local RDmg = 0
  8. local LuxE = {}
  9.  
  10. local Junngle = {}
  11.  
  12. function OnLoad()
  13.     --TFConfig = scriptConfig("TF Helper", "TFHelper")
  14.     LuxConfig = scriptConfig("Lux Combo", "LuxCombo")
  15.     LuxConfig:addParam("active", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  16.     LuxConfig:addParam("harras", "Harras", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  17.     LuxConfig:addParam("drawpred", "Draw Prediciton", SCRIPT_PARAM_ONOFF, false)
  18.     LuxConfig:addParam("junngle", "Autosteal with ult", SCRIPT_PARAM_ONOFF, true)
  19.     LuxConfig:addParam("autoE", "AutoE if can hit enemy", SCRIPT_PARAM_ONOFF, true)
  20.     LuxConfig:permaShow("active")
  21.     LuxConfig:permaShow("harras")
  22.     PrintChat("<font color='#E97FA5'>>> Lux Helper loaded!</font>")
  23. end
  24.  
  25. function OnTick()
  26.     ts:update()
  27.     if ts.target ~= nil then
  28.         if ts.target.visible == true and LuxConfig.active then
  29.             qpred = tp:GetPrediction(ts.target)
  30.             if qpred ~= nil then
  31.                 QReady = (myHero:CanUseSpell(_Q) == READY) -- Check if Q is ready to cast.
  32.                 DFGSlot = GetInventorySlotItem(3128) -- Check if we have DFG and return his slot.
  33.                 DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  34.                 if DFGReady then CastSpell(DFGSlot, ts.target) end
  35.                 if QReady then CastSpell(_Q, qpred.x, qpred.z) end
  36.             end
  37.         end
  38.         if not ts.target.canMove and LuxConfig.active then
  39.             EReady = (myHero:CanUseSpell(_E) == READY)
  40.             RReady = (myHero:CanUseSpell(_R) == READY)
  41.             if EReady then CastSpell(_E, ts.target.x, ts.target.z) end
  42.             if RReady then CastSpell(_R, ts.target.x, ts.target.z) end
  43.         end
  44.         if LuxConfig.harras then
  45.             epred = hp:GetPrediction(ts.target)
  46.             if epred ~= nil then
  47.                 EReady = (myHero:CanUseSpell(_E) == READY)
  48.                 if EReady then CastSpell(_E,epred.x,epred.z) end
  49.             end
  50.         end
  51.         AllachAkbar()
  52.     end
  53.     if LuxConfig.junngle then
  54.         if not myHero.dead then
  55.             if Vilemaw ~= nil then checkMonster(Vilemaw) end
  56.             if Nashor ~= nil then checkMonster(Nashor) end
  57.             if Dragon ~= nil then checkMonster(Dragon) end
  58.             if Golem1 ~= nil then checkMonster(Golem1) end
  59.             if Golem2 ~= nil then checkMonster(Golem2) end
  60.             if Lizard1 ~= nil then checkMonster(Lizard1) end
  61.             if Lizard2 ~= nil then checkMonster(Lizard2) end
  62.         end
  63.     end
  64. end
  65.  
  66. function AllachAkbar()
  67.     if LuxConfig.autoE then
  68.         if LuxE ~= nil then
  69.             if GetDistance(LuxE, ts.target) < 349 then
  70.                 CastSpell(_E)
  71.             end
  72.             --PrintChat("LuxDetected")
  73.         end
  74.     end
  75. end
  76.  
  77. function checkMonster(object)
  78.     if object ~= nil and not object.dead and object.x ~= nil then
  79.         if GetDistance(object) < 2999 then
  80.             RReady = (myHero:CanUseSpell(_R) == READY)
  81.             RDmg = getDmg("R", object, player)
  82.             --PrintChat(tostring(RDmg))
  83.             if object.health <= RDmg then
  84.                 if RReady then CastSpell(_R, object.x, object.z) end
  85.                 --PrintChat("CastingR")
  86.             end
  87.         end
  88.     end
  89. end
  90.  
  91. function OnDraw()
  92.     if not myHero.dead then
  93.         DrawCircle(myHero.x,myHero.y,myHero.z,1200,0x540069)
  94.         if LuxConfig.drawpred and ts.target ~= nil then
  95.             qpred = tp:GetPrediction(ts.target)
  96.             if qpred ~= nil then
  97.                 for j=0, 10 do
  98.                     DrawCircle(qpred.x,qpred.y,qpred.z,100 + j*1.5, 0x540069)
  99.                 end
  100.             end
  101.         end
  102.     end
  103. end
  104.  
  105. function OnCreateObj(obj) -- by eXtragoZ
  106.     if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  107.         if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  108.         elseif obj.name == "Worm12.1.1" then Nashor = obj
  109.         elseif obj.name == "Dragon6.1.1" then Dragon = obj
  110.         elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  111.         elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  112.         elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  113.         elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj end
  114.     end
  115.     if obj ~= nil and string.find(obj.name, "LuxLightstrike") then
  116.         LuxE = obj
  117.         --PrintChat("SetSpell")
  118.     end
  119. end
  120.  
  121. function OnDeleteObj(obj)
  122.     if obj ~= nil and obj.name ~= nil then
  123.         if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = nil
  124.         elseif obj.name == "Worm12.1.1" then Nashor = nil
  125.         elseif obj.name == "Dragon6.1.1" then Dragon = nil
  126.         elseif obj.name == "AncientGolem1.1.1" then Golem1 = nil
  127.         elseif obj.name == "AncientGolem7.1.1" then Golem2 = nil
  128.         elseif obj.name == "LizardElder4.1.1" then Lizard1 = nil
  129.         elseif obj.name == "LizardElder10.1.1" then Lizard2 = nil end
  130.     end
  131.     if obj ~= nil and string.find(obj.name, "LuxLightstrike") then
  132.         LuxE = nil
  133.         --PrintChat("RemoveSpell")
  134.     end
  135. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement