Quote Originally Posted by kamilqq View Post
Never made hotkeys script before, so i was looking at the example at Update thread.
The main thing we care is that it works well.
That hotkeys thing looks well for manualy playin.
Enjoy your code. :P

Code:
local spells = {"Utori Bomb Vis", "Utori Bomb Flam", "Exevo Vort Lux", "Exori Pyro"}
local runeid = 3154
local dist = 7

for name, value in pairs(Hotkeys) do
    if (type(value) == "number") then
        if (not Hotkeys.Register(value)) then
            print("Failed to register hotkey %d", value)
        end
    end
end





local spellsOnUse = function()
local creature = Creature.GetByID(Self.TargetID())
local i = 1
while (creature:isValid() and creature:isAlive() and (creature:DistanceFromSelf() <= dist) and creature:isTarget()) do
Self.Cast(spells[i])
Self.UseItemWithTarget(runeid)
i = i + 1
wait(2010)
if (i > 4) then i = 1 end
end
end

  
  
function pressHandler(key, control, shift)
    if key == Hotkeys.F1 then
    	spellsOnUse()
    end
end
  
  
function releaseHandler(key, control, shift)
	-- not needed i think
end
  
  
Hotkeys.AddPressHandler(pressHandler)
Hotkeys.AddPressHandler(releaseHandler)
  

Hotkeys.AddPressHandler(function(key)
    if (key == Hotkeys.DELETE) then
        for i = 1, 255 do
            UnRegisterHotkey(i)
        end
    end
end)
Thanks for helping me out, but i get this error:
Error: bad argument #1 to 'pairs' (table expected, got nil)

Also which hotkey is it set to and where do I change it?