Suggestion: Stop moving on player:Battling()

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Zilvermoon
Posts: 104
Joined: Mon Jan 05, 2009 8:19 am

Suggestion: Stop moving on player:Battling()

#1 Post by Zilvermoon » Sun Jul 26, 2009 5:20 pm

I have noticed that when I move through areas with hostile mobs my character will continue to move even though the player:Battling() flag is activated, this isn't a real issue in most places, but if you farm elites it is a big deal, so here is a fix:

player.lua line 644 - 663

Code: Select all

		self:update();
		if( self.Battling and not self:haveTarget() ) then
			cprintf(cli.green, language[35]);
			keyboardRelease( settings.hotkeys.MOVE_FORWARD.key );
			local aggroWaitStart = os.time();
			while(self.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

It's working like a charm for me, but then again i have only had a little bit of testing with it ... so if you wanna use pleases feel free to do so :)

Zilvermoon

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

Re: Suggestion: Stop moving on player:Battling()

#2 Post by d003232 » Sun Jul 26, 2009 5:25 pm

Zilvermoon wrote:I have noticed that when I move through areas with hostile mobs my character will continue to move even though the player:Battling() flag is activated, this isn't a real issue in most places, but if you farm elites it is a big deal, so here is a fix:
Ähm Ähm Ähm, SVN 89 from a couple days before has that function within.
The RoM Bot Online Wiki needs your help!

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

Re: Suggestion: Stop moving on player:Battling()

#3 Post by Zilvermoon » Sun Jul 26, 2009 5:43 pm

d003232 wrote:
Zilvermoon wrote:I have noticed that when I move through areas with hostile mobs my character will continue to move even though the player:Battling() flag is activated, this isn't a real issue in most places, but if you farm elites it is a big deal, so here is a fix:
Ähm Ähm Ähm, SVN 89 from a couple days before has that function within.
lol sorry didn't update my version before farming tonight ... :o

Zilvermoon

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

Re: Suggestion: Stop moving on player:Battling()

#4 Post by Zilvermoon » Sun Jul 26, 2009 6:53 pm

Ok your code is great, but you didn't take into account that the function also is used for moving towards a mob, which is making a great mess out of it, so to fix that edit line 641 in player.lua to:

code:

Code: Select all

	 	if( self.Battling ) then
new code:

Code: Select all

	 	if( self.Battling and not self:haveTarget() ) then
edit: Naa strike that, this isn't really helping ... but something is up ... with the battling code inside movement ... try moving in TRAVEL waypoints in an hostile area and test what I mean ...

Zilvermoon
Last edited by Zilvermoon on Sun Jul 26, 2009 6:59 pm, edited 1 time in total.

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

Re: Suggestion: Stop moving on player:Battling()

#5 Post by d003232 » Sun Jul 26, 2009 6:57 pm

Zilvermoon wrote:Ok your code is great, but you didn't take into account that the function also is used for moving towards a mob, which is making a great mess out of it, so to fix that edit line 641 in player.lua to:

code:

Code: Select all

	 	if( self.Battling ) then
new code:

Code: Select all

	 	if( self.Battling and not self:haveTarget() ) then
Zilvermoon
Dmnd. I only play casters. They don't need to move while battling. :oops:
The RoM Bot Online Wiki needs your help!

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

Re: Suggestion: Stop moving on player:Battling()

#6 Post by Zilvermoon » Sun Jul 26, 2009 7:00 pm

Too quick for me, did an edit of pre-post.

Naa strike that, this isn't really helping ... but something is up ... with the battling code inside movement ... try moving in TRAVEL waypoints in an hostile area and test what I mean ...

Now I think I got it working like it should, if you would please help test this:

Code: Select all

	 	if( self.Battling and ( self.Fighting == false ) ) then
Zilvermoon

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

Re: Suggestion: Stop moving on player:Battling()

#7 Post by d003232 » Sun Jul 26, 2009 7:16 pm

Zilvermoon wrote: Now I think I got it working like it should, if you would please help test this:

Code: Select all

	 	if( self.Battling and ( self.Fighting == false ) ) then
Yes, I think self.Fighting check should be the right thing. Now I understand, what's self.Fighting is for! :shock: Do you make the SVN fix?
The RoM Bot Online Wiki needs your help!

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

Re: Suggestion: Stop moving on player:Battling()

#8 Post by Zilvermoon » Sun Jul 26, 2009 7:27 pm

d003232 wrote:
Zilvermoon wrote: Now I think I got it working like it should, if you would please help test this:

Code: Select all

	 	if( self.Battling and ( self.Fighting == false ) ) then
Yes, I think self.Fighting check should be the right thing. Now I understand, what's self.Fighting is for! :shock: Do you make the SVN fix?
Sure I can do that, just need to pull a few modifications out of my version before SVN update.

Zilvermoon

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

Re: Suggestion: Stop moving on player:Battling()

#9 Post by d003232 » Sun Jul 26, 2009 7:30 pm

Zilvermoon wrote:Sure I can do that, just need to pull a few modifications out of my version before SVN update.
No, don't do that. It's better just to copy the 'rom' folder to a new name like 'romsvn'. Delete all content within 'romsvn' and do a SVN update at 'romsvn'. Then you have a parallel clear SVN version.

I can also do it tomorrow morning. I nowhave no go to sleep.
Last edited by d003232 on Sun Jul 26, 2009 7:36 pm, edited 1 time in total.
The RoM Bot Online Wiki needs your help!

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

Re: Suggestion: Stop moving on player:Battling()

#10 Post by Zilvermoon » Sun Jul 26, 2009 7:33 pm

d003232 wrote:
Zilvermoon wrote:Sure I can do that, just need to pull a few modifications out of my version before SVN update.
No, don't do that. It's better just to copy the 'rom' folder to a new name like 'romsvn'. Delete all content within 'romsvn' and do a SVN update at 'romsvn'. Then you have a parallel clear SVN version.
Np, was only one modification, none moving for buff is player.Battling, so I have updated SVN :)

Zilvermoon

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest