Bug or worked as designed? running even if aggro

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Bug or worked as designed? running even if aggro

#1 Post by d003232 » Thu Jun 18, 2009 10:06 am

I just noticed that my bot sometimes is running straight forward in the direction of mobs ... and don't target that mobs.

I found in player.lua(414):

Code: Select all

	while( dist > 25.0 ) do
		if( self.HP < 1 or self.Alive == false ) then
			return false, WF_NONE;
		end;

		if( canTarget == false and os.difftime(os.time(), startTime) > 1 ) then
			canTarget = true;
		end

		if( canTarget and (not ignoreCycleTargets) and (not self.Battling) ) then       -- <<<<< HERE !!!!
			if(settings.hotkeys.TARGET.modifier) then
				keyboardHold(settings.hotkeys.TARGET.modifier);
			end
			keyboardPress(settings.hotkeys.TARGET.key);
			if(settings.hotkeys.TARGET.modifier) then
				keyboardRelease(settings.hotkeys.TARGET.modifier);
			end

			yrest(10);
		end
means the bot will only use the target key, if the bot is not 'self.Battling'. I think there should also be a case 'self.Battling' in witch the bot stops running and wait for a target.

I'm not sure in which situations the bot dont get a target from the aggroing mob. Perhaps the bot has allready himself as a target? Or I cleared the target at one place in my personal modification just before? I couldn't get the reason in detail. But I think it would be better for the bot to stop running, if in 'self.Battling' and wait for the mob running behind instead of running straight into the next mob group. :-)
The RoM Bot Online Wiki needs your help!

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: Bug or worked as designed? running even if aggro

#2 Post by 3cmSailorfuku » Thu Jun 18, 2009 1:32 pm

I don't really get what you say, but I never expirienced something like that.
If I let the loottime on 2000 it waits till it gets aggro and attacks those mobs.

Zilvermoon
Posts: 104
Joined: Mon Jan 05, 2009 8:19 am

Re: Bug or worked as designed? running even if aggro

#3 Post by Zilvermoon » Thu Jun 18, 2009 4:59 pm

Yeah I created a fix for this my self ... I Bot on Hostile mob's, which means that I at times pass a mob and aggro it, and without my "fix" my character would run a long way before the hostile mob would catch up to me ( at times it would result in death due to too many mob's getting aggro on me before I got into combat, so yeah i know what you are talking about ...)

It's late here so I'll post my "fix" tomorrow when I'm not too tired ...

Zilvermoon

Edit: never mind here it is:
player.lua line 8 (in my file anyway)

Code: Select all

WF_COMBAT = 4; -- Failed waypoint becourse we are in combat
player.lua line 423 (in my file anyway)

Code: Select all

		if( self.Battling and (not ignoreCycleTargets) ) then
			keyboardRelease( settings.hotkeys.MOVE_FORWARD.key );
			keyboardRelease( settings.hotkeys.ROTATE_LEFT.key );
			keyboardRelease( settings.hotkeys.ROTATE_RIGHT.key );
			return false, WF_COMBAT;
		end
bot.lua line 302 (in my file anyway)

Code: Select all


				if( reason == WF_COMBAT ) then
					-- Do something if we try to move while in comabt
				end
Insert those lines, and the Bot will stop running when you get the player.Battling "flag" ... this will only apply when you aren't trying to target anything (while you are running from waypoint to waypoint, won't affect in-combat movement)...

Zilvermoon

Edit2: If you got any problems with this you might have to place a piece of code in bot.lua like this:
bot.lua line 225 (in my file anyway)

Code: Select all

			player:update();
			if( player.Battling ) then
				cprintf(cli.green, language[35]);
				local aggroWaitStart = os.time();
				while(player.Battling) do
					if( player:haveTarget() ) then
						break;
					end;

					if( os.difftime(os.time(), aggroWaitStart) > 3 ) then
						cprintf(cli.red, language[34]);
						break;
					end;

					yrest(10);
					player:update();
				end
			end;
I got a lot of custom code at the moment, so the line numbers might be a bit off, but I tried to calculate em via SVN Diff preview so bare with me if they are off ...

