Advertisement
Kevinkev

NasusQ1.3.lua

Dec 25th, 2012
3,871
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.70 KB | None | 0 0
  1. --[[
  2. Nasus Q Farmer 1.3
  3. by Kevinkev
  4.  
  5.  
  6. Credits to eXtragoZ for the Q bonus counter, stop after Q, display info and them circles. ^__^
  7.  
  8.  
  9. Made by requests
  10.  
  11. ]]--
  12.  
  13. if myHero.charName ~= "Nasus" then return end
  14. local myObjectsTable = {}
  15.  
  16. function OnLoad()
  17.    for i = 0, objManager.maxObjects, 1 do
  18.           local object = objManager:GetObject(i)
  19.           if objectIsValid(object) then table.insert(myObjectsTable, object) end
  20.    end
  21. --Configuration--
  22. FarmQHK = 90 -- Z is the default key
  23. AutoWalkHK = 85 --U
  24. ScanRange = 500 --This is the range it reacts to auto walk
  25.  
  26. --No touchy these variables
  27. qrng = 125 --Nasus autoatk range
  28. QBonus = 0
  29. lastSiphoning = 0
  30. killedcount = 0
  31.  
  32.  
  33. --Items
  34. DFGSlot, HXGSlot, BWCSlot, shureliasSlot, SheenSlot, TrinitySlot, LichBaneSlot, IceBornSlot = nil, nil, nil, nil, nil, nil, nil, nil
  35.  
  36.  
  37. --Menu
  38.  
  39. WConfig = scriptConfig("Nasus Q Farmer 1.3","SusanFarm")
  40. --Displays the siphoning strike information.
  41. WConfig:addParam("SiphInfo", "Display Siphoning info", SCRIPT_PARAM_ONOFF, true)
  42. --AutoWalk AutoFarm
  43. WConfig:addParam("AutoWalk", "Automatic Walking", SCRIPT_PARAM_ONKEYTOGGLE, false, AutoWalkHK)
  44. WConfig:addParam("AutoFarm", "Automatic Farming", SCRIPT_PARAM_ONKEYTOGGLE, true, FarmQHK)
  45. --Shows current State
  46. WConfig:permaShow("AutoWalk")
  47. WConfig:permaShow("AutoFarm")
  48.  
  49.  
  50. PrintChat(" >> Nasus Q Loaded")
  51. end
  52.  
  53. function objectIsValid(object)
  54.    return object and object.valid and object.name:find("Minion_") and object.team ~= myHero.team and object.dead == false
  55. end
  56.  
  57. function OnTick()
  58.  
  59. DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, IceBornSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100), GetInventorySlotItem(3025)
  60.  
  61.     QREADY = myHero:CanUseSpell(_Q) == READY
  62.     if WConfig.AutoFarm then
  63.         if GetTickCount()-lastSiphoning<=100 then myHero:StopPosition() end
  64.           for i,minionObjectI in ipairs(myObjectsTable) do
  65.           if objectIsValid(minionObjectI) then
  66.            
  67.             --Calculate damage
  68.             local hitdamage = getDmg("AD",minionObjectI,myHero) --base
  69.             itemDamage = (SheenSlot and hitdamage or 0) + (TrinitySlot and hitdamage*1.5 or 0) + (LichBaneSlot and getDmg("LICHBANE",enemy,myHero) or 0) + (IceBornSlot and hitdamage*1.25 or 0)
  70.             damage = myHero:CalcDamage(minionObjectI, QBonus) + getDmg("Q",minionObjectI,myHero) + itemDamage
  71.            
  72.                 if myHero:GetDistance(minionObjectI) < qrng + ScanRange and QREADY and minionObjectI.health <= damage then
  73.                     --PrintChat(tostring(minionObjectI.health))
  74.                     if WConfig.AutoWalk == true then
  75.                         myHero:MoveTo(minionObjectI.x,minionObjectI.z)
  76.                     end
  77.                     if myHero:GetDistance(minionObjectI) < qrng + 100 and minionObjectI.dead ==false then
  78.                         CastSpell(_Q)
  79.                         myHero:Attack(minionObjectI)
  80.                     end
  81.                 end
  82.  else table.remove(myObjectsTable, i) i = i - 1
  83.             end
  84.         end
  85.     end
  86. end
  87.  
  88.  
  89. function OnCreateObj(object)
  90.    if objectIsValid(object) then table.insert(myObjectsTable, object) end
  91.     if object ~= nil and object.name:find("GoldAquisition") then
  92.         if GetTickCount()-lastSiphoning <= 400 then
  93.             killedcount = killedcount+1
  94.             QBonus = killedcount*3
  95.         end
  96.     end
  97. end
  98.  
  99. function OnProcessSpell(unit, spell)
  100.     if unit.isMe and spell.name == "SiphoningStrikeAttack" then
  101.         lastSiphoning = GetTickCount()
  102.     end
  103. end
  104. function OnDraw()
  105.     if WConfig.SiphInfo then
  106.     DrawText("Siphoning last hits: "..killedcount.." Bonus Dmg: "..QBonus, 20, 100, 100, 0xFFFFFF00)
  107.     end
  108.     DrawCircle(myHero.x, myHero.y, myHero.z, ScanRange, 0xFF0000)
  109.    
  110.     SC__OnDraw()
  111. end
  112.  
  113. function OnWndMsg(msg, key)
  114.     SC__OnWndMsg(msg,key)
  115. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement