Advertisement
Guest User

Ryze-xkjtx-AA-In-Combos--R-Toggle.lua

a guest
Feb 26th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[       
  2.         Ryze Combo/Burst/W.R first combo made by TRUS v1.7c, ('AA and cast W/R first in combo' made by xkjtx)      
  3.             Combo hot-key = letter 'V'
  4.             Burst hot-key = Space bar
  5.             'W' combo with R(toggle) = letter 'S'
  6.             With moving to target(AA the target) while holding Spacebar or X only!...
  7.             Move To Mouse (will not AA while moving, but will cast all spells) Harass/W combo only!...
  8. Ult Hot-key to turn it off and on without going into the menu. Default key is letter X now...
  9. ]]--
  10.  
  11. if myHero.charName ~= "Ryze" then return end
  12.     local player = GetMyHero()
  13.     local qRange = 650
  14.     local wRange = 625
  15.     local eRange = 649 -- Real range is 675 -- lowered so E will cast after Q
  16.     local rRange = 675-- Higher if you want it on earlyer
  17.     local lastcast = _E -- Less ugly now
  18.  
  19.     local startAttackSpeed = 0.625
  20.     local lastBasicAttack = 0
  21.     local swingDelay = 0.15
  22.     local swing = 0
  23.  
  24.     local ts
  25.  
  26. --[[        Hot - keys      ]]
  27.     local hotRotate = string.byte("V") -- 86 -- V
  28.     local hotBurst = 32 -- Space Bar
  29.     local hotWonly = string.byte("S") -- 83 -- S
  30.     local hotUlt = string.byte("X") -- 88 -- X
  31.  
  32.     function OnLoad()
  33.         PrintFloatText(myHero,10,"Ryze Spammer v1.7c By TRUS - modded by xkjtx!")
  34.         DCConfig = scriptConfig("Ryze Combo v1.7c", "ryze-xkjtx-aa-in-combos-w-with-r")
  35.         DCConfig:addParam("scriptActive", "Rotation", SCRIPT_PARAM_ONKEYDOWN, false, hotRotate) -- V
  36.         DCConfig:addParam("burstActive", "Burst", SCRIPT_PARAM_ONKEYDOWN, false, hotBurst) --  Space
  37.         DCConfig:addParam("WonlyActive", "W combo", SCRIPT_PARAM_ONKEYDOWN, false, hotWonly) -- S
  38.         DCConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  39.         DCConfig:addParam("AllClass", "All class library", SCRIPT_PARAM_ONOFF, false)
  40.         DCConfig:addParam("MoveToMouse", "Move to Mouse: W combo", SCRIPT_PARAM_ONOFF, true) -- On by default( So you can harass early game :) )
  41.         DCConfig:addParam("UltActive", "Ult In W combo", SCRIPT_PARAM_ONKEYTOGGLE, false, hotUlt) -- Off by default( So you can harass early game :) )
  42.         DCConfig:permaShow("scriptActive")
  43.         DCConfig:permaShow("burstActive")
  44.         DCConfig:permaShow("WonlyActive")
  45.         DCConfig:permaShow("MoveToMouse")
  46.         DCConfig:permaShow("UltActive")
  47.         ts = TargetSelector(TARGET_LOW_HP,qRange+150,DAMAGE_MAGIC,true) -- so you can select target and focus
  48.         ts.name = "Ryze"
  49.         DCConfig:addTS(ts)
  50.         lastBasicAttack = os.clock()
  51.     end
  52.  
  53.     function doSpell(ts, spell, range)
  54.         if ts.target ~= nil and GetMyHero():CanUseSpell(spell) == READY then
  55.             CastSpell(spell, ts.target)
  56.         end
  57.     end
  58.  
  59.     function OnWndMsg(msg,key)
  60.         if not DCConfig.scriptActive and not DCConfig.burstActive and not DCConfig.WonlyActive then lastcast = _E end
  61.     end
  62.  
  63.     function OnProcessSpell(unit, spell)
  64.         --[[if unit.isMe and (spell.name:find("Attack") ~= nil) then
  65.             swing = 1
  66.             lastBasicAttack = os.clock()
  67.         end]]
  68.         if unit.isMe and spell and spell.name:find("BasicAttack") or spell.name:find("CritAttack") and spell.name ~= nil and string.find(spell.name, "attack") and (spell.name:find("Attack") ~= nil) then
  69.             swing = 1
  70.             lastBasicAttack = os.clock()
  71.         end
  72.     end
  73.  
  74.     function OnTick()
  75.         ts:update()
  76.         if ts.target ~= nil then
  77.             AttackDelay = 1/(myHero.attackSpeed*startAttackSpeed) -- 1/(myHero.attackSpeed*startAttackSpeed) -- Trying something new -- (1000/(myHero.attackSpeed/(1/startAttackSpeed)))/1000
  78.             if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
  79.                 swing = 0
  80.             end
  81.             if DCConfig.scriptActive or DCConfig.burstActive then
  82.                 if ts.target ~= nil and GetDistance(ts.target) < qRange+150 and swing == 0 then
  83.                     myHero:Attack(ts.target)
  84.                 end
  85.             end
  86.         end
  87.         if not myHero.dead and DCConfig.WonlyActive and ts ~= nil then
  88.             if DCConfig.MoveToMouse
  89.             then
  90.                 player:MoveTo(mousePos.x, mousePos.z) -- move to mouse(will not AA while moving, but will cast all spells)
  91.             end
  92.             if ts.target ~= nil and DCConfig.UltActive and myHero:CanUseSpell(_R) == READY and GetDistance(ts.target) <= rRange
  93.             then
  94.                 doSpell(ts, _R, rRange)
  95.                 lastcast = _E
  96.             elseif myHero:CanUseSpell(_W) == READY
  97.             then
  98.                 doSpell(ts, _W, wRange)
  99.                 lastcast = _W
  100.             elseif myHero:CanUseSpell(_Q) == READY
  101.             then
  102.                 doSpell(ts, _Q, qRange)
  103.                 lastcast = _Q
  104.             elseif myHero:CanUseSpell(_E) == READY
  105.             then
  106.                 doSpell(ts, _E, eRange)
  107.                 lastcast = _E
  108.             end
  109.         end
  110.         if not myHero.dead and DCConfig.scriptActive and myHero.cdr < -0.35 and ts ~= nil then
  111.             if myHero:CanUseSpell(_Q) == READY
  112.             then
  113.                doSpell(ts, _Q, qRange)
  114.                lastcast = _Q
  115.             elseif (lastcast == _Q or lastcast == _W) and myHero:CanUseSpell(_W) == READY
  116.             then
  117.                doSpell(ts, _W, wRange)
  118.                lastcast = _W
  119.             elseif (lastcast == _Q or lastcast == _E) and myHero:CanUseSpell(_E) == READY
  120.             then
  121.                doSpell(ts, _E, eRange)
  122.                lastcast = _E
  123.             end
  124.         elseif (not myHero.dead and myHero.cdr >= -0.35 and DCConfig.scriptActive and ts ~= nil) or DCConfig.burstActive and ts ~= nil then
  125.             if myHero:CanUseSpell(_Q) == READY
  126.             then
  127.                doSpell(ts, _Q, qRange)
  128.                lastcast = _Q
  129.             elseif (lastcast == _Q or lastcast == _W) and myHero:CanUseSpell(_W) == READY and ts ~= nil
  130.             then
  131.                doSpell(ts, _W, wRange)
  132.                lastcast = _W
  133.             elseif myHero:CanUseSpell(_E) == READY and myHero:CanUseSpell(_W) ~= READY and myHero:CanUseSpell(_Q) ~= READY and ts ~= nil
  134.             then
  135.                doSpell(ts, _E, eRange)
  136.                lastcast = _E
  137.             end
  138.         end
  139.     end
  140.  
  141.     function OnDraw()
  142.         if myHero.dead then
  143.             return
  144.         end
  145.         if DCConfig.drawcircles and not myHero.dead then
  146.             DrawCircle(myHero.x, myHero.y, myHero.z, rRange, 0x000099) -- blueish(Ult Range)
  147.             DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x0000CC) -- Greenish(W Range)
  148.             if ts.target ~= nil then
  149.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0x660066) -- purpleish(target prediction)
  150.             end
  151.         end
  152.     end
  153.  
  154.     function OnSendChat(msg)
  155.         ts:OnSendChat(msg, "pri")
  156.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement