Cant get my knight so use punishment

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Jengoso
Posts: 20
Joined: Sun Oct 24, 2010 5:05 am

Cant get my knight so use punishment

#1 Post by Jengoso » Thu Nov 11, 2010 5:34 pm

Testing knight class but I cant seem to get him to use punishment. Basically I would like him to use 2 holy strikes (I find that 2 is usually enough combined with disarm and punishment to finish a mob of at these levels), 2 disarm and then punishment. Here is the script I use:

<skill name="KNIGHT_HOLY_STRIKE" modifier="" hotkey="VK_3" priority="90" maxuse="2" />
<skill name="KNIGHT_PUNISHMENT" modifier="" hotkey="VK_2" priority="100" />
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_4" priority="70" />
<skill name="KNIGHT_HOLY_SHIELD" modifier="" hotkey="VK_7" priority="60" inbattle="true" hpper="15" />
<skill name="KNIGHT_HOLY_SEAL" modifier="" hotkey="VK_5" priority="80" />

Too me this would mean that he should use 2 holys, 2 disarms and then punishmen or holy, punishment, disarm. But obviously not, he uses 1 holy, 1 disarm, 1 holy, 1 disarm and then just keep using disarm and no punishment. Any ideas?

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

Re: Cant get my knight so use punishment

#2 Post by jduartedj » Thu Nov 11, 2010 6:42 pm

Jengoso wrote:Testing knight class but I cant seem to get him to use punishment. Basically I would like him to use 2 holy strikes (I find that 2 is usually enough combined with disarm and punishment to finish a mob of at these levels), 2 disarm and then punishment. Here is the script I use:

<skill name="KNIGHT_HOLY_STRIKE" modifier="" hotkey="VK_3" priority="90" maxuse="2" />
<skill name="KNIGHT_PUNISHMENT" modifier="" hotkey="VK_2" priority="100" />
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_4" priority="70" />
<skill name="KNIGHT_HOLY_SHIELD" modifier="" hotkey="VK_7" priority="60" inbattle="true" hpper="15" />
<skill name="KNIGHT_HOLY_SEAL" modifier="" hotkey="VK_5" priority="80" />

Too me this would mean that he should use 2 holys, 2 disarms and then punishmen or holy, punishment, disarm. But obviously not, he uses 1 holy, 1 disarm, 1 holy, 1 disarm and then just keep using disarm and no punishment. Any ideas?

Why don't you use the "required buff" options instead? I think It would make much more sense!

Code: Select all

reqbufftype="debuff" reqbuffcount="2" reqbufftarget="target" reqbuffname="buff's name"
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: Cant get my knight so use punishment

#3 Post by rock5 » Thu Nov 11, 2010 6:56 pm

This post may be of help.
http://www.solarstrike.net/phpBB3/viewt ... =21&t=1758

Basically it goes through the list of skills 1 at a time. If you use maxuse of 2 then it will cast it the second time round but then no more. If you want to cast 2 skills in a row try adding this to your <onSkillCast> section.

Code: Select all

if arg1.Name == "KNIGHT_HOLY_STRIKE" then
    target=player:getTarget()()
    target:updateBuffs()
    local n = 2 -- The number of debuffs you want
    for i = (n-1), target.Debuffs["Light Seal"), -1 do -- Is that the right debuff name?
        player:cast("KNIGHT_HOLY_STRIKE");
    end
elseif arg1.Name == "KNIGHT_DISARMAMENT" then
    target=player:getTarget()()
    target:updateBuffs()
    local n = 2 -- The number of debuffs you want
    for i = (n-1), target.Debuffs["Disarmament"), -1 do
        player:cast("KNIGHT_DISARMAMENT");
    end
end
Then adjust the priorities of your skills so they cast in the right order.

See how that 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

Sumdumguy
Posts: 24
Joined: Mon Aug 30, 2010 6:03 am

Re: Cant get my knight so use punishment

#4 Post by Sumdumguy » Fri Nov 12, 2010 5:52 am

On a totally unrelated topic:

Punishment is absolutely useless at later levels when your weapon does more damage, as punishment is not based on weapon damage and it does not generate aggro.

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: Cant get my knight so use punishment

#5 Post by Cindy » Sat Oct 27, 2012 4:30 pm

<onSkillCast><![CDATA[
-- Additional Lua code to execute when casting a skill
-- Note: arg1 contains the skill being used.

-- Knight Holy strike doubler
if arg1.Name == "KNIGHT_HOLY_STRIKE" then
target=player:getTarget()()
target:updateBuffs()
local n = 3 -- The number of debuffs you want
for i = (n-1), target.Debuffs["Light Seal"), -1 do -- Is that the right debuff name?
-- player:cast("KNIGHT_HOLY_STRIKE");
end
--elseif arg1.Name == "KNIGHT_DISARMAMENT" then
-- target=player:getTarget()()
-- target:updateBuffs()
-- local n = 4 -- The number of debuffs you want
-- for i = (n-1), target.Debuffs["Disarmament"), -1 do
-- player:cast("KNIGHT_DISARMAMENT");
-- end
end
]]></onSkillCast>

