
Untitled
By: a guest on
May 20th, 2012 | syntax:
Lua | size: 1.76 KB | hits: 20 | expires: Never
--[[
AutoCrit
v2.0
Written by PedobearIGER
Credits: jbman for some basic stuff, Apple for making a script that works for all champions and some other stuff I will add in future updates and Zynox for having the universal-idea as wel
]]
--[[ Config ]]
HK=32 --hold spacebar to win
--HE=16 --hold shift to win
A=3 --try how many times
local auto = false
B=0
function Hotkey( msg, keycode )
if keycode == HK and msg == KEY_DOWN then
script.processSpellCallback = "Spell"
auto = true
elseif keycode == HK and msg == KEY_UP then
script.processSpellCallback = nil
auto = false
--elseif keycode == HE and msg == KEY_DOWN then
--auto = true
--elseif keycode == HE and msg == KEY_UP then
--auto = false
end
end
function Spell(object,spellName)
if object ~= nil and object == player then
if string.find( spellName, "BasicAttack") and B<A then
player:MoveTo(player.x,player.z)
B = B+1
else
B = 0
end
end
end
function Timer(tick)
if auto then
local x, y, z = GetMousePosition()
local closestDistance, closest = math.huge, nil
for i = 1, GetHeroCount(), 1 do
local target = GetHero(i)
if target and target.visible and target.team == TEAM_ENEMY then
local currentDistance = math.sqrt((target.x - x) ^ 2 + (target.z - z) ^ 2)
if currentDistance < closestDistance then
closestDistance = currentDistance
closest = target
end
end
end
player:Attack(closest)
end
end
function Load()
script.timerCallback = { name = "Timer", interval = 10 }
script.keyCallback = "Hotkey"
PrintChat(" >> AutoCrit 2.0 loaded!")
end