Advertisement
Kevinkev

NasusQ1.2.lua

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