This is the code I pasted in my action list is there something wrong in it? because it didnt do nothing I tried aiming it manually to see if at least he casted the spells but nothing :/ I had the action enabled and everything do I need a knight to group monsters or someting? :# whats up? 
Code:
--------Action by Felipepiva--------
local Creaturestohur = {"Vampire", "Demon Skeleton","Elder Bonelord", "Crypt Shambler"}
--DO NOTHING DOWN
local EAST = positive(posx + 1)
local WEST = positive(posx - 1)
local NORTH = positive(posy - 1)
local SOUTH = positive(posy + 1)
if target.name == unpack(Creaturestohur) then
if target.x ~= posx and target.y ~= posy then
if target.x < posx and target.y > posy then
local rand = math.random(1,2)
if (rand == 1) and tilewalkable(posx , NORTH, posz) == true then move("n")
else move("e")
end
if (rand == 2) and tilewalkable(EAST , posy, posz) == true then move("e")
else move("n")
end
end
if
target.x < posx and target.y < posy then
local rand = math.random(1,2)
if (rand == 1) and tilewalkable(posx , NORTH, posz) == true then move("n")
else move("w")
end
if (rand == 2) and tilewalkable(WEST , posy, posz) == true then move("w")
else move("n")
end
end
if
target.x > posx and target.y > posy then
local rand = math.random(1,2)
if (rand == 1) and tilewalkable(posx , SOUTH, posz) == true then move("s")
else move("e") end
if (rand == 2) and tilewalkable(EAST , posy, posz) == true then move("e")
else move("s")
end
end
if
target.x > posx and target.y < posy then
local rand = math.random(1,2)
if (rand == 1) and tilewalkable(posx , SOUTH, posz) == true then move("s")
else move("w")
end
if (rand == 2) and tilewalkable(WEST , posy, posz) == true then move("w")
else move("s")
end
end
end
if (target.x == posx) or (target.y == posy) then turn(target.direction) wait(50,55)
if cancast("exevo vis hur") then cast("exevo vis hur") wait(1000)
elseif cancast("exevo gran vis lux") then cast("exevo gran vis lux") wait(50,55)
elseif cancast("exori gran vis") then cast("exori gran vis") wait(50,55)
else cast("exori vis") wait(550)
end
end
end