You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

141

Friday, March 26th 2010, 12:56pm

Thanks for that -- I was trying to use Attack in the function I was writing for my warrior, and didn't know why it didn't recognize it.

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

142

Friday, March 26th 2010, 1:14pm

Quoted from "Tryfaen;249664"

This macro has been working great for me but I found one small issue. If you are using threaten but for some reason end up with not enough mana to cast it, the macro wont move on to mana return.

look at some of the functions I put up for my k/w. You will find code for defining teh amount of mana I have along with polling for the amount of mana before casting a specific spell. so you can define threaten to not fire if your mana is less than 25%.


T

143

Friday, March 26th 2010, 2:05pm

Quoted from "Blueman0x76;249717"

For people who want to use Auto Attack as part of their rotation you must edit the ReadSkill() function since "Attack" is in page1.

Change this line of code

Source code

1
   for page = 2,4 do
to

Source code

1
   for page = 1,4 do
I use

Source code

1
i=i+1; Skill[i] = { ['name'] = "Attack",     ['use'] = ((not  friendly)) }
because when I tab target a new mob but have no energy/rage left as a rogue I want it to start doing white dmg


I intentionally skipped tab #1 because there aren't any combat skills on there and didn't think about using "Attack" in the engine. Good catch.

However, it looks to me like putting that line in your function would cause Attack to just keep going on/off whenever it gets to that skill. If that is the case, you might put something like: (PctH("target")==1) in your ['use'] definition, so it only executes "Attack" if you haven't started hitting the mob yet.

IIshin

Beginner

Posts: 14

Location: July 27th

  • Send private message

144

Saturday, March 27th 2010, 3:27am

Here's one I made for Scout/Warden

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function ScoutWarden(arg1)
   local Skill = {}
   local i = 0
   local focus = UnitMana("player")
   local mana  = UnitSkill("player")
   local friendly = (not UnitCanAttack("player","target"))
   local a1,a2,a3,a4,a5,ASon = GetActionInfo(1)  -- # is your Autoshot slot number

   i=i+1; Skill[i] = { ['name'] = "Briar Shield",    ['use'] = (not ChkBuff("player","Briar Shield")) }
   i=i+1; Skill[i] = { ['name'] = "Entling Offering",    ['use'] = (not ChkBuff("player","Entling Offering")) }
   i=i+1; Skill[i] = { ['name'] = "Frost Arrow",    ['use'] = (not ChkBuff("player","Frost Arrow")) }
