i was trying with that
--AA
if getuseroption("SafeExori") then
init start
local Config = {
Monsters = {"Tarantula", "Giant Spider", "Mutated Bat"},
Players = {
Consider = true,
Distance = 10,
FloorDifference = 1,
SafeList = {"Bubble", "Eternal Oblivion"},
},
Spells = {
{Name = "exori gran", Amount = 4},
{Name = "exori", Amount = 2},
{Name = "exori min", Amount = 3},
{Name = "exori ico", Hppc = 10},
{Name = "exori hur", Hppc = 10},
{Name = "utito tempo", Amount = 5},
},
}
-- DO NOT CHANGE ANYTHING BELOW THIS LINE
local i, LastFloor, Exhaust, AreaConv = 1, $posz, 0, {["GFB"] = "3x3", ["WaveMedium"] = "smallwave", ["WaveVerySmall"] = "smallwave", ["WaveSmall"] = "smallwave", ["Front"] = "front", ["BeamBig"] = "bigbeam", ["BeamSmall"] = "smallbeam", ["WaveBig"] = "bigwave", ["Dist1"] = "1", ["Dist2"] = "2", ["Dist3"] = "3", ["Dist4"] = "4", ["Dist5"] = "5", ["Dist7"] = "7"}
table.lower(Config.Monsters)
while #Config.Spells >= i do
local info = spellinfo(Config.Spells[i].Name)
Config.Spells[i].Area = AreaConv[info.castarea] or info.castarea:lower()
Config.Spells[i].Attack = info.castmode:match("Target") ~= nil
if #info.words == 0 then
table.remove(Config.Spells, i)
else
if #Config.Spells[i].Area > 0 and table.find({"smallwave", "bigwave", "smallbeam", "bigbeam", "front"}, Config.Spells[i].Area) then
Config.Spells[i].NeedDirection = true
else
Config.Spells[i].NeedDirection = false
end
i = i + 1
end
end
function cancast(spell)
local info = spellinfo(spell)
if info.specialeffect:match("Strength") then
return not $strenghtened and cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
return cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
function findcreature(c)
local c = type(c) == 'userdata' and getcreaturebyid(c.id) or getcreaturebyname(c)
return c
end
init end
auto(200, 400)
if $posz ~= LastFloor then
LastFloor, Exhaust = $posz, $timems + 2000
return
end
if $timems > Exhaust then
for _, Spell in ipairs(Config.Spells) do
if cancast(Spell.Name) then
if Spell.Amount and (not Config.Players.Consider or paroundfloorignore(Config.Players.Distance, Config.Players.FloorDifference, unpack(Config.Players.SafeList)) == 0) then
local BestAmount, BestDir = 0, $self.dir
if Spell.NeedDirection then
for Dir, Amount in pairs({["n"] = 0, ["e"] = 0, ["s"] = 0, ["w"] = 0}) do
Amount = maroundspell(Spell.Area, Dir, unpack(Spell.Monsters or Config.Monsters))
if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
BestAmount, BestDir = Amount, Dir
end
end
else
BestAmount = Spell.Attack and maroundspell(Spell.Area, BestDir, unpack(Spell.Monsters or Config.Monsters)) or maround(1, unpack(Spell.Monsters or Config.Monsters))
end
if BestAmount >= Spell.Amount then
while $self.dir ~= BestDir do
turn(BestDir)
waitping()
end
cast(Spell.Name) waitping()
end
elseif Spell.Hppc and $attacked.dist <= (tonumber(Spell.Area) or -2) and table.find(Spell.Monsters or Config.Monsters, $attacked.name:lower()) and Spell.Hppc <= $attacked.hppc and $attacked.isshootable then
cast(Spell.Name)
waitping()
end
end
end
end
else
init start
local Config = {
Monsters = {"Tarantula", "Giant Spider", "Mutated Bat"},
Players = {
Consider = false,
Distance = 10,
FloorDifference = 1,
SafeList = {"Bubble", "Eternal Oblivion"},
},
Spells = {
{Name = "exori gran", Amount = 4},
{Name = "exori", Amount = 2},
{Name = "exori min", Amount = 3},
{Name = "exori ico", Hppc = 10},
{Name = "exori hur", Hppc = 10},
{Name = "utito tempo", Amount = 5},
},
}
-- DO NOT CHANGE ANYTHING BELOW THIS LINE
local i, LastFloor, Exhaust, AreaConv = 1, $posz, 0, {["GFB"] = "3x3", ["WaveMedium"] = "smallwave", ["WaveVerySmall"] = "smallwave", ["WaveSmall"] = "smallwave", ["Front"] = "front", ["BeamBig"] = "bigbeam", ["BeamSmall"] = "smallbeam", ["WaveBig"] = "bigwave", ["Dist1"] = "1", ["Dist2"] = "2", ["Dist3"] = "3", ["Dist4"] = "4", ["Dist5"] = "5", ["Dist7"] = "7"}
table.lower(Config.Monsters)
while #Config.Spells >= i do
local info = spellinfo(Config.Spells[i].Name)
Config.Spells[i].Area = AreaConv[info.castarea] or info.castarea:lower()
Config.Spells[i].Attack = info.castmode:match("Target") ~= nil
if #info.words == 0 then
table.remove(Config.Spells, i)
else
if #Config.Spells[i].Area > 0 and table.find({"smallwave", "bigwave", "smallbeam", "bigbeam", "front"}, Config.Spells[i].Area) then
Config.Spells[i].NeedDirection = true
else
Config.Spells[i].NeedDirection = false
end
i = i + 1
end
end
function cancast(spell)
local info = spellinfo(spell)
if info.specialeffect:match("Strength") then
return not $strenghtened and cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
return cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
function findcreature(c)
local c = type(c) == 'userdata' and getcreaturebyid(c.id) or getcreaturebyname(c)
return c
end
init end
auto(200, 400)
if $posz ~= LastFloor then
LastFloor, Exhaust = $posz, $timems + 2000
return
end
if $timems > Exhaust then
for _, Spell in ipairs(Config.Spells) do
if cancast(Spell.Name) then
if Spell.Amount and (not Config.Players.Consider or paroundfloorignore(Config.Players.Distance, Config.Players.FloorDifference, unpack(Config.Players.SafeList)) == 0) then
local BestAmount, BestDir = 0, $self.dir
if Spell.NeedDirection then
for Dir, Amount in pairs({["n"] = 0, ["e"] = 0, ["s"] = 0, ["w"] = 0}) do
Amount = maroundspell(Spell.Area, Dir, unpack(Spell.Monsters or Config.Monsters))
if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
BestAmount, BestDir = Amount, Dir
end
end
else
BestAmount = Spell.Attack and maroundspell(Spell.Area, BestDir, unpack(Spell.Monsters or Config.Monsters)) or maround(1, unpack(Spell.Monsters or Config.Monsters))
end
if BestAmount >= Spell.Amount then
while $self.dir ~= BestDir do
turn(BestDir)
waitping()
end
cast(Spell.Name) waitping()
end
elseif Spell.Hppc and $attacked.dist <= (tonumber(Spell.Area) or -2) and table.find(Spell.Monsters or Config.Monsters, $attacked.name:lower()) and Spell.Hppc <= $attacked.hppc and $attacked.isshootable then
cast(Spell.Name)
waitping()
end
end
end
end
end
but its showing error
error in Persistent script NewPersistentScript:
["end"]:NewPersistentScript:96: '<eof>' expected near 'end'
is way to fix that ?