XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Leave spawn if lured creatures?

  1. #1

    Join Date
    Jun 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Leave spawn if lured creatures?

    So I am currently botting Demons yalahar, and people love to lure here. Is it possible to create a script that checks for monsters (demons specifically) on the screen, and if more then 3 just walk to the stair?

    Thinking something like this but I am not sure it would work with the refiller etc as well (as I am rushing past several monsters)

    Code:
    if Self.GetTargets(distance) > 3 Walker.Goto(LeaveCave)
    Psudo something like this would be exactly what I am looking for:
    Code:
    if creatures.around(demon) > 3 LeaveCave
    stopWalker
    stopTargetting
    Logout
    Where LeaveCave is the label for the stairs waypoints.

    Regards,

    Bawtern

  2. #2

    Join Date
    Jun 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No one? I noticed this is used in the official Xenobot scripts (for wyrms) and it leaves to the stair when there are too many wyrms on screen, waits for a time period and then returns to the spawn.
    @jo3bingham @Syntax @Joshwa534

  3. #3
    Monthly Subscriber
    Join Date
    Jun 2012
    Posts
    185
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    I haven't tested this script. Let me know if it works or not.

    This script will work only if your cavebot script hunts only on one floor (without ladders, stairs, rope places etc). If you run it with script that hunts on more than one floor it will most likely get stuck. It might also get stuck if there are monsters on way to refil but you shouldn't have that problem with demon spawn in yalahar.

    LeaveLabel is bold name of label in example below:

    Code:
    [startHunt]
    [NODE]
    [NODE]
    [NODE]
    [NODE]
    [checkSupplies] -- Goto startHunt if enough supplies or go to leaveRespawn if not.
    [leaveRespawn]

    lua code:

    local antyLure = {
    leaveLabel = "leaveRespawn",
    maxMonsters = 2,
    monsterList = { "Demon", "Some Other Monster"} -- optional (jus comment whole line if you want to track all monsters)

    }

    -- --[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--

    function countMonstersOnScreen(monsterList)
    local count = 0
    for name, obj in Creature.iMonsters() do
    if (monsterList and table.contains(monsterList, name:lower()) or true) then
    count = count + 1
    end
    end
    return count
    end

    Module.New("anty-lure", function()
    if (not IS_LURED) then
    if (countMonstersOnScreen(antyLure.monsterList) > antyLure.maxMonsters) then
    IS_LURED = true
    Targeting.StartIgnoring()
    Walker.Goto(antyLure.leaveLabel)
    end
    end

    if (Self.isInPz() and IS_LURED) then
    Targeting.StopIgnoring()
    IS_LURED = false
    end
    end)


    This script will simply refill every time someone lure on you. If you don't want it to do refil I would actually have to edit your wpts to make it wait upstairs until creatures get back to thier normal spawn positions, but I don't really feel like doing that tbh xD

  4. #4
    l4z's Avatar
    Join Date
    Oct 2015
    Posts
    133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello @eldera was trying this script and doesnt work? ;\
    I wrote in xbst
    <item text="leaveRespawn" tag="255"/>
    Why :x monster name also changed

  5. #5
    Senior Member Jontor's Avatar
    Join Date
    Sep 2014
    Posts
    446
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by l4z View Post
    Hello @eldera was trying this script and doesnt work? ;\
    I wrote in xbst
    <item text="leaveRespawn" tag="255"/>
    Why :x monster name also changed
    Make sure that monster names are lower case

  6. #6
    l4z's Avatar
    Join Date
    Oct 2015
    Posts
    133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @Jontor
    Okey its working, bot is not shooting but he is going on next waypoints, he is not jumping to label "leaveRespawn"
    :\
    Last edited by l4z; 02-10-2016 at 10:47 PM.

  7. #7
    Monthly Subscriber
    Join Date
    Jun 2012
    Posts
    185
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by l4z View Post
    Hello @eldera was trying this script and doesnt work? ;\
    I wrote in xbst
    <item text="leaveRespawn" tag="255"/>
    Why :x monster name also changed
    You missed colon.

    lua code:
    <item text="leaveRespawn:" tag="255"/>


    Quote Originally Posted by Jontor View Post
    Make sure that monster names are lower case
    They don't need to be lower case :P

  8. #8
    l4z's Avatar
    Join Date
    Oct 2015
    Posts
    133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    thanks @eldera gona try it tomorrow.

  9. #9
    l4z's Avatar
    Join Date
    Oct 2015
    Posts
    133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello @eldera


    lua code:

    local monsters =
    {
    ["Drillworm"] = true,
    ["Giant spider"] = true,

    }

    local function countMonsters()
    local count = 0
    for n, c in Creature.iMonsters() do
    if monsters[n:lower()] then
    count = count + 1
    end
    end
    return count
    end

    local leaveLabel = "AntiLureStairs"
    Module("Anti-lure", function(self)
    if countMonsters() >= 4 then
    Targeting.StartIgnoring()
    Walker.Goto(leaveLabel)
    self:Stop()
    else
    self:Delay(1000)
    end
    end, false)


    My question is how to force the antylure script for only these 2 monster to count?
    Cuz when he is going back he is stacking on dwarf soldier the antylure is working on them aswell I guess.

    I wrote in list like u can see gs and drillworm but for other moster anylure is working aswell..
    Help
    Last edited by l4z; 04-03-2016 at 12:19 PM.

  10. #10
    Monthly Subscriber
    Join Date
    Jun 2012
    Posts
    185
    Mentioned
    22 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by l4z View Post
    Hello @eldera


    lua code:

    local monsters =
    {
    ["Drillworm"] = true,
    ["Giant spider"] = true,

    }

    local function countMonsters()
    local count = 0
    for n, c in Creature.iMonsters() do
    if monsters[n:lower()] then
    count = count + 1
    end
    end
    return count
    end

    local leaveLabel = "AntiLureStairs"
    Module("Anti-lure", function(self)
    if countMonsters() >= 4 then
    Targeting.StartIgnoring()
    Walker.Goto(leaveLabel)
    self:Stop()
    else
    self:Delay(1000)
    end
    end, false)


    My question is how to force the antylure script for only these 2 monster to count?
    Cuz when he is going back he is stacking on dwarf soldier the antylure is working on them aswell I guess.

    I wrote in list like u can see gs and drillworm but for other moster anylure is working aswell..
    Help
    First of all you should use lower case names in monsters table and besides that it's working for me. Try with:
    lua code:
    local monsters = 
    {
    ["drillworm"] = true,
    ["giant spider"] = true,

    }

    and let me know if it fixed the problem.

Posting Permissions

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