Page 1 of 1

aggro freeze

Posted: Sat Feb 19, 2011 11:40 am
by wizzyslo
When i'm going to bot with team i have problem with aggro freeze. If my character attack 1st its averything ok. If someone else attack before me and get in combat then my client freeze to leave combat and MM masssage is:

Code: Select all

We get aggro. Stop moving to waypoint and wait for target.
Waiting on aggressive enemies.
Aggro wait time out.
Moving to waypoint #5, (xxx, zz)
Is posible to fix this?

Re: aggro freeze

Posted: Sat Feb 19, 2011 10:59 pm
by rock5
Probably. Waiting for aggro is old school. I've changed that behavior in other places so I should be able to do it here.

Could you test it for me as I don't party?

Around line 1794 of player.lua you will find

Code: Select all

		-- stop moving if aggro, bot will stand and wait until to get the target from the client
	 	-- only if not in the fight stuff coding (means self.Fighting == false )
	 	if( self.Battling and 				-- we have aggro
	 	    self.Fighting == false  and		-- we are not coming from the fight routines (bec. as melee we should move in fight)
			waypoint.Type ~= WPT_TRAVEL and	-- only stop if not waypoint type TRAVEL
	 	    os.difftime(os.time(), player.LastAggroTimout ) > 10 ) then		-- dont stop 10sec after last aggro wait timeout
			keyboardRelease( settings.hotkeys.MOVE_FORWARD.key );
			keyboardRelease( settings.hotkeys.ROTATE_LEFT.key );
			keyboardRelease( settings.hotkeys.ROTATE_RIGHT.key );
			success = false;
			failreason = WF_COMBAT;
			break;
		end;
Replace it with

Code: Select all

		-- stop moving if aggro, bot will stand and wait until to get the target from the client
	 	-- only if not in the fight stuff coding (means self.Fighting == false )
	 	if( self.Battling and 				-- we have aggro
	 	    self.Fighting == false  and		-- we are not coming from the fight routines (bec. as melee we should move in fight)
			waypoint.Type ~= WPT_TRAVEL then	-- only stop if not waypoint type TRAVEL
			if self:findEnemy(true, nil, evalTargetDefault) then
				success = false;
				failreason = WF_COMBAT;
				break;
			end
		end;
See if that behaves as expected. Then let me know and I'll commit it.

Re: aggro freeze

Posted: Sun Feb 20, 2011 12:54 pm
by wizzyslo
I updated bot and have next problem. When i start bot he said next:

Code: Select all

An edit box in game has focus. Please close it before restarting the bot.
This can be found in function.lua on line 525

What that mean I dont get it?

Re: aggro freeze

Posted: Sun Feb 20, 2011 4:26 pm
by wizzyslo
Works much better only add ")" before "then" in >>waypoint.Type ~= WPT_TRAVEL then<< toke me prity long time to find what is wrong :D

Re: aggro freeze

Posted: Sun Feb 20, 2011 10:26 pm
by rock5
wizzyslo wrote:I updated bot and have next problem. When i start bot he said next:

Code: Select all

An edit box in game has focus. Please close it before restarting the bot.
That's a different topic. I made some suggestions you could try, here
http://www.solarstrike.net/phpBB3/viewt ... 007#p19007
wizzyslo wrote:Works much better only add ")" before "then" in >>waypoint.Type ~= WPT_TRAVEL then<< toke me prity long time to find what is wrong :D
Sorry.

I'll add it to my next commit.

Re: aggro freeze

Posted: Mon Feb 21, 2011 7:21 pm
by rock5
wizzyslo wrote:Works much better only add ")" before "then" in >>waypoint.Type ~= WPT_TRAVEL then<< toke me prity long time to find what is wrong :D
I noticed another section that waits 4 seconds for aggro. Do you notice it waiting 4 seconds for aggro when in parties or does it completely ignore party members aggro?