Results in
"Failed to compile and run Lua code for OnSkillCast in character profile".

As you can see I did some debugging.... when I uncommented the for loop, the code died. Any ideas?

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

Re: Cant get my knight so use punishment

#6 Post by lisa » Sat Oct 27, 2012 9:06 pm

My guess your issue is here

Code: Select all

 target.Debuffs["Light Seal")
notice the [ and )
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

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: Cant get my knight so use punishment

#7 Post by Cindy » Sun Oct 28, 2012 5:18 pm

yes.

code is from a rock5 post, and neither [] nor () appears to work....

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

Re: Cant get my knight so use punishment

#8 Post by lisa » Sun Oct 28, 2012 6:54 pm

Cindy wrote:yes.

code is from a rock5 post, and neither [] nor () appears to work....
could you be more specific?

saying it doesn't appear to work isn't exactly telling me what is happening.

--=== Added ===--

OMG Rock did put the [ ) [ ) twice in the code he posted, so I'm not the only one to post "broken" code after all lmao

--=== Added something usefull ===--
you have this

Code: Select all

target=player:getTarget()()
it will cause an error saying failing to compile.

I suspect you want something like this
have knight holy strike as autouse = false in your profile, then add this

Code: Select all

<onSkillCast><![CDATA[
   local target = player:getTarget()
   if target:hasDebuff("Light Seal (3)") then
      player:cast("KNIGHT_HOLY_STRIKE");
   end
]]></onSkillCast>
Mind you I thought the light seals were good for mana return, ohh well.

I guess you could do both if you wanted, have mana return autouse = false in profile aswell.

Code: Select all

<onSkillCast><![CDATA[
   local target = player:getTarget()
   if target:hasDebuff("Light Seal (3)") then
      if 400 > player.MP then -- could do a % thing here
            player:cast("KNIGHT_MANA_RETURN");
      else
            player:cast("KNIGHT_HOLY_STRIKE");
      end
   end
]]></onSkillCast>
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: Cant get my knight so use punishment

#9 Post by rock5 » Sun Oct 28, 2012 9:25 pm

I think an important issue, too, is that there is no target.Debuff. I think there might have been once but that was a long time ago. But even if you use "target.Buffs" you can't access them any more like this target.Buffs["Light Seal"] because the Buffs table isn't structured like that anymore. So that post you got that code from must have been pretty old :)
  • 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: Cant get my knight so use punishment

#10 Post by lisa » Sun Oct 28, 2012 10:34 pm

rock5 wrote:I think an important issue, too, is that there is no target.Debuff. I think there might have been once but that was a long time ago. But even if you use "target.Buffs" you can't access them any more like this target.Buffs["Light Seal"] because the Buffs table isn't structured like that anymore. So that post you got that code from must have been pretty old :)
Thu Nov 11, 2010 5:56 pm

Hmmm just a little old there.
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

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: Cant get my knight so use punishment

#11 Post by Cindy » Sun Oct 28, 2012 11:08 pm

Yes, perhaps we need an "obsolete" marker :)


Yes, I was trying to get my knight to stack attacks and whatnot properly. Eventually I'd like to be able to bot some instance boss fights:) I have dreams of bots doing Hos colors boss. My preliminary thinking is that I'd have to just quickly teleport to each crystal and activate right click, since I am not sure if the bot can figure out which crystal is which color and head to the correct one.

Also I want to figure out champion battling, and that is very heavily dependent on right buffs with the right preconditions and right actions.

This 'botting game' is a lot more fun than the actual game ;)

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

Re: Cant get my knight so use punishment

#12 Post by rock5 » Mon Oct 29, 2012 12:25 am

Looks like you are still after code that reproduces the original code. Try this

Code: Select all

if arg1.Name == "KNIGHT_HOLY_STRIKE" then
	local target=player:getTarget()
	local n = 3 -- The number of debuffs you want
	local buff=target:getBuff("Light Seal")
	if buff then n = n - buff.Count
	for i = 1, n do
		player:cast("KNIGHT_HOLY_STRIKE");
	end
elseif arg1.Name == "KNIGHT_DISARMAMENT" then
	local target=player:getTarget()
	local n = 4 -- The number of debuffs you want
	local buff=target:getBuff("Disarmament")
	if buff then n = n - buff.Count
	for i = 1, n do
		player:cast("KNIGHT_DISARMAMENT");
	end
end
  • 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
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cant get my knight so use punishment

#13 Post by botje » Mon Oct 29, 2012 4:22 am

how would this code work then?

Code: Select all

