Advertisement
Guest User

Yi.lua

a guest
Sep 1st, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.41 KB | None | 0 0
  1. if GetObjectName(GetMyHero()) ~= "MasterYi" then return
  2. else
  3.  
  4. castQ=false
  5.  
  6. Q_ON = {
  7. ["Aatrox"]      = {0,_R},
  8. ["Ahri"]        = {0,_E},
  9. ["Akali"]       = {0,_Q},
  10. ["Alistar"]     = {0,_Q,_W},
  11. ["Amumu"]       = {0,_R},
  12. ["Anivia"]      = {0,_E},
  13. ["Annie"]       = {0,_R},
  14. ["Ashe"]        = {0,_R},
  15. ["Azir"]        = {0,_R},
  16. ["Blitzcrank"]  = {0,_Q},
  17. ["Brand"]       = {0,_R},
  18. ["Caitlyn"]     = {0,_R},
  19. ["Cassiopeia"]  = {0,_R},
  20. ["Darius"]      = {0,_R},
  21. ["Draven"]      = {0,_R},
  22. ["Elise"]       = {0,_E},
  23. ["Fizz"]        = {0,_R},
  24. ["Garen"]       = {0,_R},
  25. ["Gragas"]      = {0,_E},
  26. ["Graves"]      = {0,_R},
  27. ["Hecarim"]     = {0,_R},
  28. ["JarvanIV"]    = {0,_R},
  29. ["Jinx"]        = {0,_R},
  30. ["Kassadin"]    = {0,_R},
  31. ["Katarina"]    = {0,_Q},
  32. ["KhaZix"]      = {0,_E},
  33. ["LeeSin"]      = {0,_R},
  34. ["Lissandra"]   = {0,_R},
  35. ["Lulu"]        = {0,_W},
  36. ["Lucian"]      = {0,_E},
  37. ["Lux"]         = {0,_Q},
  38. ["Malphite"]    = {0,_R},
  39. ["Malzahar"]    = {0,_R},
  40. ["Morgana"]     = {0,_R},
  41. ["Nautilus"]    = {0,_R},
  42. ["Orianna"]     = {0,_R},
  43. ["Pantheon"]    = {0,_W},
  44. ["Quinn"]       = {0,_Q,_E},
  45. ["Rammus"]      = {0,_E},
  46. ["RekSai"]      = {0,_E},
  47. ["Renekton"]    = {0,_W},
  48. ["Rumble"]      = {0,_R},
  49. ["Ryze"]        = {0,_W},
  50. ["Sejuani"]     = {0,_R},
  51. ["Shaco"]       = {0,_Q},
  52. ["Shen"]        = {0,_E},
  53. ["Singed"]      = {0,_E},
  54. ["Skarner"]     = {0,_R},
  55. ["Sona"]        = {0,_R},
  56. ["Syndra"]      = {20,_R},
  57. ["Talon"]       = {0,_R},
  58. ["Taric"]       = {0,_E},
  59. ["Teemo"]       = {0,_Q},       --FUCK YOU
  60. ["Thresh"]      = {0,_E},
  61. ["Tryndamere"]  = {0,_E},
  62. ["TwistedFate"] = {0,"goldcardpreattack"},      --special
  63. ["Urgot"]       = {0,_R},
  64. ["Varus"]       = {0,_R},
  65. ["Vayne"]       = {0,_E},
  66. ["Veigar"]      = {0,_R},
  67. ["Vi"]          = {0,_R},
  68. ["Vladimir"]    = {0,_R},
  69. ["Warwick"]     = {0,_R},
  70. ["Xerath"]      = {0,_E},
  71. ["Trundle"]     = {0,_R},
  72. ["Tristana"]    = {0,_W},
  73. ["Yasuo"]       = {0,"yasuoq3","yasuoq3w"},     --special
  74. ["Zyra"]        = {0,_E},
  75. ["Riven"]       = {0,"rivenizunablade"}
  76.  
  77. --Plz rework me \|/
  78. --["Nocturne"]  = {0,_R},
  79. --["Karthus"]       = {3000,_R},
  80. --["Zed"]           = {0,_R},
  81. --["Jax"]           = {1000,_E},
  82. --["Rengar"]        = {0,_Q}
  83. }
  84.  
  85. -- Menu
  86. Config = scriptConfig("Yi", "Yi")
  87. Config.addParam("Q", "Use awesome Q", SCRIPT_PARAM_ONOFF, true)
  88. Config.addParam("E", "Use E", SCRIPT_PARAM_ONOFF, true)
  89.  
  90.  
  91. -- Start
  92. OnLoop(function(myHero)
  93.     local unit = GetTarget(1500, DAMAGE_NORMAL)
  94.     if not IsImmune(unit) then
  95.         if delay and delay<=GetTickCount() and ValidTarget(unit,GetCastRange(myHero,_Q)) and castQ and Config.Q and CanUseSpell(myHero, _Q) then
  96.             PrintChat("USED Q")
  97.             CastTargetSpell(unit,_Q)
  98.             castQ=false
  99.         end
  100.         if ValidTarget(unit,GetCastRange(myHero,_E)) and CanUseSpell(myHero, _E) and Config.E then
  101.             CastSpell(_E)
  102.         end
  103.     end
  104. delay=false
  105. end)
  106.  
  107.  
  108. OnProcessSpell(function(unit, spellProc)
  109.     if GetTeam(unit) ~= GetTeam(myHero) and GetObjectType(unit) == Obj_AI_Hero and Q_ON[GetObjectName(unit)] and ValidTarget(unit,GetCastRange(myHero,_Q)*1.5) then
  110. --      PrintChat(GetObjectType(unit)..":"..spellProc.name)                     --DEBUG
  111.        
  112.         for n,slot in pairs(Q_ON[GetObjectName(unit)]) do
  113.             if n==1 then
  114.                 delay=slot
  115.             elseif n>1 then
  116.                 if slot=="_Q" or slot=="_W" or slot=="_E" or slot=="_R" then
  117.                 --  PrintChat("Looking for "..GetCastName(unit,slot))           --DEBUG
  118.                     if spellProc.name==GetCastName(unit,slot) then
  119.                         PrintChat("Q'd on "..spellProc.name.." with "..delay.."ms delay")
  120.                         castQ=true
  121.                         delay=GetTickCount()+delay 
  122.                     end
  123.                 else
  124.                     if  spellProc.name==slot then
  125.                         castQ=true
  126.                         delay=GetTickCount()
  127.                     end
  128.                 end
  129.             end
  130.  
  131.         end
  132.     end
  133. end)
  134.  
  135.  
  136. PrintChat("Yi Loaded")
  137. PrintChat("Enjoy your game - Logge")
  138. end -- End script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement