knight punishment during partybot stops the bot

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
amalia
Posts: 38
Joined: Wed Jul 10, 2013 7:37 am

knight punishment during partybot stops the bot

#1 Post by amalia » Sat Sep 07, 2013 8:09 pm

hey all

While using partybot it occurs that knight punishment stops the bot. Without any errormessages.

skill debuggung is on

Code: Select all

	<option name="DEBUG_SKILLUSE"			value="true" />
The last thing the bot shows is "pressing macro: knight_punishment" + Debug message with gap details.

The skill punishment is called without any special attributes:

Code: Select all

	<skill name="KNIGHT_PUNISHMENT"     	hotkey="MACRO" priority="98" />	
It´s defined to be valid after 4 holy seals on target.

Code: Select all

	<skill name="KNIGHT_PUNISHMENT" 					id="490164" range="50"	type="damage"		casttime="0"	cooldown="8"	target="enemy"		reqbufftarget="target" reqbuffname="500140" reqbuffcount="4" />
the bot stops always (reproducable) when a partymeber kills the mob shortly before punishment would be cast. I never had this issue outside of a party.

I have in mind that this or a similar problem was already discussed, but I cannot find the thread nor do I know if it´s the same problem.

Any idea how I can go deeper in debugging this issue?

amalia
Posts: 38
Joined: Wed Jul 10, 2013 7:37 am

Re: knight punishment during partybot stops the bot

#2 Post by amalia » Wed Sep 11, 2013 5:20 am

I get around this using punishment only above target hp >50%.
This makes the issue occure rarely.

But aren´t there any more debug switches to make the bot write down what it´s actually doing? To see where it stops exactly? May be it´s only catched
in a loop...

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: knight punishment during partybot stops the bot

#3 Post by rock5 » Wed Sep 11, 2013 5:55 am

It's hard for me to debug this because I'm not familiar with the party code and I'm not sure how it's supposed to act. There is not really enough information to even guess where to look. If it was easy to reproduce and I could reproduce it I could probably eventually figure it out. But I don't think I can do it remotely. Maybe Lisa, who knows the party bot best, will know where the problem is.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: knight punishment during partybot stops the bot

#4 Post by lisa » Wed Sep 11, 2013 5:21 pm

party bot uses the player:fight() to do all of the combat stuff, so issue would need to be resolved in that function.

Code: Select all

				if player:target(player:findEnemy(true, nil, evalTargetDefault)) then
					if heal then
						healfight()
					else
						player:fight()
					end
				end

Code: Select all

				if player:target(player:findEnemy(nil, nil, evalTargetDefault, player.IgnoreTarget)) then
					player:fight();
				end

Code: Select all

				player:target(player:findEnemy(nil,nil,icontarget,nil))
				if player:haveTarget() then
					if heal then
						healfight()
					else
						player:fight()
					end
				end

Code: Select all

				local leader = getPartyLeaderName()
				if leader then
					local mob = getTarget(leader)
					if mob and mob.Type == PT_MONSTER then
						player:target(mob.Address)
						if heal then
							healfight()
						else
							player:fight()
						end
					end
				end

It seems to me that the mob is being killed in the time the knight bot tries to attack it?
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: knight punishment during partybot stops the bot

#5 Post by rock5 » Thu Sep 12, 2013 12:37 am

Well the user said it only happened when he party botted and there are loops in the party code. I just couldn't figure out the logic on how it could get stuck. Maybe if the hp wasn't 0 like happens with some mobs? But then why does it only happen with that skill? We might have to post a version of party.lua and/or player.lua with some print messages to see where it's getting stuck. And then work from there.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: knight punishment during partybot stops the bot

#6 Post by lisa » Thu Sep 12, 2013 3:48 am

One of the main differences with party bot and normal is that you are in a party and there are other characters killing the same mob, when normal botting the mob only dies when you kill it (usually).