Zilvermoon

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Bug or worked as designed? running even if aggro

#4 Post by Administrator » Thu Jun 18, 2009 11:27 pm

I believe the in combat flag is only turned on after being hit. Since you don't have a target, once you get hit, you will automatically target this same monster anyways. You would still exit moving to waypoints and begin attacking that monster. Have you tested this thoroughly and seen any improvement?

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Bug or worked as designed? running even if aggro

#5 Post by d003232 » Fri Jun 19, 2009 5:12 am

Administrator wrote:I believe the in combat flag is only turned on after being hit. Since you don't have a target, once you get hit, you will automatically target this same monster anyways. You would still exit moving to waypoints and begin attacking that monster. Have you tested this thoroughly and seen any improvement?
I did a lot of printf to debug that cases and realized that 'self.Battling' is flaged without getting a hit. It is also 'true' if you are in a group and your party member gets aggro.

But you are right. If I dont have a target, then I will get a target and the bot will stop. I suppose that stop will be a little later than the self.Battling flag and I think there are reasons, where you dont get a target:
  • when you have yourself as a target after buffing
  • when you have own modifications anduse the 'clear target' function (i suppose thats my case)
@Zilvermoon
I will try your fix.
The RoM Bot Online Wiki needs your help!

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Bug or worked as designed? running even if aggro

#6 Post by Administrator » Fri Jun 19, 2009 5:21 am

It might be a good idea to have the extra check if you are in battle, then. However, this raises another problem: if you are in a party, you will constantly be getting knocked out of moving to waypoints when your party members enter combat. Because of this problem, you could only limit attempting to target (like in the code you gave in the original post), but you would still have the problem of the bot not wanting to select targets when your party members are in combat and your character is perfectly safe.

I just don't know if it's worth it. There is a trade off. It works only slightly better when solo, but quite a bit worse when in a party... It's problematic.

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Bug or worked as designed? running even if aggro

#7 Post by d003232 » Fri Jun 19, 2009 6:42 am

Administrator wrote:if you are in a party, you will constantly be getting knocked out of moving to waypoints when your party members enter combat.
That was the reason I originaly came to that point. If I was botting with two accounts in a party, one of the mates was allway running into mobs, because he was 'self.Battling' by the other and because of that, he dont target mobs and just run into the mob groups.

At the moment I bot with two chars and dont put them in a party. And I really like it. They work pretty good thogether. Both running the same waypoints and like magic, they allways come together. It looks really human.
The RoM Bot Online Wiki needs your help!

Zilvermoon
Posts: 104
Joined: Mon Jan 05, 2009 8:19 am

Re: Bug or worked as designed? running even if aggro

#8 Post by Zilvermoon » Fri Jun 19, 2009 7:09 am

I can see the problem in my script suggestions if the player.Batteling flag is triggered by party members getting into combat (which I haven't notised due to always running my bot's out of party), but isn't it possible to find a flag for being in a party (with a player:IsInParty flag we would be able to use that flag in the script to turn off the "stop waypoint movement exit due to player:Batteling flag) .... hope you get what I'm saying...

I'll start investigating to see if this information is available (I know the client use something like this for deciding what dropdown menu you should have when clicking your own protrait, but don't know if we'll be able to find the information)...

Zilvermoon

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Bug or worked as designed? running even if aggro

#9 Post by d003232 » Fri Jun 19, 2009 9:01 am

I just detect one situation, where you dont have a clear target to target an aggroing mob:
  • If you run around and get a mob into you target, which is already in fight with some one other. Then your bot runs away but that mob is still your current target.
Ok. I think that is more an other bug or design problem. In that case the bot should run away and after 2 or 3 seconds clear the target to be ready for new mobs.
The RoM Bot Online Wiki needs your help!

kumpel100
Posts: 47
Joined: Sat May 09, 2009 11:12 am

Re: Bug or worked as designed? running even if aggro

#10 Post by kumpel100 » Fri Jun 19, 2009 6:58 pm

another is when the mob is death but you still have an DoT on you, you skip looting.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests