XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 8 of 8

Thread: Alarm if X amount of monsters on screen!

  1. #1

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    Alarm if X amount of monsters on screen!

    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

  2. #2

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    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

  3. #3
    MrTrala's Avatar
    Join Date
    Aug 2015
    Posts
    16
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post

    lua code:

    --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

  4. #4

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MrTrala View Post
    lua code:

    --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?

  5. #5
    MrTrala's Avatar
    Join Date
    Aug 2015
    Posts
    16
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    lua code:

    --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

  6. #6

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MrTrala View Post
    lua code:

    --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 :/ hehe!

  7. #7
    grave18's Avatar
    Join Date
    Mar 2014
    Posts
    74
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    lua code:
     local range = 7
    local count = 3
    Module.New("AlertMonster", function(module)
    if (#Self.GetTargets(range) >= count) then
    alert()
    end
    module:Delay(500, 1000)
    end)

  8. #8

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by grave18 View Post
    lua code:
     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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •