interrupting heals

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

interrupting heals

#1 Post by ZZZZZ » Mon May 12, 2014 3:37 am

Im not sure if this is due to profile being set up wrong, or just a small fault with combat coding, but I am getting an issue where while trying to kill large numbers of mobs at the same time, if the mob it has targeted dies before it finishes its 'list' of skills and then starts to heal due to being below the specified HP lvl from profile, it'll step back and abort the cast strait after it starts. It clears target at the same time.

If the mob its targeting is not dead it will successfully finish the cast, its only when the target is dead and it clears it that it interrupts.
- Does not do it every time though.

Code: Select all

Use MACRO: MAGE_THUNDERSTORM   =>   Puppet Shaman (10505/25278)
Use MACRO: MAGE_PURGATORY_FIRE =>   Puppet Shaman (0/25278)
No more (usable) hp potions available at bagslot 1 to 240
MACRO: Using MP potion 5588/11423 (48%): Elemental Spirit Stone (qty 39)
Use MACRO: DRUID_RECOVER       =>   * aborted *
Fight finished. Killed 10 Puppet Shaman. (fight #31 / runtime 6 minutes)
Clearing target.
Loot skipped because of aggro.
Engaging enemy [Puppet Warrior] in combat.

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

Re: interrupting heals

#2 Post by lisa » Mon May 12, 2014 5:42 am

druid recover has issues, I just haven't had the time to look into why it is interupted often and priest urgent heal works fine.
1 day I might get a chance to look into 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: interrupting heals

#3 Post by rock5 » Mon May 12, 2014 6:06 am

Sorry, I thought I posted this but I only did a preview.
______________________________________________

Firstly, thank you for the detailed explanation. That makes finding the problem so much easier.

I think I found the issue. There is a local function in player:checkSkills that returns true or false if you are taking too long to damage the target. It checks the value target.LastHP which is only 0 before you have done any damage. It is also 0 when the mob disappears or if the target was invalid to start with.

Try this to fix it. Find theses lines in player.lua. Should be line 1093.

Code: Select all

		if( self.Cast_to_target >= settings.profile.options.MAX_SKILLUSE_NODMG  and	(target.LastHP == 0 or
			self.failed_casts_in_a_row >= settings.profile.options.MAX_SKILLUSE_NODMG) and not self.Casting) then
Change to

Code: Select all

		if( target:exists() and self.Cast_to_target >= settings.profile.options.MAX_SKILLUSE_NODMG  and	(target.LastHP == 0 or
			self.failed_casts_in_a_row >= settings.profile.options.MAX_SKILLUSE_NODMG) and not self.Casting) then
Let me know if it works.
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: interrupting heals

#4 Post by ZZZZZ » Mon May 12, 2014 5:00 pm

Na that didn't work. It's still interupting itself by stepping backwards and clearing target.

Code: Select all

Use MACRO: MAGE_PURGATORY_FIRE =>   Puppet Warrior (10721/34397)
Use MACRO: MAGE_THUNDERSTORM   =>   Puppet Warrior (10721/34397)
Use MACRO: DRUID_RECOVER       =>   * aborted *
Fight finished. Killed 41 Puppet Warrior. (fight #51 / runtime 9 minutes)
Clearing target.
Loot skipped because of aggro.
Engaging enemy [Puppet Warrior] in combat.

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

Re: interrupting heals

#5 Post by rock5 » Tue May 13, 2014 12:14 am

Isn't Recovery a heal over time? Try changing the skill in the skills.xml database to "hot"

Code: Select all

	<skill name="DRUID_RECOVER" 						id="493528" range="250" type="hot"			casttime="2"	cooldown="0"	target="friendly"	buffname="503797" />
  • 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: interrupting heals

#6 Post by lisa » Tue May 13, 2014 12:26 am

it's both, has a instant heal up and then heals over time, it has a 2 second cast time. My initial thought is it thinks the cast is meant to be instant but like I said I haven't had time to look into 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: interrupting heals

#7 Post by rock5 » Tue May 13, 2014 12:56 am

You know what it probably is, the player:cast doesn't wait for casting, it waits when it casts the next skill. So it's probably just the end of the fight that causes it to clear the target and break the casting. There is a bit of code after the fight where it steps back to break and stop clickToCast spells. Well that's what it's for but it's probably breaking the heals as well.

Code: Select all

	self:updateCasting()
	if self.Casting then
		keyboardPress(settings.hotkeys.MOVE_BACKWARD.key)
	end
We probably just need to add a condition to that. I'm not 100% sure what it should be. Probably it should just be,

Code: Select all

	self:updateCasting()
	if self.Casting and self.LastSkill.ClickToCast then
		keyboardPress(settings.hotkeys.MOVE_BACKWARD.key)
	end
That would stop it from stepping back. I think there is code elsewhere that makes it wait for casting to end before moving so that should be all it needs.
  • 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: interrupting heals

#8 Post by lisa » Tue May 13, 2014 3:14 am

yeah that will probably help with the posted issue, I think it is different to the issue I have noticed.

Code: Select all

Use MACRO: DRUID_RECOVER       =>   * aborted *
Use MACRO: DRUID_RECOVER       =>   (5415/14348)
Use MACRO: DRUID_RECOVER       =>   (9178/14348)
Clearing target.
Moving to waypoint #6, (-5917, -3394)
Moving to waypoint #7, (-6095, -3671)
MACRO: Using HP potion 5375/14348 (37%): Military Regenerat
Use MACRO: DRUID_RECOVER       =>   (6772/14348)
Use MACRO: DRUID_RECOVER       =>   (11300/14348)
Clearing target.
Moving to waypoint #1, (-6200, -3857)
Use MACRO: DRUID_RECOVER       =>   * aborted *
Use MACRO: DRUID_RECOVER       =>   (6372/14348)
Clearing target.
Moving to waypoint #2, (-5857, -3707)
MACRO: Using HP potion 5375/14348 (37%): Military Regenerat
Use MACRO: DRUID_RECOVER       =>   (6772/14348)
Use MACRO: DRUID_RECOVER       =>   (11402/14348)
Clearing target.
Moving to waypoint #3, (-5612, -3532)
Use MACRO: DRUID_RECOVER       =>   * aborted *
Use MACRO: DRUID_RECOVER       =>   (5505/14348)
I just made up a circle WP and not even attacking anything, quite often the initial cast would be interupted as it goes to walk forward, may be issue in movement but like I said I haven't really had the time to find it, I think it will take a while to narrow down the actual issue.
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: interrupting heals

#9 Post by lisa » Tue May 13, 2014 3:31 am

well I sure didn't expect that, I added in my own prints at each location the * aborted * is printed and the spot that is issue for druid recover and may be an issue for other skills as I can't see why it is only an issue with druid recover but here it is.

Code: Select all

	-- Wait for casting or GCD to start
	local function waitTillCastingStarts()
		local startTime = getTime();
		self:updateCasting();
		if( skill.CastTime > 0 ) then
			while( not self.Casting ) do -- wait for casting to start
				-- Check if mob is dead during wait
				local target = CPawn.new(self.TargetPtr);
				if not target:isAlive() then
					printf(language[82]);	-- close print 'Casting ..." / aborted
					print("line 857")
					return false
				end
Yes that is right a healing skill is checking if a mob is Alive or not and when not alive it stops the cast, umm I am not attacking anything so why is it checking if I have a target or not??
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: interrupting heals

#10 Post by lisa » Tue May 13, 2014 3:52 am

ok now I am just confused.

Code: Select all

				local target = CPawn.new(self.TargetPtr);
				if target.Id ~= 0 and not target:isAlive() then
					printf(language[82]);	-- close print 'Casting ..." / aborted
					print("line 857")
					table.print(target)
					return false
				end
Notice it has .Id ~= 0 and then I do a print of target.

Code: Select all

Use MACRO: DRUID_RECOVER

=>   * aborted *
line 857
table: 05911ED0
TargetIcon:     true
MaxRage:        0
Name:   <UNKNOWN>
MaxEnergy:      0
Class2: -1
Speed:  50
Level:  1
MaxMP2: 1000
Alive:  true
Race:   0
Rage:   0
InParty:        false
GUID:   0
LastHP: 0
Level2: 1
MP:     1000
MP2:    1000
Direction:      0
Type:   0
HP:     1000
Address:        0
Class1: -1
Lootable:       false
Swimming:       false
Harvesting:     false
MaxFocus:       0
MaxMP:  1000
Casting:        false
Aggressive:     false
Mana:   0
Z:      0
Mounted:        false
MaxMana:        0
Guild:  <UNKNOWN>
Attackable:     false
TargetPtr:      0
MaxHP:  1000
Focus:  0
Energy: 0
Y:      0
X:      0
Buffs:  table: 05911EF8
Id:     0
Yes the target has Id of 0
So ummm WTF ?
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: interrupting heals

#11 Post by lisa » Tue May 13, 2014 4:48 am

ok got there eventually.
This has fixed the issue for me atleast.

Code: Select all

if target.Id ~= -1 and not target:isAlive() then
The reason is because the .Id was -1 and then the :isAlive() calls half a dozen functions (very painful to go through them all) and during 1 of them it updates the Id to be 0, so it goes from being -1 and then it gets changed to 0 even though it still has no target.
So CPawn of nothing starts at -1 and if you do any function calls on it then it gets changed to 0..
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: interrupting heals

#12 Post by rock5 » Tue May 13, 2014 5:12 am

I think I mentioned this before, -1 means the id hasn't been updated yet, 0 means it has and the pawn is no longer valid or the address was invalid to start with.

It still doesn't make sense though. isAlive() should be returning false. I still haven't figured it out.

Edit: Wait, that's what it's supposed to do "not false" = true.
  • 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: interrupting heals

#13 Post by lisa » Tue May 13, 2014 5:29 am

ok this is what I have as changes, I'll post it here before I lose track.

So that includes the "fix" for druid recover being interupted as it checks if you have a target before trying to check if it is alive or not.

The fix you posted about the actual issue this post, backward stepo interupting thingy (unconfirmed if it fixed it)

Some party stuff, I think it was to do with accepting commands from whispers or party chat with a profile option.
MONITOR_WHISPERS
Value should be nil or true, I think. (checked and true or false works or just nothing at all)


Bit pumped up on drugs atm, been sick for about a week and it's killing me =(
Attachments
player.lua
(129.61 KiB) Downloaded 120 times
skill.lua
(24.39 KiB) Downloaded 102 times
party.lua
(18.01 KiB) Downloaded 105 times
skills.xml
(85.96 KiB) Downloaded 116 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

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

Re: interrupting heals

#14 Post by rock5 » Tue May 13, 2014 5:32 am

This is what I came up with.

Code: Select all

				if skill.Type ~= STYPE_HEAL and skill.Type ~= STYPE_HOT then
					local target = CPawn.new(self.TargetPtr);
					if not target:isAlive() then
						printf(language[82]);	-- close print 'Casting ..." / aborted
					print("line 857")
						return false
					end
				end
I'll have a look at what you did.
  • 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: interrupting heals

#15 Post by lisa » Tue May 13, 2014 5:38 am

Hmm so if Id stays -1 until it is updated does that mean CPawn of an actual object would have Id of -1 or would it be it's actual Id. I would assume it would be it's actual Id and not -1 anymore, if it is still -1 that is kinda dumb.

I like your way better, I am sure once the drugs wear off it will make more sence to me lol

Code: Select all

				-- Check if mob is dead during wait, only for damage skills
				if skill.Type ~= STYPE_HEAL and skill.Type ~= STYPE_HOT then
					local target = CPawn.new(self.TargetPtr);
					if not target:isAlive() then
						printf(language[82]);	-- close print 'Casting ..." / aborted
						return false
					end
				end
edited post with this now as player.lua
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: interrupting heals

#16 Post by rock5 » Tue May 13, 2014 6:21 am

skills.xml
  • You changed Throw range to 200 but I'm still showing 150.
player.lua
  • Code: Select all

    				local target = CPawn.new(self.TargetPtr);
    				if target.Id ~= -1 and not target:isAlive() then
    yeah, targetId will always be -1. So this means it wont break from casting like it's supposed to when you're casting an attack skill and the mob dies.

    Code: Select all

    	if self.Casting and not self.LastSkill.ClickToCast then
    		keyboardPress(settings.hotkeys.MOVE_BACKWARD.key)
    	end
    Sorry I made a mistake. That "not" is not supposed to be there.
skill.lua
  • Code: Select all

    	if( target.Race == 0 ) then
    		player:updateTargetPtr()
    		target = CPawn.new(player.TargetPtr)
    		target:update()
    	end
    
    So... it only updates if the player is human? I like mine better.

    Code: Select all

    	if( target == nil or target.Address == 0 ) then
    And you shouldn't have to update the whole target as things get updated as necessary.
lisa wrote:Hmm so if Id stays -1 until it is updated does that mean CPawn of an actual object would have Id of -1 or would it be it's actual Id. I would assume it would be it's actual Id and not -1 anymore, if it is still -1 that is kinda dumb.
That is not 100% clear. CPawn.new(address) creates a blank pawn with just the address set. The id remains -1 until pawn:updateId() is run at which point the pawn.Id becomes the id or 0 if the pawn address is invalid. Functions such as exists() and isAlive() will run updateId so after any of those functions Id will not be -1.
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: interrupting heals

#17 Post by ZZZZZ » Tue May 13, 2014 6:31 am

Well this part seems to have fixed my issue, and I added in the part that Lisa post so it doesn't say it aborts anymore.

Code: Select all

if self.Casting and self.LastSkill.ClickToCast then
      keyboardPress(settings.hotkeys.MOVE_BACKWARD.key)
   end
Now my alt doesn't get owned by the hoard of mobs that are 5-6 lvl's higher than it :D

Continue ;)

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

Re: interrupting heals

#18 Post by rock5 » Tue May 13, 2014 9:00 pm

Lisa I'm getting ready for a commit. Do you want me to include your changes or would you like to commit them yourself?
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: interrupting heals

#19 Post by rock5 » Tue May 13, 2014 9:25 pm

While checking out your skills.lua changes I saw why you change target:updateId() to target:update(). It's because you check the target.InParty which isn't updated. So I added a target:updateInParty() just before it checks InParty. That should fix it.
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: interrupting heals

#20 Post by rock5 » Tue May 13, 2014 9:32 pm

A small thing, as I'm going through my changes, I am changing DRUID_RECOVER to "hot". Does anyone have a problem with that?
  • 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

Post Reply

Who is online

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