View Full Version : Leave spawn if lured creatures?
Bawtern
01-14-2016, 12:14 AM
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)
if Self.GetTargets(distance) > 3 Walker.Goto(LeaveCave)
Psudo something like this would be exactly what I am looking for:
if creatures.around(demon) > 3 LeaveCave
stopWalker
stopTargetting
Logout
Where LeaveCave is the label for the stairs waypoints.
Regards,
Bawtern
Bawtern
01-14-2016, 02:13 PM
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
eldera
01-14-2016, 03:34 PM
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:
[startHunt]
[NODE]
[NODE]
[NODE]
[NODE]
[checkSupplies] -- Goto startHunt if enough supplies or go to leaveRespawn if not.
[leaveRespawn]
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
Hello eldera was trying this script and doesnt work? ;\
I wrote in xbst
<item text="leaveRespawn" tag="255"/>
Why :x monster name also changed
Jontor
02-10-2016, 09:42 PM
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
Jontor
Okey its working, bot is not shooting but he is going on next waypoints, he is not jumping to label "leaveRespawn"
:\
eldera
02-11-2016, 12:50 AM
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.
<item text="leaveRespawn:" tag="255"/>
Make sure that monster names are lower case
They don't need to be lower case :P
thanks eldera gona try it tomorrow.
Hello eldera
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 :)
eldera
04-04-2016, 01:53 PM
Hello eldera
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:
local monsters =
{
["drillworm"] = true,
["giant spider"] = true,
}
and let me know if it fixed the problem.
eldera I think its working fine :) thanks
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.