Party bot always checks if the mob is still valid before trying to attack it and when it goes into the player:fight() code it comes out of that function when mob dies or the bot deems it useless trying to fight it. ie. taking to long to kill.

Give this version a try, functionality is same as latest version but it has debug prints.
Add a profile option
DEBUG_PARTY

Newer version couple posts down.

ie

Code: Select all

<option name="DEBUG_PARTY"				value="true" />
--=== Added ===--
Completely untested, I don't even have 1 PC with up to date version of the game.
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

amalia
Posts: 38
Joined: Wed Jul 10, 2013 7:37 am

Re: knight punishment during partybot stops the bot

#7 Post by amalia » Thu Sep 12, 2013 6:48 pm

I´ll check and report

Thanks for now.

amalia
Posts: 38
Joined: Wed Jul 10, 2013 7:37 am

Re: knight punishment during partybot stops the bot

#8 Post by amalia » Fri Sep 13, 2013 7:46 am

Hey Lisa

With your debug flag an the modified party.lua I get an error: ....\party.lua attempt to call global 'debug_party' (a nil value).
But only (of course) with those party members that are in party_dps, or party_heal mode. Not the Party leader.

I´ll put the knight as the party leader so that it does not use the party_bot code (Is this assumption right?) and will see. If code of party bot causes the error or if the problem just occurs while beeing in a party at all.

edit: Yes it occurs also as party leader. Bot stucks again. Means no problem on the party bot code? Need the debugging flags somewhere else?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: knight punishment during partybot stops the bot

#9 Post by rock5 » Fri Sep 13, 2013 8:00 am

You see this function at the bottom of the file?

Code: Select all

local function debug_party(_reason)
	if settings.profile.options.DEBUG_PARTY then
		cprintf(cli.yellow, "[DEBUG] ".._reason.."\n");
	end
end
Try moving it to the top of the file.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: knight punishment during partybot stops the bot

#10 Post by lisa » Sat Sep 14, 2013 2:14 am

I moved it to top in this version, I was hoping the function would be included before it was called, guess I didn't check it all properly.
I did it at end so that if SVN updates wouldn't get all messed up.
Attachments
party.lua
5.2
(18.23 KiB) Downloaded 141 times
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

amalia
Posts: 38
Joined: Wed Jul 10, 2013 7:37 am

Re: knight punishment during partybot stops the bot

#11 Post by amalia » Sat Sep 14, 2013 6:05 am

Ok Debug-messages work proper.

The bot stucks during: "In Combat find out why and kill it"
Then some skills are used and with punishment it stucks.

Since it also stuck when knight is partyleader and is following some waypoint instead beeing party-assistent (the other party-member are assistent bots) we should consider that it might not be a problem of partybot-code.

I also can see, that the bot is not stucking completly. It just stops following waypoints, no written output and stop using skills. But e.g. I can still pause and resume the bot. And if I target a mob manually with "tab" during this phase of "stucking" the char is still moving towards the mob and is attacking with the "attack". But is not using any skills. I mean I just target the mob I do not attack it. moving and Attacking comes from the bot. So there is still something living inside :-)

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

Re: knight punishment during partybot stops the bot

#12 Post by lisa » Sat Sep 14, 2013 6:38 am

that debug message is after

Code: Select all

if player:target(player:findEnemy(true, nil, evalTargetDefault)) then
So yeah it is using the evaltarget default function, so issue is in the way the main bot deals with something, might need a check for valid mob in the player:fight() somewhere.
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: knight punishment during partybot stops the bot

#13 Post by rock5 » Sat Sep 14, 2013 7:49 am

lisa wrote:

Code: Select all

