self:clearTarget(); problem, strange behaivor

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

self:clearTarget(); problem, strange behaivor

#1 Post by d003232 » Fri Jun 26, 2009 9:24 am

I'm using SVN 55 and have some strange behaivor with self:clearTarget(); and can't find out, whats the reason.

Im targeting a mob, but dont fight them. Don't have aggro from that mob.

Then I get aggro from one new mob (not the mob in my target) I call a 'self:clearTarget();'. I'm under attack from the new mob. But after that, 'target.TargetPtr' is still 0. Means it is not the target who is hitting me. It will first get the right target addresses, if I manualy face the new mob by turning my char with the mouse. Shouldn't I get automaticly the new target from the client?

I have a

Code: Select all

			self:update();
			target = self:getTarget();			-- STEPH07
			target:update();
directly before checking 'target.TargetPtr'.

It really changes only if I turn the char with my mouse.

Is that a problem with the client or with the bot? It is also a little difficult to track, because after using 'self:clearTarget()' the target in the client ui seems still to be the old target.
The RoM Bot Online Wiki needs your help!

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

Re: self:clearTarget(); problem, strange behaivor

#2 Post by d003232 » Fri Jun 26, 2009 11:38 am

To explain it more detailed: I want to check, if I have aggro, directly before casting. So I use the code:

Code: Select all

			self:update();
			target = self:getTarget();
			target:update();
			if( p_debug02 == true ) then	printf("DEBUG: *** self.TargetPtr %s target.Name %s \n", self.TargetPtr, target.Name ); end;
			if( p_debug02 == true ) then	printf("DEBUG: *** self.Battling %s target.TargetPtr %s self.Address %s hf_castcount %s\n", self.Battling, target.TargetPtr, self.Address, hf_castcount ); end;
			if( self.Battling == true  and			-- we have aggro
			    target.TargetPtr ~= self.Address  and	-- but not from our target
			    hf_castcount == 0 ) then			-- and we dont cast before
				cprintf(cli.green, "Aggro while first strike/cast, abort that cast/target: %s\n", target.Name);
				self:clearTarget();
				return;         
			end;

			v:use();
directly before the v:use() in the player.lua.

And as described, 'target.TargetPtr = 0' and it should be instead my adress, becaus it should be the target who is selected from the client, because that target is attecking me.
The RoM Bot Online Wiki needs your help!

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

Re: self:clearTarget(); problem, strange behaivor

#3 Post by Administrator » Fri Jun 26, 2009 8:50 pm

I think this is a bug with the client. I've noticed that there are many things that can cause your target to have a target of '0' even while they are attacking something.

Post Reply

Who is online

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