Event when boss/elite mobs found?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Event when boss/elite mobs found?

#1 Post by Jandrana » Thu Jul 05, 2012 6:17 am

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.

User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Event when boss/elite mobs found?

#2 Post by gloover » Thu Jul 05, 2012 12:03 pm

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

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>


Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Event when boss/elite mobs found?

#3 Post by Jandrana » Fri Jul 06, 2012 4:28 am

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.

User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Event when boss/elite mobs found?

#4 Post by gloover » Fri Jul 06, 2012 9:00 am

then put this in your <onload> part of your WP-file

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
it will look in radius of 300 for Boss1, 2, or 3 during the harvesting.

Hope it helps.

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Event when boss/elite mobs found?

#5 Post by Jandrana » Sat Jul 07, 2012 2:59 am

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?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Event when boss/elite mobs found?

#6 Post by lisa » Sat Jul 07, 2012 3:16 am

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

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

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Event when boss/elite mobs found?

#7 Post by Jandrana » Sat Jul 07, 2012 4:17 am

Personally I would need to know exactly what you are trying to do, can't really create code unless I know the situation.
My main problem is to find a generic way to avoid getting aggro from mobs that will kill my char.
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.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Event when boss/elite mobs found?

#8 Post by lisa » Sat Jul 07, 2012 6:37 am

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

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Event when boss/elite mobs found?

#9 Post by Jandrana » Sun Jul 08, 2012 9:36 am

Detecting the elite/boss is the easy part, telling bot what to do after that is more difficult.
If a generic detection of the elite/boss stuff is easy, please share it.
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.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests