Working for me.
[code=lua]
local config = {
delay = 100, -- delay time in between checks [default = 500ms]
attacks = {
['exori'] = {
min = 3,
spellRadius = 1,
checkRadius = 2,
countPlayers = false,
attackMode = 'none'
},
}
}
print([[
Name: Auto Area Attack
Description: Executes area spells on certain conditions
Author: Cavitt Glover (Syntax)
Version: 3.1.00 (updated 06.12.2012)]])
wait(5000)
function getTargetCount(pos, atkRadius, chkRadius, incPlayers, atkMode)
local n = 0
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
if(creature:isValid() and creature:ID() ~= Self.ID())then
if(creature:isOnScreen() and creature:isVisible() and creature:isAlive())then
local name = creature:Name()
if(getDistanceBetween(creature:Position(), pos) <= chkRadius)then
if(atkMode == 'none' and (creature:isPlayer()))then
return false
elseif(atkMode == 'enemies' and (creature:isFriendly() or creature:isInnocent()))then
return false
elseif(atkMode == 'strangers' and creature:isFriendly())then
return false
elseif(atkMode == 'friends' and creature:isInnocent())then
return false
end
if(getDistanceBetween(creature:Position(), pos) <= atkRadius)then
if(not creature:isPlayer() or incPlayers)then
n = n + 1
end
end
end
end
end
end
return n
end
function think()
for spell, dat in pairs(config.attacks)do
local amnt = getTargetCount(Self.Position(), dat.spellRadius, dat.checkRadius, dat.countPlayers, dat.attackMode)
if(amnt)then
local _max = (dat.max==nil) and amnt or dat.max
if(amnt >= dat.min) and (amnt <= _max)then
if(type(spell) == 'number')then
Self.UseItemWithMe(spell)
wait(900, 1200)
elseif(Self.CanCastSpell(spell))then
if(dat.needTarget)then
local target = Creature.GetByID(Self.TargetID())
if(target:isOnScreen() and target:isVisible() and target:isAlive())then
if(targetistanceFromSelf() <= dat.spellRadius)then
Self.Say(spell)
wait(600, 1000)
end
end
end
Self.Say(spell)
wait(600, 1000)
end
end
end
end
end
while(true)do
think()
wait(config.delay)
end
[/code]
not working too...
same as punktg
edit: same happens with forgee bp reseter