--   i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = (not friendly)}
   i=i+1; Skill[i] = { ['name'] = "Combo Shot",           ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Autoshot",       ['use'] = ((not friendly) and (not ASon)) }
   i=i+1; Skill[i] = { ['name'] = "Shoot",           ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Thorn Arrow",     ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Hidden Peril",       ['use'] = (not friendly) }
--   i=i+1; Skill[i] = { ['name'] = "Snipe",           ['use'] = (chkBuff("player", "Hidden Peril")) }
   i=i+1; Skill[i] = { ['name'] = "Piercing Arrow",           ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Wind Arrows",    ['use'] = ((not friendly) and (focus >= 15)) }
   i=i+1; Skill[i] = { ['name'] = "Charged Chop", ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end
I don't have the lvl 45 elite yet for combo shot, but I would imagine that you'd put it after shoot once I'd get it. Also of note, Thorn Arrow doesn't trigger GCD, which is nice.

EDIT: Not sure about the coding for Snipe, will change it later.

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

145

Saturday, March 27th 2010, 4:13am

Quoted from "Sixpax;249801"


However, it looks to me like putting that line in your function would cause Attack to just keep going on/off whenever it gets to that skill. If that is the case, you might put something like: (PctH("target")==1) in your ['use'] definition, so it only executes "Attack" if you haven't started hitting the mob yet.


I did a test by manually hitting attack, and it doesn't appear to toggle -- it just keeps going until you cast another skill.

146

Monday, March 29th 2010, 10:14pm

Just a general note for those creating Scout functions: make sure to use Combo Shot before using Serenity. Reason is that Serenity will also reset your CS cool down.

147

Tuesday, March 30th 2010, 12:51pm

Rogue/Knight Poison Protection

Heya, been using my Rogue/Knight macros leeched from here and can't live without them now <3

I was wondering if I could put my Elite skill [Poison Protection] to better use as I find myself rarely using it because of it's fairly short duration and long cooldown.

I was wondering if I could throw it into the mix and use it a little like the Scouts Throat Attack found in this thread, in the way that the macro detects poison being cast and then applies PP?

I'm fairly sceptical as to whether this is at all possible as I think that the TA method doesn't need to "know" what is being cast by a mob - it just activates at any cast [['use'] = ((not friendly) and (tspell ~= nil))] but for Poison Protection it would need to know whether the mob is casting Poison specifically for it to be effective.
[edit] I just noticed that some mobs don't actually seem to cast poison, rather that it's an instant effect... so I guess it wouldn't work in those situations, but I'm sure mobs like the scorpion in Aslan do cast poison.

Is this possible at all?
______________________

Oh and whilst we're at it, I started a Druid and I was trying to use jsalemi's functions he posted earlier. The problem I have is that antidote seems to try and cast on the enemy target rather than on yourself.

Source code

1
   i=i+1; Skill[i] = { ['name'] = "Antidote",    ['use'] = (string.find(dbuffs,"Poisoned")) }

148

Tuesday, March 30th 2010, 3:26pm

I will look at making the changes you suggested.
What we use now is listed below.
I like to force Punch and Entangle.
THis is the only way I could make it work.

function WardenDruid(arg1)
local Skill = {}
local i = 0
local tgt = "player"
local friendly = false
local combat = GetPlayerCombatState()

if not UnitCanAttack("player","target") then
tgt = "target"
friendly = true
end
local health = PctH(tgt)
if (UnitExists("pet") == true) then
UsePetAction(6);
UsePetAction(7);
end
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")

i=i+1; Skill = { ['name'] = "Savage Blessing", ['use'] = (friendly and (not string.find(tbuffs,"Regenerate"))) }
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = ((not friendly) and (health <= .70) and (not string.find(pbuffs,"Recover"))) }
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = (friendly and (health <= .70) and (not string.find(tbuffs,"Recover"))) }
i=i+1; Skill[i] = { ['name'] = "Thorny Vine", ['use'] = ((not friendly) and (not string.find(tbuffs,"Thorny Vine"))) }
i=i+1; Skill[i] = { ['name'] = "Power of the Wood Spirit", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Charged Chop", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Earth Pulse", ['use'] = (not friendly)}

MyCombat(Skill,arg1)
end

=====================================================

Quoted from "Sixpax;247998"

I started working on that last night myself. The main problem I ran into was Elven Prayer requiring your pet to be targeted (how stupid is that... it's not like I'm going to cast it on anything else). For that I just put in some code before the Skill definitions to handle it.

I noticed the pet skills can be set to automatically fire so I didn't need to worry about managing them within the engine.

Be aware that my Warden is only level 11 so I'm still fairly ignorant of the challenges in playing the class, but I'll be happy to help if you can spell out what they are.

I don't have my code in front of me, but basically it looks something like this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function WardenScout(arg1)
    local Skill = {}
    local i = 0
    local mana = UnitMana("player")/UnitMaxMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pet = UnitExists("playerpet")
    local combat = GetPlayerCombatState()
   
    if pet then
        if (PctH("playerpet") < 0.5) and CD("Elven Prayer") then
            if UnitExists("target") then
                FocusUnit(1,"target")
                TargetUnit("playerpet")
                CastSpellByName("Elven Prayer")
                TargetUnit("focus1")
                FocusUnit(1,"")
                return
            else
                TargetUnit("playerpet")
                CastSpellByName("Elven Prayer")
                return
            end
        elseif combat and (not friendly) then
            UsePetAction(3)        -- Pet attacks my target
        end
    end

    i=i+1; Skill[i] = { ['name'] = "Briar Shield",                ['use'] = (not combat) }
    i=i+1; Skill[i] = { ['name'] = "Summon Spirit of the Oak",    ['use'] = ((not combat) and (not pet)) }
    i=i+1; Skill[i] = { ['name'] = "Shot",                        ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Thorny Vine",                ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Vampire Arrows",            ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Power of the Wood Spirit",    ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end

149

Tuesday, March 30th 2010, 8:46pm

Quoted from "Provoke;251201"

Heya, been using my Rogue/Knight macros leeched from here and can't live without them now <3

I was wondering if I could put my Elite skill [Poison Protection] to better use as I find myself rarely using it because of it's fairly short duration and long cooldown.

I was wondering if I could throw it into the mix and use it a little like the Scouts Throat Attack found in this thread, in the way that the macro detects poison being cast and then applies PP?

I'm fairly sceptical as to whether this is at all possible as I think that the TA method doesn't need to "know" what is being cast by a mob - it just activates at any cast [['use'] = ((not friendly) and (tspell ~= nil))] but for Poison Protection it would need to know whether the mob is casting Poison specifically for it to be effective.
[edit] I just noticed that some mobs don't actually seem to cast poison, rather that it's an instant effect... so I guess it wouldn't work in those situations, but I'm sure mobs like the scorpion in Aslan do cast poison.

Is this possible at all?


First, just a clarification... I think that's the old Throat Attack logic. I revised that to make sure the mob's cast actually had a duration, otherwise TA was firing on instant cast spells. Here's how the TA skill should be defined:

Source code

1
   i=i+1; Skill[i] = { ['name'] = "Throat Attack",      ['use'] = ((not friendly) and (ttime >= 1) and ((ttime - telapsed) > 0.5)) }
So if the mob's cast time is 1s or more and there's still at least 0.5s left in his cast, it uses TA.

Anyway as for your request for Poison Protection, I'm assuming it won't remove poison effects, but rather protect you from getting them correct? In that case, it won't work for instant cast spells. However, if the mob's spell does have a long cast time, you could use the same logic but you'll need to probably add string searches for the name of the spell being cast. Assuming the word "poison" appears in those spells, you could do something like:

Source code

1
   i=i+1; Skill[i] = { ['name'] = "Poison Protection",      ['use'] = ((not friendly) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and string.find(string.lower(tspell),"poison")) }

Quoted from "Provoke;251201"

Oh and whilst we're at it, I started a Druid and I was trying to use jsalemi's functions he posted earlier. The problem I have is that antidote seems to try and cast on the enemy target rather than on yourself.

Source code

1
   i=i+1; Skill[i] = { ['name'] = "Antidote",    ['use'] = (string.find(dbuffs,"Poisoned")) }


Do you have self-cast enabled? I would think that spell would adhere to the same rules as say a heal so it casts on you if you have an enemy targeted with self-cast enabled. If not, you'll have to add some code to do the targeting.

150

Tuesday, March 30th 2010, 9:17pm

Thanks for the response.

Quoted from "Sixpax;251346"

Do you have self-cast enabled? I would think that spell would adhere to the same rules as say a heal so it casts on you if you have an enemy targeted with self-cast enabled. If not, you'll have to add some code to do the targeting.


I did not have sell-cast enabled :o
I just enabled it - and hey presto it works. Feel like a right old noob now.
I wonder what and if there is a downside of having self-cast enabled...


As for the Rogue macro help - you are correct in presuming it doesn't remove the effect but is a protection spell. I figured it wouldn't work on instant-poison hits (I've only encountered Ents up to now that instantly poison you). I'm going to have to travel back to Aslan to try out your new function where I know there are poison scorpions with a pretty long poison cast-time to try it out - and I'll get back to you on how it worked.

Thanks for your time.

151

Wednesday, March 31st 2010, 2:10am

Quoted from "Sixpax;251346"


Anyway as for your request for Poison Protection, I'm assuming it won't remove poison effects, but rather protect you from getting them correct? In that case, it won't work for instant cast spells. However, if the mob's spell does have a long cast time, you could use the same logic but you'll need to probably add string searches for the name of the spell being cast. Assuming the word "poison" appears in those spells, you could do something like:

Source code

1
   i=i+1; Skill[i] = { ['name'] = "Poison Protection",      ['use'] = ((not friendly) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and string.find(string.lower(tspell),"poison")) }

I tried the above code and got this error:

[string '?']:199: attempt to compare number with nil

Needless to say I'm clueless as to what that means.

152

Wednesday, March 31st 2010, 1:08pm

Quoted from "Provoke;251469"

I tried the above code and got this error:

[string '?']:199: attempt to compare number with nil

Needless to say I'm clueless as to what that means.


That's probably because you don't have ttime and/or telapsed defined. My guess is you have something like this line in your function:

Source code

1
   local tspell = UnitCastingTime("target")
If so replace it with the following line. If not just add the following line above your skill definitions.

Source code

1
   local tspell,ttime,telapsed = UnitCastingTime("target")

153

Wednesday, March 31st 2010, 10:34pm

I'm just starting to get my feet wet with this combat engine, but I'm absolutely loving it so far. I do have two questions though.

Please note the Mana Return line.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function KnightScout(arg1,arg2)
   local Skill = {}
   local i = 0
   local friendly = (not UnitCanAttack("player","target"))
   local shield = (GetEquipSlotInfo(17) ~= nil)
   local combat = GetPlayerCombatState()
   local mana = PctM("player")
   local pbuffs = BuffList("player")
   local tbuffs = BuffList("target")

   i=i+1; Skill[i] = { ['name'] = "Holy Seal",              ['use'] = (not string.find(pbuffs,"Holy Seal")) }
   i=i+1; Skill[i] = { ['name'] = "Enhanced Armor",       ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
   i=i+1; Skill[i] = { ['name'] = "Vampire Arrows",       ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Charge",                   ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Hatred Strike",        ['use'] = ((not string.find(pbuffs,"Hatred Strike")) and (arg2 == "tank")) }
   i=i+1; Skill[i] = { ['name'] = "Threaten",             ['use'] = (string.find(tbuffs,"Holy Seals 3") and (not string.find(pbuffs,"Threaten")) and (arg2 == "tank")) }
   i=i+1; Skill[i] = { ['name'] = "Mana Return",          ['use'] = (string.find(tbuffs,"Holy Seals 3") and (mana <= .75)) }
   i=i+1; Skill[i] = { ['name'] = "Punishment",           ['use'] = ((not friendly) and string.find(tbuffs,"Light Seal III")) }
   i=i+1; Skill[i] = { ['name'] = "Holy Strike",          ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end
Is this set up correctly so that Mana Return will only cast if the target has 3 Holy Seals, AND I have 75% or less mana?

Also, I was trying to edit this line...

Source code

1
i=i+1; Skill[i] = { ['name'] = "Whirlwind Shield",     ['use'] = ((not friendly) and shield) }
...to only activate with the /run KnightScout("","tank") macro - so I'll only use Threaten and Whirlwind Shield while in a party - but I can't seem to get it to work properly. Instead, Whirlwind Shield activates every time in the loop, or the macro doesn't work at all.

Please provide confirmation or correction of Mana Return question, and suggestion for Whirlwind Shield question.

Thank you very, very much in advance.

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

154

Wednesday, March 31st 2010, 10:56pm

MR should work like that, yes.

as for WWS, this should work

Source code

1
i=i+1; Skill[i] = { ['name'] = "Whirlwind Shield",     ['use'] = (shield and (not friendly) and (arg2 == "tank")) }

155

Wednesday, March 31st 2010, 11:15pm

Awesome. Thanks a lot, Tigsman. I'll try this as soon as I get home.

Here's my updated CE, for those who may be interested.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function KnightScout(arg1,arg2)
   local Skill = {}
   local i = 0
   local friendly = (not UnitCanAttack("player","target"))
   local shield = (GetEquipSlotInfo(17) ~= nil)
   local combat = GetPlayerCombatState()
   local health = PctH("player")
   local mana = PctM("player")
   local pbuffs = BuffList("player")
   local tbuffs = BuffList("target")

   i=i+1; Skill[i] = { ['name'] = "Hall of Dead Heroes",  ['use'] = ((health <= .10) and (arg2 == "tank")) }
   i=i+1; Skill[i] = { ['name'] = "Holy Seal",            ['use'] = (not string.find(pbuffs,"Holy Seal")) }
   i=i+1; Skill[i] = { ['name'] = "Enhanced Armor",       ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
   i=i+1; Skill[i] = { ['name'] = "Vampire Arrows",       ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Charge",               ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Whirlwind Shield",     ['use'] = (shield and (not friendly) and (arg2 == "tank")) }
   i=i+1; Skill[i] = { ['name'] = "Hatred Strike",        ['use'] = ((not string.find(pbuffs,"Hatred Strike")) and (arg2 == "tank")) }
   i=i+1; Skill[i] = { ['name'] = "Threaten",             ['use'] = (string.find(tbuffs,"Holy Seals 3") and (not string.find(pbuffs,"Threaten")) and (arg2 == "tank")) }
   i=i+1; Skill[i] = { ['name'] = "Mana Return",          ['use'] = (string.find(tbuffs,"Holy Seals 3") and (mana <= .75)) }
   i=i+1; Skill[i] = { ['name'] = "Punishment",           ['use'] = ((not friendly) and string.find(tbuffs,"Light Seal III")) }
   i=i+1; Skill[i] = { ['name'] = "Holy Strike",          ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end

156

Thursday, April 1st 2010, 12:33am

Hm, it doesn't work. When I took out the following lines, it does:

Source code

1
2
3
4
5
   local health = PctH("player")
   local mana = PctM("player")
...
   i=i+1; Skill[i] = { ['name'] = "Hall of Dead Heroes",  ['use'] = ((health <= .10) and (arg2 == "tank")) }
   i=i+1; Skill[i] = { ['name'] = "Mana Return",          ['use'] = (string.find(tbuffs,"Holy Seals 3") and (mana <= .75)) }

So it's obviously something with the percentages. What am I doing wrong?

Thanks again.

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

157

Thursday, April 1st 2010, 1:04am

if you dont have PctM("player") and PctH("player") predefined, it will bail on ya.

Source code

1
2
3
4
5
6
7
function PctM(tgt)
   return (UnitMana(tgt)/UnitMaxMana(tgt))
end

function PctH(tgt)
   return (UnitHealth(tgt)/UnitMaxHealth(tgt))
   end

158

Thursday, April 1st 2010, 1:49am

Quoted from "Sixpax;251609"

That's probably because you don't have ttime and/or telapsed defined. My guess is you have something like this line in your function:

That was the problem.

Have a new one - it seems to me that it throws up this error with mobs that cast something other than poison, with this error:

[sting '?']:200: bad argument #1 to 'lower' (string expected, got nil)

159

Thursday, April 1st 2010, 4:53am

Thanks again Tigsman, I really appreciate the continued assistance.
I copied your snippet into the LUA, and it works perfectly.
I had thought something may have been off about the % function, but didn't know exactly what I needed to do.

I love this thing.

Finally, is there a way to incorporate item usage into this? Preferably by name, not action bar slot...

160

Thursday, April 1st 2010, 2:38pm

Quoted from "Provoke;251924"

That was the problem.

Have a new one - it seems to me that it throws up this error with mobs that cast something other than poison, with this error:

[sting '?']:200: bad argument #1 to 'lower' (string expected, got nil)


Argh! That error bites me every time. Sorry about that.

Try this:

Source code

1
    i=i+1; Skill[i] = { ['name'] = "Poison Protection",      ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and string.find(string.lower(tspell),"poison")) }