if player:target(player:findEnemy(true, nil, evalTargetDefault)) then
So yeah it is using the evaltarget default function
We are talking about a situation where the mob is targeted and the mob is dead. It looks like to me that the code at the top of findEnemy would return the currently targeted dead mob without using the eval function.
amalia wrote:And if I target a mob manually with "tab" during this phase of "stucking" the char is still moving towards the mob and is attacking with the "attack". But is not using any skills.
That really makes it seem like there is a problem in player:fight. I think you're right Lisa
lisa wrote:might need a check for valid mob in the player:fight() somewhere.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: knight punishment during partybot stops the bot

#14 Post by lisa » Sat Sep 14, 2013 10:07 pm

Hmm the while loop is for when it has a target, so the current code "should" be working, unless you target yourself, in which case the target would be alive but you can't attack it.

Maybe the whole issue is you target yourself mid fight?

So maybe check your target is the original target before starting the loop and if not then check it is still valid and if so target it again?
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

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

Re: knight punishment during partybot stops the bot

#15 Post by lisa » Sat Sep 14, 2013 10:20 pm

Ok I changed the timed attack function a bit, give this a try.


It used to just check if you had any target at all, I changed it to check if you are still targeting the original target.

I think more needs doing but this will atleast stop the attack timer function if you target yourself mid fight.
player.lua
(127.57 KiB) Downloaded 165 times

Code: Select all

	local function timedAttack()
		self:updateTargetPtr();

		-- Prevents looting when looting is turned off
		-- (target is dead, or about to be dead)
		if self.TargetPtr ~= original_target.Address then
			return
		else
			original_target:updateAlive()
			if not target:isAlive() then
				return;
			end
			Attack()
		end;
	end
Also made a check for target is the original target.

Code: Select all

		self:updateTargetPtr();
		if original_target:isAlive() and self.TargetPtr ~= original_target.Address then
			player:target(original_target)
		end;
Might need some more thinking but it's a start, that will do me for now, Rock might be able to finish off anything I messed up.
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

amalia
Posts: 38
Joined: Wed Jul 10, 2013 7:37 am

Re: knight punishment during partybot stops the bot

#16 Post by amalia » Tue Sep 17, 2013 4:12 pm

I tried.

The bot kills one mob and ends like this.
../rom/classes/player.lua:1780: attempt to index global 'target' (a nil value)
I have no idea to avoid this to check the rest.

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: knight punishment during partybot stops the bot

#17 Post by BlubBlab » Tue Sep 17, 2013 4:45 pm

you need something like this before the line

Code: Select all

local target = self:getTarget();
The target is not global anymore since RC2
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

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

Re: knight punishment during partybot stops the bot

#18 Post by lisa » Wed Sep 18, 2013 2:34 am

My bad, I changed it to "original_target" and didn't look for more "target" after the loop.

Try this
player.lua
(127.6 KiB) Downloaded 170 times
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

amalia
Posts: 38
Joined: Wed Jul 10, 2013 7:37 am

Re: knight punishment during partybot stops the bot

#19 Post by amalia » Wed Sep 18, 2013 7:18 am

I´ll keep on it but actually I cannot run 4 clients beneath each other like I used to do. Because one client is always critting after few minutes. Nothing to do with the bot, but frustrating anyway and with less dds in party the issue does not occur that often.

As far as I see the issue is still there. Bot stops after punishment when mob is nearly down.
But It looks like it stops completly. It is not going to move and to attack after tabbing to the next mob like it behaved the last time.
But I did not check the different versions against each other again, it was too annoying with the critting clients for the moment.
The party_debug message is still "In combat found out why, kill it now."

MinMax
Posts: 46
Joined: Mon Dec 21, 2009 6:45 am

Re: knight punishment during partybot stops the bot

#20 Post by MinMax » Thu Sep 19, 2013 1:10 am

The same trouble. Running party, a client crashes every minute. Curiosly only the followers.Not the leader. The partybot worked excellent for a long time. Till we got the new zone. I don´t get errors of the bot, but i have the clientt crashes. I updated all. Micromacro, rombot, functions, addons... Ineffective.
6 Clients standalone with the bot no problem. 3 in a party with minute by minute crash.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests