AnonymousBOL

AutoCrit - Test

Jul 15th, 2013
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.93 KB | None | 0 0
  1. --[[
  2.  
  3. function OnAnimation(unit, animation)
  4.     --if unit.isMe and animation ~= "Run" then PrintChat(animation) end
  5.  
  6.     if not myHero.dead then
  7.  
  8.         if unit.isMe and animation ~= "Crit" or unit.isMe and animation == "Run" or unit.isMe and animation == "Idle1" or unit.isMe and animation == "Idle2" then
  9.  
  10.             if nextAA > GetTickCount() then
  11.  
  12.                 PrintChat("notCrit")
  13.  
  14.                 if LastTarget ~= nil then
  15.  
  16.                     myHero:MoveTo(myHero.x, myHero.z)
  17.  
  18.                     myHero:Attack(LastTarget)
  19.  
  20.                     nextAA = GetTickCount() + 100
  21.  
  22.                 end
  23.  
  24.             end
  25.  
  26.         end
  27.  
  28.     end
  29. end
  30.  
  31. function OnLoad()
  32.     PrintChat("AUTOCRIT TEST VERSION LOADED")
  33.  
  34.     LastTarget = nil
  35.  
  36.     nextAA = 0
  37. end
  38.  
  39.  
  40.  
  41. function OnTick()
  42.  
  43.     if LastTarget ~= nil then if LastTarget.dead then LastTarget = nil end end
  44.  
  45. end]]
  46.  
  47.     CritScriptEnabled = true
  48.     AttackDone = false
  49.     AttackTick = 0
  50.     LastTarget = nil
  51.     InterputedAA = 0
  52.    
  53. function OnProcessSpell(unit, spell)
  54.     if unit.isMe then if spell.target ~= nil and not spell.target.isMe then LastTarget = spell.target end end
  55. end
  56.  
  57. function OnAnimation(unit, animation)
  58.     if unit.isMe and animation == "Attack1" and LastTarget ~= nil and animation ~= "Crit" or unit.isMe and animation == "Attack2" and LastTarget ~= nil and animation ~= "Crit" then
  59.         if unit.critChance > -1 then -- unit.critChance is broken.
  60.             if InterputedAA < 2 then -- Anti noncrits wave
  61.                 myHero:HoldPosition()
  62.                 AttackTick = GetTickCount() -- + 250 -- useless.
  63.                 AttackDone = false
  64.                 PrintChat("Interputting AA")
  65.                 InterputedAA = InterputedAA + 1
  66.             else
  67.                 PrintChat("TooManyInterputs, letting normal AA")
  68.                 InterputedAA = 0
  69.             end
  70.         else
  71.             PrintChat("Too low critchance, not intrputing AA.")
  72.         end
  73.     end
  74.     if unit.isMe then PrintChat(animation) end
  75. end
  76.  
  77. function OnTick()
  78.     if LastTarget ~= nil and LastTarget.dead then LastTarget = nil end
  79.     if AttackDone == false and GetTickCount() > AttackTick and LastTarget ~= nil then
  80.         myHero:Attack(LastTarget)
  81.     end
  82. end
Advertisement
Add Comment
Please, Sign In to add comment