Guest User

Untitled

a guest
Jul 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.22 KB | None | 0 0
  1. HK=32 --spacebar
  2.  
  3.  
  4. DFGId = 3128
  5.  
  6.  
  7. scriptActive = false
  8.  
  9. function Timer(tick)
  10.  
  11.     invSlot = findItemSlotInInventory(DFGId)
  12.  
  13.     local players = GetHeroCount()
  14.  
  15.     for i=1, players, 1 do
  16.         local target = GetHero(i)
  17.  
  18.    
  19.  
  20.         x,y,z = GetMousePosition()
  21.  
  22.         if target ~= nil and target.team == TEAM_ENEMY and scriptActive == true and player:GetDistanceTo(target) < 625 then
  23.             player:UseSpell(invSlot, findHeroNearestMouse(players))
  24.             player:UseSpell(_Q, findHeroNearestMouse(players))
  25.             player:UseSpell(_W, findHeroNearestMouse(players))
  26.             player:UseSpell(_E, player)
  27.             player:UseSpell(_R, findHeroNearestMouse(players))
  28.            
  29.         end
  30.         end
  31. end
  32.    
  33. function findHeroNearestMouse(players)
  34.     local closest
  35.     for i=1, players, 1 do
  36.         local target = GetHero(i)
  37.         if target ~= nil then
  38.             if (distanceFromMouse(target) < distanceFromMouse(closest) or closest == nil) then
  39.                 closest = target
  40.             end
  41.         end
  42.     end
  43.     return closest
  44. end
  45.  
  46. function Hotkey(msg,key)
  47.     if msg == KEY_DOWN then
  48.         --key down
  49.         if key == HK then
  50.             scriptActive = true
  51.         elseif key == qMinionKey then
  52.             if qMinionsActive then
  53.                 qMinionsActive = false
  54.                 PrintChat(" >> Auto Q minions disabled!")
  55.             else
  56.                 qMinionsActive = true
  57.                 PrintChat(" >> Auto Q minions enabled!")
  58.             end
  59.         end
  60.     else
  61.         if key == HK then
  62.             scriptActive = false
  63.         end
  64.     end
  65. end
  66.  
  67. function findItemSlotInInventory( item )
  68.     local ItemSlot = {ITEM_SLOT_1,ITEM_SLOT_2,ITEM_SLOT_3,ITEM_SLOT_4,ITEM_SLOT_5,ITEM_SLOT_6,}
  69.     for i=1, 6, 1 do
  70.         if player:GetInventorySlot(ItemSlot[i]) == item then return ItemSlot[i] end
  71.     end
  72. end
  73.    
  74. function distanceFromMouse(target)
  75.     x,y,z = GetMousePosition()
  76.     if target ~= nil then
  77.         return math.floor(math.sqrt((target.x-x)*(target.x-x) + (target.z-z)*(target.z-z)))
  78.     else return 5000
  79.     end
  80. end
  81.  
  82.  function Drawer()
  83.     if player.dead then return end
  84.     DrawCircle(650,player.x, player.y, player.z)
  85.    end
  86.  
  87. function Load()
  88.     if player.charName ~= "Annie" then
  89.         PrintChat(" >> NO Leblanc")
  90.         script:Unload()
  91.     else
  92.         script.timerCallback = {name = "Timer", interval = 100 }
  93.         script.keyCallback = "Hotkey"
  94.         PrintChat(" >> Annie Helper loaded!")
  95.     end
  96. end
Add Comment
Please, Sign In to add comment