PDA

View Full Version : Alarm if X amount of monsters on screen!



jollebollen
12-03-2015, 05:22 AM
I don't know what happened to all .lua files on this site but this script existed before and I can't find it anymore :)

jollebollen
12-04-2015, 03:04 AM
not even view here either wtf no people in xenobot community anymore? i used this bot a year ago and it this forum was crowded xD

MrTrala
12-05-2015, 09:06 AM
--Config
local creatct = 2 -- Number of creatures to play alarm
local dist = 4 -- Distance to consider monsters

-- Don't touch this if you don't know what are you doing
while (true) do
local creature = Creature.GetByID(Self.TargetID())
local amount = 0
for _, c in Creature.iMonsters(dist) do
if c:isAlive() and c:isOnScreen() then
amount = amount +1
end
end
if creature:isValid() and creature:isAlive() and amount >= creatct then
alert()
end
end


Have fun =D

jollebollen
12-05-2015, 08:11 PM
--Config
local creatct = 2 -- Number of creatures to play alarm
local dist = 4 -- Distance to consider monsters

-- Don't touch this if you don't know what are you doing
while (true) do
local creature = Creature.GetByID(Self.TargetID())
local amount = 0
for _, c in Creature.iMonsters(dist) do
if c:isAlive() and c:isOnScreen() then
amount = amount +1
end
end
if creature:isValid() and creature:isAlive() and amount >= creatct then
alert()
end
end


Have fun =D

thank you =) but can i type somewhere what monsters he should count?

MrTrala
12-06-2015, 07:18 PM
--Config
local config = {
creatct = 2, -- Number of creatures to play alarm
dist = 4, -- Distance to consider monsters
monsters = {"Frost Dragon Hatchling", "Yeti", "Rotworm"} -- Name of monster to sound alarm

}

-- Don't touch this if you don't know what are you doing
while (true) do
local amount = 0
for _, c in Creature.iMonsters(config.dist) do
if c:isAlive() and c:isOnScreen() then
amount = amount +1
end
end
for name, creature in Creature.iMonsters() do
if (table.contains(config.monsters, name)) then
if creature:isValid() and creature:isAlive() and amount >= config.creatct and not Self.isInPz() then
alert()
end
end
end
end

jollebollen
12-22-2015, 10:45 PM
--Config
local config = {
creatct = 2, -- Number of creatures to play alarm
dist = 4, -- Distance to consider monsters
monsters = {"Frost Dragon Hatchling", "Yeti", "Rotworm"} -- Name of monster to sound alarm

}

-- Don't touch this if you don't know what are you doing
while (true) do
local amount = 0
for _, c in Creature.iMonsters(config.dist) do
if c:isAlive() and c:isOnScreen() then
amount = amount +1
end
end
for name, creature in Creature.iMonsters() do
if (table.contains(config.monsters, name)) then
if creature:isValid() and creature:isAlive() and amount >= config.creatct and not Self.isInPz() then
alert()
end
end
end
end


he set alarm on if any monsters come into screen though :/ :D hehe!

grave18
12-22-2015, 11:12 PM
local range = 7
local count = 3
Module.New("AlertMonster", function(module)
if (#Self.GetTargets(range) >= count) then
alert()
end
module:Delay(500, 1000)
end)

jollebollen
01-22-2016, 03:59 AM
local range = 7
local count = 3
Module.New("AlertMonster", function(module)
if (#Self.GetTargets(range) >= count) then
alert()
end
module:Delay(500, 1000)
end)

thank you again my friend but it is possible to add monster name? or not :) thanks in advance!