AnonymousBOL

SAC - Twisted Fate plugin v1.0

Jul 12th, 2013
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.40 KB | None | 0 0
  1. if myHero.charName ~= "TwistedFate" then return end
  2.  
  3. function PluginOnLoad()
  4.     --AutoCarry.PluginMenu:addParam("throwQ", "Harras enemy", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A")) -- useless, too hard to get someone hit by bot pred :c
  5.     AutoCarry.PluginMenu:addParam("autoQ", "Automaticly throw Q on stuned targets", SCRIPT_PARAM_ONOFF, true)
  6.     AutoCarry.PluginMenu:addParam("selectgold", "Select Gold Card", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("W"))
  7.     AutoCarry.PluginMenu:addParam("selectblue", "Select Blue Card", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("E"))
  8.     AutoCarry.PluginMenu:addParam("selectred", "Select Red Card", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
  9.     AutoCarry.PluginMenu:addParam("drawCircle", "Draw Q range", SCRIPT_PARAM_ONOFF, true)
  10.     AutoCarry.PluginMenu:addParam("drawArrow", "Draw arrow to low hp enemies", SCRIPT_PARAM_ONOFF, true)
  11.     AutoCarry.PluginMenu:addParam("selectgoldult", "Select gold card after ult", SCRIPT_PARAM_ONOFF, true)
  12.     --AutoCarry.PluginMenu:addParam("drawQpred", "Draw Q prediction on harras", SCRIPT_PARAM_ONOFF, true) -- cant do this with SAC I think :C
  13.     AutoCarry.PluginMenu:permaShow("autoQ")
  14.     PrintChat("<font color='#E97FA5'>>> TF Helper v2.0 - Rewritten as SAC Plugin!</font>")
  15.     AutoCarry.SkillsCrosshair.range = 1450
  16.     AutoCarry.OverrideCustomChampionSupport = true
  17.     SelectedCard = false
  18. end
  19.  
  20. function PluginOnTick()
  21.     if NextCheck ~= nil then
  22.         if GetTickCount() > NextCheck then
  23.             if myHero:CanUseSpell(_W) == READY then
  24.                 if AutoCarry.PluginMenu.selectgold then if myHero:GetSpellData(_W).name == "goldcardlock" then CastSpellEx(_W) elseif myHero:GetSpellData(_W).name == "PickACard" then CastSpellEx(_W) end end
  25.                 if AutoCarry.PluginMenu.selectblue then if myHero:GetSpellData(_W).name == "bluecardlock" then CastSpellEx(_W) elseif myHero:GetSpellData(_W).name == "PickACard" then CastSpellEx(_W) end end
  26.                 if AutoCarry.PluginMenu.selectred then if myHero:GetSpellData(_W).name == "redcardlock" then CastSpellEx(_W) elseif myHero:GetSpellData(_W).name == "PickACard" then CastSpellEx(_W) end end
  27.             end
  28.             if SelectCardForUlt == true then
  29.                 if myHero:GetSpellData(_W).name == "goldcardlock" then
  30.                     CastSpellEx(_W)
  31.                     SelectCardForUlt = false
  32.                 elseif myHero:GetSpellData(_W).name == "PickACard" then
  33.                     CastSpellEx(_W)
  34.                 end
  35.             end
  36.             NextCheck = GetTickCount() + 250
  37.         end
  38.     else
  39.         NextCheck = 0
  40.     end
  41.     if AutoCarry.PluginMenu.autoQ then
  42.         for _, enemy in pairs(AutoCarry.EnemyTable) do
  43.             if ValidTarget(enemy) and not enemy.canMove and GetDistance(enemy) < 1450 then
  44.                 CastSpell(_Q, enemy.x, enemy.z)
  45.             end
  46.         end
  47.     end
  48. end
  49.  
  50. function PluginOnProcessSpell(unit, spell)
  51.     if unit.isMe and spell.name == "gate" then if AutoCarry.PluginMenu.selectgoldult then SelectCardForUlt = true end end
  52. end
  53.  
  54. function PluginOnDraw()
  55.     if not myHero.dead and AutoCarry.PluginMenu.drawCircle then
  56.         DrawCircle(myHero.x, myHero.y, myHero.z, 1450, 0x540069)
  57.     end
  58.     if AutoCarry.PluginMenu.drawArrow and myHero:CanUseSpell(_R) == READY then
  59.         for _, enemy in pairs(AutoCarry.EnemyTable) do
  60.             if ValidTarget(enemy) and enemy.health < enemy.maxHealth*0.25 and GetDistance(enemy) < 6000 then
  61.                 local startPos = Vector(myHero.x,myHero.y,myHero.z)
  62.                 local endPos = Vector(enemy.x, enemy.y, enemy.z)
  63.                 DrawArrows(D3DXVECTOR3(startPos.x,startPos.y,startPos.z),D3DXVECTOR3(endPos.x,endPos.y,endPos.z),100,0xE97FA5,100)
  64.             end
  65.         end
  66.     end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment