Event when boss/elite mobs found?
Event when boss/elite mobs found?
Hi!
I created a view scripts to farm items for daily quests and to harvest resources.
Sometimes random elite / boss mobs appear. (i.e. the beetle boss / ice witch in Silverspring).
Currently the bot does not attack elite / boss mobs. But with a low level
char, you easily can get in their aggro range and will be killed.
I'm looking for a way to avoid this. It should be easy to detect if such an elite/boss mob
is in range. Perhaps a special event could be triggered in this case.
Maybe there is already an event available?
This way my script could do something usefull instead of dying:
- switch to a different channel
- change waypoint direction
- load a different script
- play a warning sound
- a.s.o
I'm pretty new to Rom bot and LUA and managed to build some simple scripts.
Perhaps somebody with more knowledge could leave a comment regarding this idea.
I created a view scripts to farm items for daily quests and to harvest resources.
Sometimes random elite / boss mobs appear. (i.e. the beetle boss / ice witch in Silverspring).
Currently the bot does not attack elite / boss mobs. But with a low level
char, you easily can get in their aggro range and will be killed.
I'm looking for a way to avoid this. It should be easy to detect if such an elite/boss mob
is in range. Perhaps a special event could be triggered in this case.
Maybe there is already an event available?
This way my script could do something usefull instead of dying:
- switch to a different channel
- change waypoint direction
- load a different script
- play a warning sound
- a.s.o
I'm pretty new to Rom bot and LUA and managed to build some simple scripts.
Perhaps somebody with more knowledge could leave a comment regarding this idea.
Re: Event when boss/elite mobs found?
change the autoelite faktor in your profile to the value you want
<option name="AUTO_ELITE_FACTOR" value="10" />
and put this code into your onscillcast section
<option name="AUTO_ELITE_FACTOR" value="10" />
and put this code into your onscillcast section
Code: Select all
<onSkillCast><![CDATA[
local target = player:getTarget();
if( target.TargetPtr == player.Address and target.MaxHP > player.MaxHP * settings.profile.options.AUTO_ELITE_FACTOR) then
--add what you want i.E.
---change channel, select another wp...
end;
]]></onSkillCast>
Re: Event when boss/elite mobs found?
Thx for this solution. Will try to integrate it into my scripts.
Should work for scripts that will attack mobs.
But will this work for harvest only scripts (type="RUN")?
In this case the bot will on fight if being attacked, but I like to avoid being attacked by elite mobs.
Should work for scripts that will attack mobs.
But will this work for harvest only scripts (type="RUN")?
In this case the bot will on fight if being attacked, but I like to avoid being attacked by elite mobs.
Re: Event when boss/elite mobs found?
then put this in your <onload> part of your WP-file
it will look in radius of 300 for Boss1, 2, or 3 during the harvesting.
Hope it helps.
Code: Select all
changeProfileOption("MAX_TARGET_DIST", 300);
settings.profile.events.onHarvest = function()
Boss1 = player:findNearestNameOrId("Name Of BOSS1")
Boss2 = player:findNearestNameOrId("Name Of BOSS2")
Boss3 = player:findNearestNameOrId("Name Of BOSS3")
if Boss1 or Boss2 or Boss3 then
-- do what you want: change channel, select another wp ...
end
end
Hope it helps.
Re: Event when boss/elite mobs found?
Thx for this example.
But I don't completely understand your solution.
As far as I understood, you define a new function that will overwrite the
original harvest function. Right? Will the bot still harvest? I would
have expected to call the original harvest function somewhere inside the
new function.
In which file / onXXX event handler should I put this code?
Is there no other smart way to detect elite mobs, without hard coding the names?
But I don't completely understand your solution.
As far as I understood, you define a new function that will overwrite the
original harvest function. Right? Will the bot still harvest? I would
have expected to call the original harvest function somewhere inside the
new function.
In which file / onXXX event handler should I put this code?
Is there no other smart way to detect elite mobs, without hard coding the names?
Re: Event when boss/elite mobs found?
The first code Gloover posted would do **** code when ever a mob has 10 times your hp (that you are attacking in some way).
The second code would check for specific mob names/ID's when ever you try to harvest a node.
Both code that was posted would go in the Onload section of your waypoint file.
Personally I would need to know exactly what you are trying to do, can't really create code unless I know the situation.
You can also set the profile to have party = true and instance = true and that will also negate the elite factor and just attack anything within lvl range specified in profile.
If you are doing something specific then you will need more specific code for what you are trying to do =)
example of party bot options.
The second code would check for specific mob names/ID's when ever you try to harvest a node.
Both code that was posted would go in the Onload section of your waypoint file.
Personally I would need to know exactly what you are trying to do, can't really create code unless I know the situation.
If you want to just attack any mobs then you can change the elitefactor to like 1000 and therefore never come across any mobs with 1000 times your HP, so you would attack anything in the lvl range of your profile.Jandrana wrote:Currently the bot does not attack elite / boss mobs. But with a low level
char, you easily can get in their aggro range and will be killed.
You can also set the profile to have party = true and instance = true and that will also negate the elite factor and just attack anything within lvl range specified in profile.
If you are doing something specific then you will need more specific code for what you are trying to do =)
example of party bot options.
Code: Select all
<!-- Party Bot options -->
<option name="PARTY" value="true" />
<option name="PARTY_ICONS" value="true" />
<option name="PARTY_INSTANCE" value="true" />
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Event when boss/elite mobs found?
My main problem is to find a generic way to avoid getting aggro from mobs that will kill my char.Personally I would need to know exactly what you are trying to do, can't really create code unless I know the situation.
Usually these are elite mobs / world bosses that spawn randomly and wander around.
As the client displays them differently, there should be way to detect, if a mob
has this attribute.
Usually you get a warning in game "Mob xy detected. Be careful".
maybe something like this:
npc = player:getNearestNPC();
if npc.hostile == true and ( npc.elite == true or npc.boss == true ) then
-- found hostile elite // boss - try to get away
end
Preferably this function should be called automatically at each waypoint
or even more often.
Re: Event when boss/elite mobs found?
Issue with running away from elites/bosses is where do you run to. As a human player we can turn and run away and avoid other mobs and then decide to do something else. As a bot we would have to anticitpate what to do before hand and deal with it as it comes.
You couldn't just say, turn 180 degrees and run for 500 yards then load a WP because turning 180 degrees and running might run you into an object or off a cliff.
You could say to then change direction on the WP so you go back the way you came but if you encounter the same or another elite you would just be going back and forth constantly.
What I usually do is just make sure the path I create doesn't go near the path of elites (unless I can kill them easily)
Detecting the elite/boss is the easy part, telling bot what to do after that is more difficult.
You couldn't just say, turn 180 degrees and run for 500 yards then load a WP because turning 180 degrees and running might run you into an object or off a cliff.
You could say to then change direction on the WP so you go back the way you came but if you encounter the same or another elite you would just be going back and forth constantly.
What I usually do is just make sure the path I create doesn't go near the path of elites (unless I can kill them easily)
Detecting the elite/boss is the easy part, telling bot what to do after that is more difficult.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Event when boss/elite mobs found?
If a generic detection of the elite/boss stuff is easy, please share it.Detecting the elite/boss is the easy part, telling bot what to do after that is more difficult.
I could imagine a couple of solutions that could be quite helpful.
As I'm running my bot on a different machine, while I'm actively playing
on my main computer, it would at least be helpfull to get a notification if an elite is detected.
other solutions are:
- use recall and stop the bot
- switch to another channel - maybe remember on which channels the same elite/boss
has been detected and avoid these
- set a flag that an elite has been detected and switch __WPL:setDirection(); and stop bot
at start point.
Of course all solutions may not be perfect, but in imho it's better to have a 50% solution than a 0% percent solution.
Who is online
Users browsing this forum: Ahrefs [Bot] and 8 guests