Page 1 of 2

Pretty Sick of "waiting on aggressive enemies"

Posted: Fri Sep 14, 2012 7:30 am
by grande
Subject says it all. I looked around and saw most people don't have an answer... anyone know how to eliminate this problem?

"waiting on aggressive enemies"

/facepalm

edit: I turned off "loot in combat" and it's been running okay for a while... not sure if that was just coincidental or why it would matter...

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Fri Sep 14, 2012 8:53 am
by rock5
Awhile back I remember changing a few of those to actually looking for the mobs that have you targeted and if it didn't find any then it wouldn't wait. I think there are still a few in there that weren't changed. I could probably have a look for them.

Why are you getting aggro? AOE from mobs? In a party?

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Fri Sep 14, 2012 11:40 am
by lisa
My first thought is the aoe the mobs do on the way to do butterflies daily, if so then just set the waypoint type to "travel" or was it "run" I always get the 2 mixed up.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Fri Sep 14, 2012 11:44 am
by grande
I haven't been watching it real closely, unfortunately. Can tell you it wasn't when I was in a party. AOE is possible as the new zone does some wierd things such as give you a debuff here and there but I can't verify at this time.

Last thing I changed was to not loot in combat and I haven't had issues since then but it could be some other thing such as world events and I don't really want to get into exact locations. will continue to watch it. Problem is that it freezes up in the "waiting on aggressive..." mode and will end up with xp deaths as mobs beat me senseless.

And I want to kill things so travel/run options aren't good for this issue.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Fri Sep 14, 2012 12:04 pm
by rock5
I see no "wait for aggro" in the code during looting. Also, what you did is counter-intuitive. If loot in combat is enabled then it would ignore aggro and loot. If loot in combat is disabled then it wont loot if it has aggro and possibly it might wait for aggro.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Fri Sep 14, 2012 12:54 pm
by grande
Yeah it's most likely set off by a world event, maybe it does some AOE, not sure.

What's the purpose of waiting on aggressive enemies? Freezing the bot just doesn't seem like a good outcome when the failsafe results in a death.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Fri Sep 14, 2012 1:23 pm
by rock5
I just had a pretty thorough look. I couldn't find anywhere where it waits for aggro. So you'll need to let us know when, where, why it's stopping so we know where to look. Then we might be able to help you.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 4:53 am
by romaniac
I get this message a lot, too. I have two sure ways to reproduce it:

1. Put several chars in a party, turn off ANTI_KS and set them in the same area with mobs. I would expect all chars to attack some mob, but only the first one to spot a mob attacks, the others show the message "we have aggro - waiting". If they are standing, they freeze for the time, but what's worse, if they were moving they just keep running on aimlessly in the last direction, sometimes to their death.

2. Let a char fight b1 in DoD. When the boss has jumped, the char just sits there showing the aggro message instead of re-engaging and doing some damage.

Maybe this helps. It would be really great to get those aggro wait conditions removed as they at best make the bot slow and ineffective, but often get the char killed.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 5:33 am
by lisa
easiest "work around" would be to set in profile PARTY to true.

Code: Select all

		<!-- Party Bot options  -->
		<option name="PARTY"			value="true" />
the party ignores the wait for agro code.

In bot.lua it has this.

Code: Select all

		while(player.Battling) do

			if( player.Current_waypoint_type == WPT_TRAVEL ) then
				cprintf(cli.green, language[113]);	-- we don't stop and don't fight back
				break;
			end;

			if ( settings.profile.options.PARTY ~= true  ) then

				player:target(player:findEnemy(true, nil, evalTargetDefault, player.IgnoreTarget));

				-- wait a second with the aggro message to avoid wrong msg
				-- because of slow battle flag from the client
				if( msg_print == false  and  os.difftime(os.time(), aggroWaitStart) > 1 ) then
					cprintf(cli.green, language[35]);	-- Waiting on aggressive enemies.
					msg_print = true;
				end;
				if( player:haveTarget() ) then
					if( msg_print == false ) then
						cprintf(cli.green, language[35]);	-- Waiting on aggressive enemies.
						msg_print = true;
					end;

					break;
				end;

				if( os.difftime(os.time(), aggroWaitStart) > 4 ) then
					cprintf(cli.red, language[34]);		-- Aggro wait time out
					break;
				end;

				yrest(10);
				player:update();
			else
				player:target(player:findEnemy(true, nil, nil));
				local target = player:getTarget();
				if player:haveTarget() then
					if( settings.profile.options.ANTI_KS ) then
						if( target:haveTarget() and
							target:getTarget().Address ~= player.Address and
							 (not player:isFriend(CPawn(target.TargetPtr))) and
							target:getTarget().Address ~= 0 -- because of distance limitation
							and target:getTarget().InParty ~= true )then
								cprintf(cli.red, language[5], target.Name);
						else
							player:fight();
						end

					else
							player:fight();
					end
					yrest(10);
					player:update();
				end
			end
		end

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 7:52 am
by rock5
I think I see what's happening. If the wait for aggro is triggered and it looks for the aggro mob, if it fails the 'evaltargetdefault' tests then it will wait 4-5 seconds. Maybe remove the eval function as you probably always want to attack aggroed mobs regardless of if they pass the eval function. So line 618 of bot.lua

Code: Select all

				player:target(player:findEnemy(true, nil, evalTargetDefault, player.IgnoreTarget));
should look like

Code: Select all

				player:target(player:findEnemy(true, nil, nil, player.IgnoreTarget));
Maybe even get rid of the last argument. If you fail to attack a mob and ignore it, you don't want to ignore it if it then attacks you. So maybe it should be like the party one.

Code: Select all

				player:target(player:findEnemy(true));
Hm.. but what if you are getting aggro from and AOE but nothing is attacking you? I think it would still wait 4s. Lisa is right, the party bit still looks for the aggro mob but if it doesn't find it it just moves on. I think the non party bit need to be like that too. Probably that whole section needs to be rewritten.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 12:54 pm
by grande
Lisa, Rock... you two are awesome. Thx!

Pretty annoyed I did a search (windows crappy search thing) for "waiting" and "aggressive" in the micromacro folders and didn't come up with the bot.lua text even though it's supposed to. oh well..

I ended up doing the set WP to "TRAVEL" which was okay since I could tell it to engage combat with more specific commands, player:fight() seemed to work fine. I actually shoved off from the place where I was having problems so maybe I'll go back and take another shot armed with the bot.lua info.

Thank you again

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 1:40 pm
by rock5
grande wrote:(windows crappy search thing)
I use and recommend FileSeek for searching for text in files.
http://www.fileseek.ca/

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 3:57 pm
by grande
I'll try that, thx!! I think you're the one that turned me onto cleanmem too :-)

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 8:46 pm
by lisa
I like notepad ++ and use the search for in files option. Love how it can also replace text in any open files all in 1 go too =)

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Sun Sep 16, 2012 10:25 pm
by BillDoorNZ
lol...I use notepad++ too...brilliant prog that one.

and an app called 'Everything' which searches all files on comp, blindingly fast :)

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Mon Sep 17, 2012 5:08 am
by romaniac
lisa wrote:easiest "work around" would be to set in profile PARTY to true.

Code: Select all

		<!-- Party Bot options  -->
		<option name="PARTY"			value="true" />
the party ignores the wait for agro code.
As a quick workaround I tried

Code: Select all

changeProfileOption("PARTY",true)
But that just caused an error message "unknown option".

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Mon Sep 17, 2012 8:44 am
by rock5
That function can only change values that already exist. Most options have default values so should be able to be changed but it looks like Lisa forgot to add default values for the party options. Anyway, I prefer to just use.

Code: Select all

settings.profile.options.PARTY = true
That way I know exactly what it does and it's pretty much fool proof.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Mon Sep 17, 2012 12:56 pm
by romaniac
Shouldn't those options be in a different capizalization in the code than in the XML.

I would have guessed that PARTY becomes .Party.

confused

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Mon Sep 17, 2012 1:09 pm
by rock5
Some things loaded from xmls are interpreted and converted, eg. most of the skill values in skills.xml are converted to caps. But the profile options are added as is. That's why you can even add your own variables to the options and they get added.

Example, if you want to make a choice based on a profile option, lets say which waypoint file to load next, you could add options to your profiles such as

Code: Select all

<option name="MyCHOICE" value="eastpath"/>
and that would get loaded so it would be available for you to use in your waypoint file, eg.

Code: Select all

if settings.profile.option.MyChoice == "eastpath" then
    loadPaths("waypointeast")
elseif settings.profile.option.MyCHOICE == "westpath" then
    loadPaths("waypointwest")
etc..
The point is, unlike lua files that what you see is what you get, xml files have to be read and interpreted. Some of the xml files the bot uses, it changes the variable names as it loads them. Hope that helps.

Re: Pretty Sick of "waiting on aggressive enemies"

Posted: Mon Sep 17, 2012 5:58 pm
by romaniac
Ok, I put the bot into party mode using

Code: Select all

settings.profile.options.PARTY = true
At first it seemed to work, it aggressively attacked instead of showing the "waiting for aggro".

But after a while, the bot simply stopped after killing a mob. It would simply do nothing at all anymore.

I tried it with two different scripts and three different characters. The bot would always run for a while but simply stop doing anyting after a kill after 5-10 minutes.