local targetPawn = CPawn(player.TargetPtr);
		 if( arg1.Name == "KNIGHT_MANA_ABSORPTION" ) then
			 if( targetPawn ~= nill and targetPawn ~= 0 and targetPawn ~= player.Address ) then
				local bool, count = targetPawn:hasDebuff("Holy Seals (3)");
				if( bool == true ) then
					return true;
				else
					return false;
				end
			 else
				return true;
			 end
		 else
			 return true;
		 end

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

Re: Cant get my knight so use punishment

#14 Post by lisa » Mon Oct 29, 2012 4:43 am

targetPawn ~= nill
don't think nill would work
local bool, count = targetPawn:hasDebuff("Holy Seals (3)");
you don't use the count so don't need it in there

Code: Select all

if targetPawn:hasDebuff("Holy Seals (3)") then
        return true;
else
        return false;
end
would be enough.
targetPawn ~= player.Address
Not sure you would need this check as it shouldn't try to use the skill on yourself and you wouldn't have the required buff anyway.

It "should" work though ;)
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: Cant get my knight so use punishment

#15 Post by rock5 » Mon Oct 29, 2012 7:32 am

Can it even use that skill when the entry in the database doesn't even have an id?
  • 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

scithen
Posts: 25
Joined: Sun Oct 21, 2012 9:55 pm

Re: Cant get my knight so use punishment

#16 Post by scithen » Tue Oct 30, 2012 2:16 pm

This might be a silly answer, but couldn't you set the cast priority to false and do something like this?

Code: Select all

<skill name="KNIGHT_HOLY_STRIKE" modifier="" hotkey="VK_3" priority="90" />
<skill name="KNIGHT_HOLY_STRIKE" modifier="" hotkey="VK_3" priority="90" />
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_4" priority="70" />
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_4" priority="70" />
<skill name="KNIGHT_PUNISHMENT" modifier="" hotkey="VK_2" priority="100" />
<skill name="KNIGHT_HOLY_SHIELD" modifier="" hotkey="VK_7" priority="60" inbattle="true" hpper="15" />
<skill name="KNIGHT_HOLY_SEAL" modifier="" hotkey="VK_5" priority="80" />
Since priority to false means it'll cast sequentially instead.

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

Re: Cant get my knight so use punishment

#17 Post by rock5 » Tue Oct 30, 2012 10:33 pm

If PRIORITY_CASTING is false or it doesn't exist (because it defaults to false) then it will cast sequentially. Let me clarify, though, it's sequentially by the priority numbers. So it wont cast in the order listed above but like this.

Code: Select all

<skill name="KNIGHT_PUNISHMENT" modifier="" hotkey="VK_2" priority="100" />
<skill name="KNIGHT_HOLY_STRIKE" modifier="" hotkey="VK_3" priority="90" />
<skill name="KNIGHT_HOLY_STRIKE" modifier="" hotkey="VK_3" priority="90" />
<skill name="KNIGHT_HOLY_SEAL" modifier="" hotkey="VK_5" priority="80" />
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_4" priority="70" />
<skill name="KNIGHT_DISARMAMENT" modifier="" hotkey="VK_4" priority="70" />
<skill name="KNIGHT_HOLY_SHIELD" modifier="" hotkey="VK_7" priority="60" inbattle="true" hpper="15" />
Just so you understand, if PRIORITY_CASTING is enabled then it always casts the highest priority skill first so it might never get to the later skills in the list (excluding friendly skills which are always checked).
  • 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

scithen
Posts: 25
Joined: Sun Oct 21, 2012 9:55 pm

Re: Cant get my knight so use punishment

#18 Post by scithen » Wed Oct 31, 2012 10:20 pm

Well that explains a few things I've noticed in my own profiles.. thanks for clearing that up for me.

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Cant get my knight so use punishment

#19 Post by botje » Fri Nov 02, 2012 4:27 am

rock5 wrote:Looks like you are still after code that reproduces the original code. Try this

Code: Select all

if arg1.Name == "KNIGHT_HOLY_STRIKE" then
	local target=player:getTarget()
	local n = 3 -- The number of debuffs you want
	local buff=target:getBuff("Light Seal")
	if buff then n = n - buff.Count
	for i = 1, n do
		player:cast("KNIGHT_HOLY_STRIKE");
	end
elseif arg1.Name == "KNIGHT_DISARMAMENT" then
	local target=player:getTarget()
	local n = 4 -- The number of debuffs you want
	local buff=target:getBuff("Disarmament")
	if buff then n = n - buff.Count
	for i = 1, n do
		player:cast("KNIGHT_DISARMAMENT");
	end
end
this fails to compile and run :(

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

Re: Cant get my knight so use punishment

#20 Post by lisa » Fri Nov 02, 2012 4:39 am

make this

Code: Select all

if buff then n = n - buff.Count
into this

Code: Select all

if buff then n = n - buff.Count end
Make sure you get both of them.
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

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests