Best way to stop casting Disarmament once stacked 4 times.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

Best way to stop casting Disarmament once stacked 4 times.

#1 Post by Mushroomstamp » Fri Nov 05, 2010 1:09 pm

I'd like to stack disarmament 4 times to start a fight, but then not use it again in that fight, or at least until the affect wears off. What would be the easiest way to do this?

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

Re: Best way to stop casting Disarmament once stacked 4 time

#2 Post by rock5 » Fri Nov 05, 2010 6:24 pm

You could set its maxuse value to 1

Code: Select all

<skill name="KNIGHT_DISARMAMENT"  modifier="" hotkey="macro" priority="90" maxuse="1"/>
Then, in the <onSkillCast> section, check if the skill is Disarmament, if so then it casts it another 3 times.

Code: Select all

if arg1.Name == "KNIGHT_DISARMAMENT" then
   player:cast("KNIGHT_DISARMAMENT");
   player:cast("KNIGHT_DISARMAMENT");
   player:cast("KNIGHT_DISARMAMENT");
end
That's simple but just remember it isn't checking health or mana during that time.
  • 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

Mushroomstamp
Posts: 210
Joined: Wed Oct 27, 2010 11:34 am

Re: Best way to stop casting Disarmament once stacked 4 time

#3 Post by Mushroomstamp » Sat Nov 06, 2010 9:09 am

Perfect - thanks Rock!

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Best way to stop casting Disarmament once stacked 4 time

#4 Post by jduartedj » Sat Nov 06, 2010 10:22 am

rock5 wrote:You could set its maxuse value to 1

Code: Select all

<skill name="KNIGHT_DISARMAMENT"  modifier="" hotkey="macro" priority="90" maxuse="1"/>
Then, in the <onSkillCast> section, check if the skill is Disarmament, if so then it casts it another 3 times.

Code: Select all

if arg1.Name == "KNIGHT_DISARMAMENT" then
   player:cast("KNIGHT_DISARMAMENT");
   player:cast("KNIGHT_DISARMAMENT");
   player:cast("KNIGHT_DISARMAMENT");
end
That's simple but just remember it isn't checking health or mana during that time.

BTW is there already a way to check if you got so many stacked of such buff?
I was thinking in this case, and not have it without checking for HP/MP, you could use checking the buff created by this skill and then if its <4 cast it, i think that would work, But checking buff stacks would be good in a lot of skills.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

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

Re: Best way to stop casting Disarmament once stacked 4 time

#5 Post by rock5 » Sat Nov 06, 2010 9:31 pm

jduartedj wrote:BTW is there already a way to check if you got so many stacked of such buff?
Some of the skills in the skills database include buff and debuff requirements, eg.

Code: Select all

<skill name="WARRIOR_TACTICAL_ATTACK" aslevel="4" skilltab="4" skillnum="4" rage="15" range="50" cooldown="5" type="damage" target="enemy" reqbufftype="debuff" reqbuffcount="1" reqbufftarget="target" reqbuffname="Bleed" />
but not many of them do. This is mainly because updateBuffs uses RoMScript, which is slow and unreliable, so you want to minimize it's use and there is a delay between casting a spell and the debuff appearing on the mob so the skill usually casts too many times. So if you want to update the skills.xml database, you're free to do so.

There are also buff functions pawn:hasBuff() and pawn:hasDebuff() but they don't return the number even though updateBuffs does collect that information.

I guess the easiest way to do it would be to run

Code: Select all

target=player:getTarget()()
target:updateBuffs()
for i = 3, target.Debuffs["Disarmament debuff name"), -1 do -- Not sure what the debuff is called
    player:cast("KNIGHT_DISARMAMENT");
end
Note: This way only uses updateBuffs once then uses the for loop to cast the skill the correct number of times. This is to reduce the use of updateBuffs.
  • 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

fluxus
Posts: 8
Joined: Thu Aug 05, 2010 8:54 am

Re: Best way to stop casting Disarmament once stacked 4 time

#6 Post by fluxus » Fri Nov 12, 2010 7:55 am

i have been using this config for quite some time

Code: Select all

<onSkillCast>
	local target = player:getTarget();
	local bool, count = target:hasDebuff("Heilige Siegel (3)");
	if bool == true then
		player:cast("KNIGHT_MANA_ABSORPTION");
	end;
	local bool, count = target:hasDebuff("Abrüstung IV");
	if bool == false then
		player:cast("KNIGHT_DISARMAMENT");
	end;
</onSkillCast>
u have to replace "Heilige Siegel (3)" and "Abrüstung IV" with the corresponding debuff name of your client language

-flix

Petzzz
Posts: 12
Joined: Tue Nov 16, 2010 10:47 am

Re: Best way to stop casting Disarmament once stacked 4 time

#7 Post by Petzzz » Tue Nov 16, 2010 11:01 am

<onSkillCast>
local target = player:getTarget();
local bool, count = target:hasDebuff("Heilige Siegel (3)");
if bool == true then
player:cast("KNIGHT_MANA_ABSORPTION");
end;
local bool, count = target:hasDebuff("Abr\129stung IV");
if bool == false then
player:cast("KNIGHT_DISARMAMENT");
end;
</onSkillCast>

works better (ü=\129)

any idea how to stop casting KNIGHT_DISARMAMENT at buffing myself?
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_6" priority="80" autouse="false" inbattle="true" /> didnt work

rock5 code didnt work

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

Re: Best way to stop casting Disarmament once stacked 4 time

#8 Post by rock5 » Tue Nov 16, 2010 11:12 am

I don't know about umlauts but are the debuffs supposed to have the numbers after their names? After all that's what the 'count' variable is for. Try it without the numbers.
  • 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

Petzzz
Posts: 12
Joined: Tue Nov 16, 2010 10:47 am

Re: Best way to stop casting Disarmament once stacked 4 time

#9 Post by Petzzz » Wed Nov 17, 2010 8:02 am

problem is that the debuff cout is not 1,2,3 its I,II,III,IV so we need a reqdebuffcount= < 4 or IV
without nummbers bot just spam the skilll

maybe target:hasDebuff("Abr\129stung (IV)"); works, ill give it a test and post what happend.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest