target.Alive in <onSkillCast>

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

target.Alive in <onSkillCast>

#1 Post by gloover » Sat May 18, 2013 5:04 pm

Hey Lisa, greetz rock.

I want to optimize my cast sequence for my Champion/Rogue so I've tried this

Code: Select all

<onSkillCast><![CDATA[
			if arg1.Name == "CHAMPION_SHADOW_PULSE" then
		                local target = player:getTarget();
				target:update()
				if target.Alive then
					player:cast("ROGUE_SHADOWSTAB")
				elseif target.Lootable then
					player:loot()
				end
			elseif 	arg1.Name == "ROGUE_THROW" then
		                local target = player:getTarget();
				target:update()
				if target.Alive  then
					player:cast("ROGUE_SHADOW_STEP")
					player:cast("ROGUE_SHADOWSTAB")
				elseif target.Lootable then
					player:loot()
				end
			end
]]></onSkillCast>
but target.Alive checking seems not to be working correctly. the bot is runing to the mob and trying to cast shadowstab even if the mob is dead directly after the first cast of Shadow Pulse.

Is it possible to check the targets HP (Alive) in onscillcast between cast-sequence?

thx in advance.

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

Re: target.Alive in <onSkillCast>

#2 Post by lisa » Sat May 18, 2013 6:49 pm

well I can tell you the onSkillCast is done after the skill is cast but if the skill has a cast time then onskillcast is done BEFORE the cast is finished. So if the skill has a cast time then the mob will still be alive when onskillcast is done.

So basically onSkillCast is done directly after a skill is initiated regardless of a cast time.

I added a print in skill:use() which simply said "skill use", in profile I added this

Code: Select all

	<onSkillCast><![CDATA[
		if arg1.Name == "MAGE_FLAME" then
			print("onskillcast for flame")
		end
	]]></onSkillCast>
result was this

Code: Select all

Use MACRO: MAGE_FLAME          skill use
=>   Zapa River Ostrich (1075/1075)
onskillcast for flame
I could see on screen the print was done before the cast bar had finished.

This may or may not help you but it is also possible that the hp of mob hasn't updated when onskillcast event is done.


I think to do what you want will need to get the sequence of skills right, pretty sure rock did work on the cast sequencing.
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
grande
Posts: 261
Joined: Tue Jun 28, 2011 4:46 pm

Re: target.Alive in <onSkillCast>

#3 Post by grande » Sat May 18, 2013 6:58 pm

Just my 2-cents: You have it programmed to attack 'first' but are indicating that it maybe should loot 'first' if the target is dead. To me, should be resolvable by adding a loot check before attack. Maybe something like:

Code: Select all


<onSkillCast><![CDATA[
         if arg1.Name == "CHAMPION_SHADOW_PULSE" then
                      local target = player:getTarget();
            target:update()
            if target.Lootable then
               player:loot()
            elseif target.Alive then
               player:cast("ROGUE_SHADOWSTAB")
            elseif target.Lootable then
               player:loot()
            end
         elseif    arg1.Name == "ROGUE_THROW" then
                      local target = player:getTarget();
            target:update()
            if target.Alive  then
               player:cast("ROGUE_SHADOW_STEP")
               player:cast("ROGUE_SHADOWSTAB")
            elseif target.Lootable then
               player:loot()
            end
         end
]]></onSkillCast>


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

Re: target.Alive in <onSkillCast>

#4 Post by rock5 » Sun May 19, 2013 12:59 am

I'd be interested in knowing what it is you are trying to do. It's possible you might be able to just set up the skills properly to achieve the desired effect.
lisa wrote:if the skill has a cast time then onskillcast is done BEFORE the cast is finished.
I didn't realize this, but I don't think we can do anything about it without slowing down the casting rate.
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: target.Alive in <onSkillCast>

#5 Post by gloover » Sun May 19, 2013 5:51 am

@ Grande: I've allready tried this solution, but as lisa said - the refresh time seems to be very short :-(

@ rock:

what I'm trying is to prevent the paddling back, when the melee character is set to "COMBAT_RANGED_PULL = true". The bot cast the range-attack (i.e Shadow pulse) then he's waiting, till the mob is close enough or (and this happens VERY often) he's paddling backwarts, so my intention is to going into melee combat, directly after ranged skill was casted. The problem is the refresh time in onskillcast, so for example, if shadow-pulse kills the mob and my sequence looks simmilar to this:

Code: Select all

<onSkillCast>
if arg1.Name == "CHAMPION_SHADOW_PULSE" then
  player:cast("ROGUE_SHADOWSTAB")
end
</onSkillCast>
the bot will runing close to the dead mob even if this one is not lootable and print "wrong target" - so sometimes it stucks in the sequence "casting ROGUE_SHADOWSTAB...." and seems to be frozen.

This is the idea, to check if the mob going dead after the first casted renged-pull skill. If "yes" and dead target is lootable, run to them and loot, otherwise clear target.

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

Re: target.Alive in <onSkillCast>

#6 Post by rock5 » Sun May 19, 2013 6:17 am

So what you are saying is if ranged pull is true with a melee character and it kills the mob with it's ranged attack, it still waits for the 3s instead of running in to loot? Sounds like a bug. I'll have a look. In the mean time try this.

Code: Select all

<onSkillCast>
if arg1.Name == "CHAMPION_SHADOW_PULSE" then
  player.ranged_pull = false
end
</onSkillCast>
  • 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: target.Alive in <onSkillCast>

#7 Post by rock5 » Sun May 19, 2013 6:32 am

I just tested it. It worked fine for me. When the mob dies it immediately stops waiting and goes in to loot if there is loot. Are you using the latest bot?
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: target.Alive in <onSkillCast>

#8 Post by gloover » Sun May 19, 2013 9:08 am

Hey rock. Its a nice idea to set ranged_pull to false into onskillcast - will test this more extensively.

You misunterstood me - the bot stops waiting as it should, when the mob is going down after the ranged attack, but if not; in the best case it's waiting till the mob is close enough - in worst case (this happens very often) it's running some steps backwarts (maybe in cause of ranged attack cooldown and distance) and falling down the cliff or the like. So I only want to prevent this.
It should immediately after the ranged attack going to the target, but only if this one is still alive or lootable, otherwise ignore (clear) target and search for the next one.

btw. I have the last 757rev.

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

Re: target.Alive in <onSkillCast>

#9 Post by rock5 » Sun May 19, 2013 9:40 am

gloover wrote:in worst case (this happens very often) it's running some steps backwarts
This doesn't make sense. There is no reason for it to go backwards. If the player doesn't move then the mob should run up to it and stop at the right distance for the player to attack it. If the wait time ends and the player starts moving towards the mob then there is a chance the mob ans player might pass each other. In that case the player might back up but should only back up over ground it has already covered.

Or are you talking about being pushed by the mob? Does it happen with other mobs? Not much we could do about that. You should try to avoid the edges of cliffs when creating the waypoint file and maybe the idea I mentioned before will help.
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: target.Alive in <onSkillCast>

#10 Post by gloover » Sun May 19, 2013 10:27 am

rock5 wrote: Or are you talking about being pushed by the mob? Does it happen with other mobs? Not much we could do about that. You should try to avoid the edges of cliffs when creating the waypoint file and maybe the idea I mentioned before will help.
No, I'm not talking about mobs, which can pushing - it happens on every mob very often. It cant allways be the cliff - it could be a tree, a railings or something else, where the bot could getting stucked. You can try it by yourself taking (for example) a rogue. Set target distance to 250, combat distance to 150 (it is a distance of throwing), COMBAT_RANGED_PULL = true and use for the sake of convenience only "ROGUE_THROW as pullony = true" and "ROGUE_SHADOWSTAB" for the melee. Try this with lowlvl equip or on mobs which are not going down by the first strike - so you will see what I mean.

PS: it shouldnt make a difference which race is using, but who knows: I've tried this with dwarf champion/rogue.

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

Re: target.Alive in <onSkillCast>

#11 Post by rock5 » Sun May 19, 2013 11:25 am

I've used ranged pull before but, sorry, I've never seen such behavior.
  • 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: target.Alive in <onSkillCast>

#12 Post by gloover » Sun May 19, 2013 2:12 pm

@ rock. I also have used ranged pull a while ago then took a break with rom and now tryig to level up a dwarf character I've noticed this behaviour. Seems I'm not alone with this problem. As I wrote, try it yourself.

PS: your suggestion to set ranged_pull to false after the ranged attack in "onskillcast" seems to solve this inconvenience.

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

Re: target.Alive in <onSkillCast>

#13 Post by rock5 » Sun May 19, 2013 4:16 pm

That link doesn't sound like the same problem. They didn't mention ranged_pull and they were happy with my advice. You seem to have a different problem.

I did try a melee character with ranged_pull, a Champion in fact. It still didn't back peddle. How often does it do 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
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: target.Alive in <onSkillCast>

#14 Post by gloover » Mon May 20, 2013 3:18 am

Hmm. strange. It happens in 70-80% of all fights. Can u upload your profile xml, please - so I will compare the settings.

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

Re: target.Alive in <onSkillCast>

#15 Post by rock5 » Mon May 20, 2013 3:24 am

This is the one I used with my champion.
Attachments
pp.xml
(13.67 KiB) Downloaded 127 times
  • 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 13 guests