Why can't I use the same skill twice?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Why can't I use the same skill twice?

#1 Post by rock5 » Wed Mar 10, 2010 9:29 am

Is there any programmatical reason why we can't set up the same skill more than once? I know that if I try the below the bot won't allow it, but it should.

In this example I want to open with Rising Tide, then caste my DoTs, then spam Rising Tide till monster is dead (assuming the DoTs cooldown doesn't run out).

Code: Select all

<skills_priest>
	<skill name="PRIEST_RISING_TIDE"    			hotkey="VK_6" 	priority="100" maxuse="1"/>
	<skill name="PRIEST_LURE_OF_THE_SNAKE_WOMAN"    hotkey="VK_5" 	priority="90" />
	<skill name="PRIEST_BONE_CHILL" 				hotkey="VK_4" 	priority="80" />
	<skill name="PRIEST_SNAKE_CURSE"   				hotkey="VK_3"	priority="70" />
	<skill name="PRIEST_RISING_TIDE"    			hotkey="VK_6" 	priority="60" />
</skills_priest>
At the moment the only way I can make this work is to duplicate the PRIEST_RISING_TIDE entry in skills.xml giving it another name like PRIEST_RISING_TIDE_OPENER and putting Rising Tide in 2 action bar buttons, 1 for each. This just seems silly.

This will also allow people to setup attack sequences which use skills more than once for those people who want greater control.

What do you think?
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Why can't I use the same skill twice?

#2 Post by Administrator » Wed Mar 10, 2010 12:32 pm

See here. There's really no need to enter the same skill into your profile more than once as it should continue to use the skill when available (ie. no other higher priority skills that aren't on cooldown).

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

Re: Why can't I use the same skill twice?

#3 Post by rock5 » Wed Mar 10, 2010 1:21 pm

I think I understand. In my case if I put Rising Tide first it will still execute the dots after first using Rising Tide and then continue to use rising tide. But there are situations where that is not enough. For instance a knight has to use Holy Strike 3 times before using Punishment.

I guess the question I'm asking is, is it a difficult job to allow duplicate entries or is it something you can just enable? Cos I'm suspecting the only reason duplicates don't work is because there is some programming checks in rombot that doesn't allow it. Or am I wrong? Would duplicate entries cause problems?
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Why can't I use the same skill twice?

#4 Post by Administrator » Wed Mar 10, 2010 4:58 pm

Duplicate entries would overwrite each other in the table they are stored in, and cause problems for accessing them. For example, if you want to query information on the skill MAGE_FIREBALL, you get it from settings.profile.skills["MAGE_FIREBALL"]. The bot uses this internally.

In cases such as Holy Strike and Punishment, the user could just do this:

Code: Select all

if( arg1.Name == "KNIGHT_HOLY_STRIKE" ) then
    local target = player:getTarget();
    target:updateBuffs("target");
    if( target.Debuffs["Holy Strike"] >= 3) then  -- use the actual debuff name instead of Holy Strike
        player:cast("KNIGHT_PUNISHMENT");
    end
end
If you want to double (or more) cast Rising Tide before moving on to other skills, you could do this:

Code: Select all

if( arg1.Name == "PRIEST_RISING_TIDE" ) then
  player:cast("PRIEST_RISING_TIDE");
end

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

Re: Why can't I use the same skill twice?

#5 Post by rock5 » Thu Mar 11, 2010 12:15 am

Oh ok. I wasn't sure if they would overlap.

Anyway, I like the look of updateDebuffs :D (or is it updateBuffs?). I can think of a few uses for that. In a few places I had my own routine to check buffs but I didn't realize you had one. I'm going to look into using it.

And thanks for the examples. Hopefully they will help others who keep asking questions about attack sequences.

Additional:
I just did a test using updateBuffs() but I didn't get the expected results. My code looks like this;

Code: Select all

player:updateBuffs()
for i,v in pairs(player.Buffs) do
	print (i)
end
It only lists 3 of my buffs; Grace of Life, Magic Barrier and Soul Bond. But it didn't list Shadow Fury and Wave Armor.

Do you know why?
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Why can't I use the same skill twice?

#6 Post by Administrator » Thu Mar 11, 2010 1:34 am

You're right...Good thing you pointed this out. It's a minor bug. Edit classes/pawn.lua. Find this:

Code: Select all

		for i = 1,#buffs/2,2 do
Change to:

Code: Select all

		for i = 1,#buffs,2 do
You'll have to do the same thing for debuffs a few lines below that, as well. If you expect to have more than 9 buffs/debuffs, you'll have to also have to modify the '9' in each of the RoMScript() calls a few line above to be higher. I'm going to change the default to 16.

Just tested it and now I'm getting:

Code: Select all

Buff: Angel's Blessing
Buff: Magic Barrier
Buff: Blessed Spring Water
Buff: Holy Candle
Buff: Soul Bond
Buff: Regenerate
Buff: Holy Aura
Buff: Blessing of Humility
Buff: Amplified Attack
Buff: Fire Ward
Buff: Grace of Life

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

Re: Why can't I use the same skill twice?

#7 Post by rock5 » Thu Mar 11, 2010 3:58 am

That looks like it will fix it.

I'm not quite sure on usage though. I just need to clarify something.

If I want my own buffs I can use

Code: Select all

player:updateBuffs()
to update the tables player:Buffs and player:Debuffs with the players buffs and debuffs.

If I use your example it updates target.Buffs and target.Debuffs with the targets buffs and debuffs.
Does that mean that if I forget to put "target" in the brackets like this;

Code: Select all

target:updateBuffs()
it would update target.Buffs and target.Debuffs with the players buffs and debuffs?
  • 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
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Why can't I use the same skill twice?

#8 Post by Administrator » Thu Mar 11, 2010 7:44 am

Yes. That's how the RoM API works; nothing I can do about that.

Post Reply

Who is online

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