Guest User

Untitled

a guest
Dec 13th, 2012
6,446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. --[[
  2.  
  3.     AutoMorgana by x7x
  4.     My first script with TS :)
  5.  
  6. ]]
  7.  
  8. if myHero.charName == "Morgana" then
  9.  
  10.     require "AllClass"
  11.     require "spellDmg"
  12.     local QRange = 1300
  13.     local QWidth = 200
  14.     local ts = TargetSelector(TARGET_LOW_HP,QRange,DAMAGE_MAGIC,false)
  15.     local tq = TargetPrediction(QRange, 1.2, 0, 300, 50)
  16.     local DFGSSlot = nil
  17.     local DFGReady = false
  18.    
  19.     function OnLoad()
  20.         MorgConfig = scriptConfig("Morgana Combo", "MorganaCombo")
  21.         MorgConfig:addParam("active", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  22.         MorgConfig:addParam("useult", "Use Ultimate", SCRIPT_PARAM_ONOFF, true)
  23.         MorgConfig:permaShow("active")
  24.         ts.name = "Morgana"
  25.         MorgConfig:addTS(ts)
  26.         PrintChat(">> AutoMorgana loaded! Press shift to configure.")
  27.     end
  28.    
  29.     function OnTick()
  30.         ts:update()
  31.         DFGSlot = GetInventorySlotItem(3128)
  32.         DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  33.         WReady = (myHero:CanUseSpell(_W) == READY)
  34.         RReady = (myHero:CanUseSpell(_R) == READY)
  35.         TargetPrediction__OnTick()
  36.         if ts.target ~= nil and MorgConfig.active then
  37.             qpred = tq:GetPrediction(ts.target)
  38.             if qpred ~= nil then
  39.                 CastSpell(_Q, qpred.x, qpred.z)
  40.             end
  41.         end
  42.        
  43.         if myHero:CanUseSpell(_Q) == COOLDOWN and ts.target ~= nil and MorgConfig.active and ts.target.canMove == false then
  44.             myHero:Attack(ts.target)
  45.             if GetDistance(ts.target) < 750 then
  46.                 if DFGReady then CastSpell(DFGSlot, ts.target) end
  47.             end
  48.             myHero:Attack(ts.target)
  49.             if GetDistance(ts.target) < 900 then
  50.                 if WReady then CastSpell(_W,ts.target.x,ts.target.z) end
  51.             end
  52.             myHero:Attack(ts.target)
  53.             if GetDistance(ts.target) < 600 and MorgConfig.useult then
  54.                 if RReady then CastSpell(_R) end
  55.             end
  56.             myHero:Attack(ts.target)
  57.         end
  58.     end
  59.    
  60.     function OnUnload()
  61.         PrintChat(">> AutoMorgana unloaded!")
  62.     end
  63.    
  64.     function OnDraw()
  65.         SC__OnDraw()
  66.     end
  67.    
  68.     function OnWndMsg(msg,key)
  69.         SC__OnWndMsg(msg,key)
  70.     end
  71.    
  72.     function OnSendChat(msg)
  73.         TargetSelector__OnSendChat(msg)
  74.         ts:OnSendChat(msg, "pri")
  75.     end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment