Cant get my knight so use punishment
Cant get my knight so use punishment
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?
<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?
Re: Cant get my knight so use punishment
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! 
Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Re: Cant get my knight so use punishment
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.Then adjust the priorities of your skills so they cast in the right order.
See how that works.
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
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
Re: Cant get my knight so use punishment
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.
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.
Re: Cant get my knight so use punishment
<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?
-- 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?
Re: Cant get my knight so use punishment
My guess your issue is here
notice the [ and )
Code: Select all
target.Debuffs["Light Seal")
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cant get my knight so use punishment
yes.
code is from a rock5 post, and neither [] nor () appears to work....
code is from a rock5 post, and neither [] nor () appears to work....
Re: Cant get my knight so use punishment
could you be more specific?Cindy wrote:yes.
code is from a rock5 post, and neither [] nor () appears to work....
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()()
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>
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cant get my knight so use punishment
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
Re: Cant get my knight so use punishment
Thu Nov 11, 2010 5:56 pmrock5 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
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cant get my knight so use punishment
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

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

Re: Cant get my knight so use punishment
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
Re: Cant get my knight so use punishment
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
Re: Cant get my knight so use punishment
don't think nill would worktargetPawn ~= nill
you don't use the count so don't need it in therelocal bool, count = targetPawn:hasDebuff("Holy Seals (3)");
Code: Select all
if targetPawn:hasDebuff("Holy Seals (3)") then
return true;
else
return false;
end
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.targetPawn ~= player.Address
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Cant get my knight so use punishment
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
Re: Cant get my knight so use punishment
This might be a silly answer, but couldn't you set the cast priority to false and do something like this?
Since priority to false means it'll cast sequentially instead.
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" />
Re: Cant get my knight so use punishment
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.
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).
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" />
- 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
Re: Cant get my knight so use punishment
Well that explains a few things I've noticed in my own profiles.. thanks for clearing that up for me.
Re: Cant get my knight so use punishment
this fails to compile and runrock5 wrote:Looks like you are still after code that reproduces the original code. Try thisCode: 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

Re: Cant get my knight so use punishment
make this
into this
Make sure you get both of them.
Code: Select all
if buff then n = n - buff.Count
Code: Select all
if buff then n = n - buff.Count end
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest