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.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

21

Wednesday, November 2nd 2011, 1:19pm

Quoted from "ghostwolf82;480137"

...The change made to your Low Blow line is a subtle one, but should work for what you ask for. If (a and b) are both true, OR if c is true, then do not cast Low Blow. Which in this case if you have ET then LB...

Actually, as i read it again, I realize there is still going to be an error... it should be

Source code

1
(not pbuffs['Energy Thief'])
Which would make you use LB if you do not have ET, however if you have ET buff, then skip LB. Sorry for the missing 'not' before. Can't believe I missed that.

Just wanted to point out that just using not isn't going to be enough. As written with ghostwolf's correction, it would try to use Low Blow when your energy is below 25 and you don't have Energy Thief. The parentheses need to also be re-worked so the logic comes out right. Here's a corrected version:

Source code

1
{ name = "Low Blow",        use = (EnergyBar1 >= 25) and ((tbuffs[620313] and not tbuffs[500704]) or not pbuffs['Energy Thief']) },


For the curious, here's a long winded explanation as to why it wouldn't work right.

Lua gives priority to the and operator (and statements are evaluated before or statements). Lua also uses short-circuited logic meaning that as soon as the result of the logic operation can be determined, the rest of the logic statement is skipped. These facts have to be kept in mind or you end up with something that wasn't intended.

The corrected line was (with simple labels for the buffs/debuffs)

Source code

1
use = (Energy >= 25) and (A and not B) or (not C)

So if Energy is less than 25, the left side of the first and statement is false. Since false and'ed with anything will give a result of false, the (A and not B) part is never evaluated at all. Lua only now will perform the or statement and so the logic at this point boils down to: false or (not C).

This type of logic construction in Lua is actually a common trick to simulate the C/C++ ternary operator (a.k.a. the conditional operator, or the "?:" operator). I used it on purpose in the modification I proposed for allowing functions as the use condition in DIYCE's MyCombat function.
2013... The year from hell....

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

22

Wednesday, November 2nd 2011, 1:30pm

Quoted from "abshard;480162"

I got this new version working but i have 1 question. How do i disable targeting the nearest enemy? Its gonna cause me to wipe a party because im not used to it.


At the bottom of the KillSequence function is the following code:

Source code

1
2
3
4
5
6
7
8
9
    --Select Next Enemy
    if (tDead) then
        TargetUnit("")
        TargetNearestEnemy()
        return
    elseif (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
        return
    end

This is the code to select another target. You can disable this code by commenting it out using Lua block comments. Use --[[ to start a comment block, use --]] to end it. Like this:

Source code

1
2
3
4
5
6
7
8
9
10
11
    --Select Next Enemy
--[[
    if (tDead) then
        TargetUnit('')
        TargetNearestEnemy()
        return
    elseif (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
        return
    end
--]]


The cute trick about commenting out code this way is that you can easily get the code back if you want by placing a single dash in front of the --[[ making it ---[[.
2013... The year from hell....

Posts: 779

Location: USA

Occupation: Student

  • Send private message

23

Wednesday, November 2nd 2011, 1:46pm

So for v1, if my function was 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
function KnightRogue(arg1, arg2)
    local Skill = {}
    local i = 0
    local friendly = (not UnitCanAttack("player","target"))
    local pbuffs = BuffList("player")
    local tbuffs = BuffList("target")
    
    local gotShield = (GetEquipSlotInfo(17) == "Shield")
    
    i=i+1; Skill[i] = { name = "Holy Shield", use = (not string.find(pbuffs, "Holy Shield") and (PctH("player") <= .30)) }
    i=i+1; Skill[i] = { name = "Shield of Valor", use = (not string.find(pbuffs, "Holy Shield") and (PctH("player") <= .30)) }
    i=i+1; Skill[i] = { name = "Leopard Instinct", use = (not string.find(pbuffs, "Leopard Instinct") and (PctH("player") <= .35)) }
    i=i+1; Skill[i] = { name = "Crazy Blades", use = (not string.find(pbuffs, "Crazy Blades")) }
    i=i+1; Skill[i] = { name = "Enhanced Armor", use = (not string.find(pbuffs, "Enhanced Armor")) }
    i=i+1; Skill[i] = { name = "Holy Seal", use = (not string.find(pbuffs, "Holy Seal")) }
    i=i+1; Skill[i] = { name = "Resolution", use = (not string.find(pbuffs, "Resolution")) }
    i=i+1; Skill[i] = { name = "Whirlwind Shield", use = ((not friendly) and gotShield) }
    i=i+1; Skill[i] = { name = "Shield of Atonement", use = ((not friendly) and gotShield) }
    i=i+1; Skill[i] = { name = "Threaten", use = (string.find(tbuffs, "Holy Seals 3") and (not string.find(pbuffs, "Threaten")) and (arg2 == "threaten")) }
    i=i+1; Skill[i] = { name = "Hatred Strike", use = (not string.find(pbuffs, "Hatred Strike")) }
    i=i+1; Skill[i] = { name = "Mana Return", use = (string.find(tbuffs, "Holy Seals 3")) }
    i=i+1; Skill[i] = { name = "Holy Strike", use = (not friendly) }

    MyCombat(Skill, arg1)
end


I took a swing at it and got what I know what I'm doing...what is the "translation" for the rest of it, if you don't mind. Maybe if I wasn't still up at 8:46 I'd know how to do it, hm...

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
            if mainClass == "KNIGHT" and subClass == "THIEF" then
                local SurpriseAttack = GetActionUsable(14)
    
            --Potions and Buffs
            Skill = {
                { name = "Holy Shield",            use = (phealth <= .30) },
                { name = "Shield of Valor",              use = (phealth <= .30) },
                { name = "Leoard Instinct",                use = (phealth <= .35) },
                { name = "Crazy Blades",              use =  },
                { name = "Enhanced Armor",             use =  },
                { name = "Holy Seal",              use =  },
                { name = "Resolution"",                use =  },
                    }
                    
            --Combat
                if enemy then
                Skill2 = {
                    { name = "Whirlwind Shield",                    use =  },
                    { name = "Shield of Atonement",            use =  },
                    { name = "Threaten",                    use =  },
                    { name = "Hatred Strike",            use =  },
                    { name = "Mana Return",              use =  },
                    { name = "Holy Strike",          use = },
                        }
                end

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

24

Wednesday, November 2nd 2011, 2:04pm

Quoted from "CharlieBananas;480173"

So for v1, if my function was this...

...snip...

I took a swing at it and got what I know what I'm doing...what is the "translation" for the rest of it, if you don't mind. Maybe if I wasn't still up at 8:46 I'd know how to do it, hm...


All the string.find calls can be changed to direct table look-ups. So this:

Source code

1
string.find(tbuffs, "Holy Seals 3")

becomes:

Source code

1
tbuffs['Holy Seals 3']

As a side bonus, you can also do look-ups by buff/debuff ID. Like this:

Source code

1
tbuffs[500740]

Also, you can get the time remaining and the stack size of a buff like this:

Source code

1
2
tbuffs['Holy Seals 3'].time    -- Time remaining on buff/debuff
tbuffs['Holy Seals 3'].stack   -- Stack size of buff/debuff

Same applies for the player buffs (using pbuffs of course).

I can't go further than this right now as they'll be cutting the power in my building in a few minutes for repair maintenance (grrr.... this sucks, no computer for a while)
2013... The year from hell....

25

Wednesday, November 2nd 2011, 2:30pm

EDIT: Peryl beat me to it! :)

Quoted from "abshard;480162"

I got this new version working but i have 1 question. How do i disable targeting the nearest enemy? Its gonna cause me to wipe a party because im not used to it.


I am assuming that you based your custom function off the example custom function in the first post, right? If that is the case, near to the bottom of that text you'll find the following section:

Source code

1
2
3
4
5
6
7
8
9
    --Select Next Enemy
    if (tDead) then
        TargetUnit("")
        TargetNearestEnemy()
        return
    elseif (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
        return
    end


This is the re-targeting code. It checks to see if your current target is dead or if you are not targeting something or if your current target is not an enemy. If any of these conditions are true, it re-targets the nearest enemy. Either remove or comment out this entire code block. You can comment the lines out by placing "--" at the beginning of each line.

@Ghostwolf: The "elseif" line checks if you are not targeting something or if your current target is (not enemy). Would this cause problems for healers? For certain healing spells (and other buffs), Priests and Druids (as well as certain other classes) often have to target a "friendly" to execute the heal or buff. I'm not a healer, so I haven't tested the targeting myself. Just reading the code. Let me know if I'm missing something or over-analysing it. :)

@Peryl:

Quoted from "Peryl;480168"

Lua gives priority to the and operator (and statements are evaluated before or statements). Lua also uses short-circuited logic meaning that as soon as the result of the logic operation can be determined, the rest of the logic statement is skipped. These facts have to be kept in mind or you end up with something that wasn't intended.


This is a good thing to know! I was wondering if there was a priority for the conditional operators. I noticed some strange results before and this explains them.

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

26

Wednesday, November 2nd 2011, 3:49pm

Somehow Peryl understands what I say, and is able to translate it from what I mean to what normal people understand. I'm not sure how he does it sometimes lol. What he said is actually what I meant, he just explains it better. I know how it all works in my head, but explaining what my mind is doing or an idea I am having has never been a strong suit of mine. So, thanks Peryl.

@jtanner28 - No, that's correct. That is in fact what the elsif line is doing. This is the combat engine though, so it is designed and meant for combat, not party heals or party buffs. There are two other addons that do both of those already (which I also plan to update eventually).

27

Wednesday, November 2nd 2011, 4:57pm

It's me again Margaret...

I'm going to throw a bone in here and from my inherent lack of understanding it may be a simple answer. What if you want to run the actions in a different order depending on the situation....

For example...

My dps rotation is as follows in this order (using old DIYCE format):

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
if enemy then
 Skill[1] = { name = "Vampire Arrows", use = CD("Vampire Arrows") }
 if not Skill[1].use then
  Skill[1] = { name = "Autoshot", use = (not ASon) }
  if not Skill[1].use then
   Skill[1] = { name = "Combo Shot", use = CD("Combo Shot") }
   if not Skill[1].use then
    Skill[1] = { name = "Reflected Shot", use = (CD("Reflected Shot")) }
    if not Skill[1].use then   
     Skill[1] = { name = "Piercing Arrow", use = (CD("Piercing Arrow")) }
     if not Skill[1].use then   
      Skill[1] = { name = "Wind Arrows", use = (CD("Wind Arrows")) and (focus >= 35) }
      if not Skill[1].use then   
       Skill[1] = { name = "Shot", use = (CD("Shot")) }


However, my farming rotation is below:

Source code

1
2
3
4
5
6
7
Skill[1] = { name = "Reflected Shot", use = (CD("Reflected Shot")) }
  if not Skill[1].use then   
   Skill[1] = { name = "Piercing Arrow", use = (CD("Piercing Arrow")) }
   if not Skill[1].use then   
    Skill[1] = { name = "Vampire Arrows", use = (CD("Vampire Arrows")) }
    if not Skill[1].use then   
     Skill[1] = { name = "Wind Arrows", use = (CD("Wind Arrows")) }


As you can see, Vamp arrows in positioned differently in the order. In the old version of DIYCE, I accomplished this by having two different strings which were called by different macros:

Source code

1
/run ScoutKnightDps("v2")

and

Source code

1
/run ScoutKnightFarm("v2")


The current version of DIYCE doesnt function this way as you use only one macro to call out strings for any class combination as defined in the customfunctions. What do I do if I have two seperate ScoutKnight functions I want to run depending on the situation and the actions I want to use need to be in a different order?

I hope I'm not bugging already..I'm just trying to learn so I do this stuff myself..Thanks.
Jacobmo 97Scout/97Warden/95Warrior/97Rogue/88D/85M
Allenmo 78S/77R/56P/1W/1K/1M - retired
Bteam all the way

28

Wednesday, November 2nd 2011, 5:51pm

Allen,
There are several ways to adapt your old rotation to the new methodology. One way would be to use arguments instead of separate functions. FYI, the following method worked just the same in the old DIYCE engine. The first thing to do is to add the argument to your function definition at the top of the file. I'm going to assume that you haven't added arguments for pots, food, or other things yet.

Source code

1
function KillSequence(arg1, [b]mode[/b])


The new argument is called "mode". This argument can also be used by your other class combos for the same reason. The key thing to note here is that you'll be using the same function call in your macros for every combo. Hence, try to use the arguments to differentiate different combat styles for each combo. OR try to come up with a limited number of macros that are applicable across several classes. There's a lot of potential for strategic flexibility here. (If you wanted to REALLY get wild, you could customize your function per instance boss, for Siege War, per zone... Complexity FTW! Assuming, of course that you can get a target's name, zone name, and other variables. I think I've seen these things referenced somewhere in the 1870+ posts of the original DIYCE thread. Some of these would require some mild engine modifications.) But I digress... Moving on.

In your skill definitions put 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
-- Class: Scout/Knight
   if mainClass == "RANGER" and subClass == "KNIGHT" then
 
   --Combat
    if enemy and (mode == "DPS") then
    Skill2 = {
     { name = "Vampire Arrows", use = CD("Vampire Arrows") },
     { name = "Autoshot", use = (not ASon) },
     { name = "Combo Shot", use = CD("Combo Shot") },
     { name = "Reflected Shot", use = (CD("Reflected Shot")) },  
     { name = "Piercing Arrow", use = (CD("Piercing Arrow")) }, 
     { name = "Wind Arrows", use = (CD("Wind Arrows")) and (EnergyBar1 >= 35) },  
     { name = "Shot", use = (CD("Shot")) }
              }
    elseif enemy and (mode == "farm") then
    Skill2 = {
     { name = "Reflected Shot", use = (CD("Reflected Shot")) },  
     { name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
     { name = "Vampire Arrows", use = CD("Vampire Arrows") },
     { name = "Wind Arrows", use = (CD("Wind Arrows")) and (EnergyBar1 >= 35) }
              }
    end


I based this off your earlier skill definitions. You may want to tweak the conditions per skill, but this should provide the basic structure. Your DPS macro would be:

Source code

1
/run KillSequence("", "DPS")


And the farm macro would be:

Source code

1
/run KillSequence("", "farm")


There are other ways to do this, (for instance, checking the mode argument per line in the skill array and duplicating the Vamp Arrows line in the appropriate spot) but this way makes it easier to tweak each "mode" in the future. Or for that matter, you could add additional modes by following the same structure. :)

Note: A lot of this I intend on covering in our guild tutorial.

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

29

Wednesday, November 2nd 2011, 6:49pm

@Peryl & Ghostwolf,

Ok,

So in other words if I were to assign (some sort of priority in my list), I should do the following to my code.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
            elseif mainClass == "THIEF" and subClass == "RANGER" then
            
            Skill = {
                { name = "Combat Master",                   use = ((not pbuffs['Combat Master')) }
                { name = 'Action: 62',                      use = ((not pbuffs['Yawaka's Blessing')) }
                { name = 'Action: 69',                      use = ((not pbuffs['Unbridled Enthusiasm')) } -- Speed Potion
                { name = 'Poison',                          use = ((not pbuffs['Poisonous']) or (pbuffs['Poisonous'].time <= 45)) },
                    }
                    
            if enemy then
            Skill2 = {
                { name = "Wound Attack",                    use = (EnergyBar1 >= 35 and (tbuffs[620313] and tbuffs[500704])) },
                { name = "Blind Spot",                      use = (EnergyBar1 >= 20) and boss and behind and (pbuffs['Energy Thief'] or pbuffs['Premeditation']) },
                { name = "Shadowstab",                      use = (EnergyBar1 >= 20) and (not tbuffs[620313]) },
                { name = "Low Blow",                        use = (EnergyBar1 >= 25) and (tbuffs[620313]) and ((not tbuffs[500704]) or pbuffs['Energy Thief']) },
                { name = "Vampire Arrows",                  use = (thealth > 1) },
                { name = "Shot",                            use = (not EnergyBar1 >= 20) },
                { name = "Wrist Attack",                    use = (EnergyBar2 >= 50) and boss },
                { name = "Throat Attack",                   use = (EnergyBar2 >= 50) and (boss or elite) and silenceThis },
                    }
            end


Right now this is the way I want it to work.

Wound Attack will cast only when Shadowstab & Low Blow bleeds are up (which should be 100% of the time), Otherwise it will cast Shadowstab to maintain the bleed and will also cast Low Blow to maintain that bleed too.

Now during Burn, I have Energy Thief up, I want to spam Low Blow (very large amount of DPS since Shadowstab should only be maintained for bleed + Wound Attack will have priority over Low Blow.)

So right now, from what I understand from the operators from the LUA.

Wound Attack is only cast when Bleed + Grevious Bleed is up + Energy is above 35
Blind Spot will only cast when (Energy Thief is up or Premed is on) + Behind Target + Above 20 Energy + Boss
Shadowstab will only cast when Bleed is not on target.
Low Blow will only cast when Energy is above 25 + Shadowstab Bleed is on Target + (Energy Thief or Grevious Wound is not up).

Everything past this point is simple.

I just wanted to ensure that Wound Attack is #1 priority.
Low Blow is spammed during Burn.

Btw, I somewhat understood what you said about the operators.

That is why I put the not Grevious Wound & Energy Thief together since they are pretty much the only two reasons to cast Low Blow. If the Bleed wasn't up or I needed to spam it for burns.

Please let me know if I misunderstood anything. I am 99% sure I missed something.

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

30

Wednesday, November 2nd 2011, 7:08pm

That all seems to be correct. I am going on 30+ hrs of no sleep right now though, so to know for sure, go give it a test run and see what happens. That will be the true measure of what you have coded thus far. If it works let us know, if it doesn't, also let us know ;) Feedback is always a good thing, even when the results are not what you had planned on.

31

Wednesday, November 2nd 2011, 7:27pm

Quoted from "ghostwolf82;480244"

That all seems to be correct. I am going on 30+ hrs of no sleep right now though, so to know for sure, go give it a test run and see what happens. That will be the true measure of what you have coded thus far. If it works let us know, if it doesn't, also let us know ;) Feedback is always a good thing, even when the results are not what you had planned on.


OMG, get some sleep! :eek: The DIYCE community needs your brain cells. We'll hold down the fort in the meantime.

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

32

Wednesday, November 2nd 2011, 7:45pm

Haha! I plan to. Had a long shift at work was all. I'm off now, and should be getting to sleep (with the help of either Nyquil or Bud Light) here soon.

33

Wednesday, November 2nd 2011, 8:33pm

Quoted from "mrmisterwaa;480242"

@Peryl & Ghostwolf,

Ok,

So in other words if I were to assign (some sort of priority in my list), I should do the following to my code.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
            elseif mainClass == "THIEF" and subClass == "RANGER" then
            
            Skill = {
                { name = "Combat Master",                   use = ((not pbuffs['Combat Master')) }
                { name = 'Action: 62',                      use = ((not pbuffs['Yawaka's Blessing')) }
                { name = 'Action: 69',                      use = ((not pbuffs['Unbridled Enthusiasm')) } -- Speed Potion
                { name = 'Poison',                          use = ((not pbuffs['Poisonous']) or (pbuffs['Poisonous'].time <= 45)) },
                    }
                    
            if enemy then
            Skill2 = {
                { name = "Wound Attack",                    use = (EnergyBar1 >= 35 and (tbuffs[620313] and tbuffs[500704])) },
                { name = "Blind Spot",                      use = (EnergyBar1 >= 20) and boss and behind and (pbuffs['Energy Thief'] or pbuffs['Premeditation']) },
                { name = "Shadowstab",                      use = (EnergyBar1 >= 20) and (not tbuffs[620313]) },
                { name = "Low Blow",                        use = (EnergyBar1 >= 25) and (tbuffs[620313]) and ((not tbuffs[500704]) or pbuffs['Energy Thief']) },
                { name = "Vampire Arrows",                  use = (thealth > 1) },
                { name = "Shot",                            use = (not EnergyBar1 >= 20) },
                { name = "Wrist Attack",                    use = (EnergyBar2 >= 50) and boss },
                { name = "Throat Attack",                   use = (EnergyBar2 >= 50) and (boss or elite) and silenceThis },
                    }
            end


Right now this is the way I want it to work.

Wound Attack will cast only when Shadowstab & Low Blow bleeds are up (which should be 100% of the time), Otherwise it will cast Shadowstab to maintain the bleed and will also cast Low Blow to maintain that bleed too.

Now during Burn, I have Energy Thief up, I want to spam Low Blow (very large amount of DPS since Shadowstab should only be maintained for bleed + Wound Attack will have priority over Low Blow.)

So right now, from what I understand from the operators from the LUA.

Wound Attack is only cast when Bleed + Grevious Bleed is up + Energy is above 35
Blind Spot will only cast when (Energy Thief is up or Premed is on) + Behind Target + Above 20 Energy + Boss
Shadowstab will only cast when Bleed is not on target.
Low Blow will only cast when Energy is above 25 + Shadowstab Bleed is on Target + (Energy Thief or Grevious Wound is not up).

Everything past this point is simple.

I just wanted to ensure that Wound Attack is #1 priority.
Low Blow is spammed during Burn.

Btw, I somewhat understood what you said about the operators.

That is why I put the not Grevious Wound & Energy Thief together since they are pretty much the only two reasons to cast Low Blow. If the Bleed wasn't up or I needed to spam it for burns.

Please let me know if I misunderstood anything. I am 99% sure I missed something.


macro for this funtion?

34

Wednesday, November 2nd 2011, 8:47pm

all functions are called by the same macro...thats the elegance

stupid question: how is the action slot of autshot called now? i couldnt remember my password to my scout and locked myself out...so cant test and play around :o

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

35

Wednesday, November 2nd 2011, 9:43pm

Weeee... Power is back! :D

Quoted from "mrmisterwaa;480242"

@Peryl & Ghostwolf,

Ok,

So in other words if I were to assign (some sort of priority in my list), I should do the following to my code.

...snip...

So right now, from what I understand from the operators from the LUA.

Wound Attack is only cast when Bleed + Grevious Bleed is up + Energy is above 35
Blind Spot will only cast when (Energy Thief is up or Premed is on) + Behind Target + Above 20 Energy + Boss
Shadowstab will only cast when Bleed is not on target.
Low Blow will only cast when Energy is above 25 + Shadowstab Bleed is on Target + (Energy Thief or Grevious Wound is not up).

Everything past this point is simple.

I just wanted to ensure that Wound Attack is #1 priority.
Low Blow is spammed during Burn.


From what I've seen of your posted code, that should be correct. Remember that the way the skill table(s) are built hasn't actually changed all that much. The old way of making the table still works, but the way given here is a little more efficient both in terms of memory usage and execution speed.

As to how DIYCE 2.0 uses the table, again this hasn't really changed much. It still walks through the skill list top to bottom and aborts processing after the first successful entry. Now though there is a second table (Skill2) typically used for the combat skills. The second table is only processed if nothing was used in the first one.


Quoted from "mrmisterwaa;480242"

Btw, I somewhat understood what you said about the operators.

That is why I put the not Grevious Wound & Energy Thief together since they are pretty much the only two reasons to cast Low Blow. If the Bleed wasn't up or I needed to spam it for burns.

Please let me know if I misunderstood anything. I am 99% sure I missed something.

Seems to me like you got it right, but mistakes with this stuff is common enough (to err is human after all).

Edit
Hmmmm... I feel another quicky tutorial on logic operators and Lua's usage thereof coming on...
2013... The year from hell....

36

Thursday, November 3rd 2011, 2:49am

Changing from DIYCE 1.4 to the new 2.o method and i am having some issues. It took me some time to figure it out but fot the most part i like the changes. However, it is not processing Mana Return at all. could you take a look?

And whats the difference in Skill { and Skill2{ usage?
do i have the self heals in the right spot?

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
37
38
39
40
41
42
43
44
        -- Class: Knight/Priest
            elseif mainClass == "KNIGHT" and subClass == "AUGUR" then


            --Potions and Buffs
            Skill = {
                { name = "Regenerate",                     use = ((phealth <= .90) and (pctEB1 >= .05) and (not pbuffs['Regenerate'])) },
                { name = "Action: "..healthpot,            use = (phealth <= .40) },
                { name = "Action: "..manapot,              use = (pctEB1 <= .50) },
                { name = "Magic Barrier",                  use = (pctEB1 >= .05 and (not pbuffs['Magic Barrier'])) },
                { name = "Holy Seal",                      use = (pctEB1 >= .05 and (not pbuffs['Holy Seal'])) },
                { name = "Enhanced Armor",                 use = (pctEB1 >= .05 and (not pbuffs['Enhanced Armor'])) },
                { name = "Blessed Spring Water",           use = (pctEB1 >= .05 and (not pbuffs['Blessed Spring Water'])) },

            -- Heals
                { name = "Holy Shield",                       use = (phealth <= .20) },
                { name = "Holy Illumination",              use = (combat and phealth <= .75 and (not pbuffs['Holy Illumination'])) },
                { name = "Holy Aura",                   use = (phealth <= .30) },
                { name = "Resolution",                     use = (combat and phealth <= .65) },
                { name = "Urgent Heal",                    use = (phealth <= .65) },
                { name = "Regenerate",                     use = (phealth <= .90 and (not pbuffs['Regenerate'])) },
                    }

            -- Combat
        -- Shield Attacks
                if enemy then
                Skill2 = {
                { name = "Shield of Valor",                use = (enemy and phealth <= .8 and shield) },
                { name = "Shield of Discipline",           use = (silenceThis and shield) },
                { name = "Shield of Atonement",            use = (enemy and combat and shield and (not tbuffs['Restrained'])) },
            -- Other Attacks
                { name = "Rising Tide",                    use = (not melee and thealth >= .99) }, -- To Pull with
                { name = "Mana Return",                    use = (pctEB1 <= .7 and tbuffs['Holy Seals 3']) },
                { name = "Threaten",                       use = (tbuffs['Holy Seals 3'] and not tbuffs['Threaten']) },
                { name = "Punishment",                     use = (tbuffs['Light Seal III']) },
                { name = "Hatred Strike",                  use = (combat and party) },-- Agro Multiplier if in party only
                { name = "Disarmament",                    use = (UnitLevel("target") >= (UnitLevel("player") - 10) and (boss or elite) and ((not tbuffs['Disarmament IV']) or (tbuffs['Disarmament IV'].time <= 2))) }, -- stack to 4
                { name = "Whirlwind Shield",               use = (shield and pctEB1 >= .2) },
                { name = "Charge",                   use = ((combat and (tspell ~= nil)) or (not melee and not tbuffs['Charge'])) }, -- charge spellcasters
                { name = "Holy Light's Fury",               use = (pctEB1 >= .2 and not tbuffs['Holy Light's Fury']) }, -- Knight/Priest 15 Elite
                { name = "Holy Smite",                   use = (pctEB1 >= .2 and tbuffs['Holy Light's Fury']) }, -- Knight/Priest 20 Elite
                { name = "Holy Strike",                    use = (pctEB1 >= .2 and not tbuffs['Light Seal III']) }
                    }
            end

37

Thursday, November 3rd 2011, 6:38pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Class: Scout/Warden
            if mainClass == "RANGER" and subClass == "WARDEN" then
                    
            --Combat
                if enemy then 
                Skill2 = {
			     { name = "Automatyczny Strza&#322;", 				      use = boss and elite and (not ASon) },
			     { name = "Ukryte Niebezpiecze&#324;stwo",                 use = (CD("Ukryte Niebezpiecze&#324;stwo")) }, 
				 { name = "Przycelowanie",                            use = (pbuffs['Ukryte Niebezpiecze&#324;stwo'].time <= 45) }, 
				 { name = "Wampiryczne Strza&#322;y",                      use = (pbuffs['Strza&#322;a Esencji'].time <= 45) },
				 { name = "Ciernista Strza&#322;a",            			  use = (CD("Ciernista Strza&#322;a")) }, 
			     { name = "Salwa",            						  use = (CD("Salwa")) }, 
				 { name = "Odbity Strza&#322;",            				  use = (CD("Odbity Strza&#322;")) }, 
				 { name = "Przebijaj&#261;ca Strza&#322;a", 					  use = (CD("Przebijaj&#261;ca Strza&#322;a")) }, 
				 { name = "Strza&#322;", 							      use = ((ChkBuff("player","Graj na Lutni")) and (ChkBuff("player","Strza&#322;a Esencji"))) }
				 { name = "Na&#322;adowane Ci&#281;cie",                        use = (CD("Na&#322;adowane Ci&#281;cie")) },
			             }
                end




Why this function does not want work at all. Do not use this skill Ciernista Strza&#322;a.

38

Thursday, November 3rd 2011, 6:53pm

You need to ad else to the if statement ?

Source code

1
Class: Scout/Warden             [B]ESLE[/B]if mainClass == "RANGER" and subClass == "WARDEN" then

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

39

Thursday, November 3rd 2011, 8:00pm

Quoted from "pazuzzu;480281"

all functions are called by the same macro...thats the elegance

stupid question: how is the action slot of autshot called now? i couldnt remember my password to my scout and locked myself out...so cant test and play around :o

The same as was called with the previous version. Add this to the variable definitions section:

Source code

1
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(4)  -- # is your Autoshot slot number
Then call it in the use section the same as well: (not ASon)

Quoted from "lordmohg;480344"

Changing from DIYCE 1.4 to the new 2.o method and i am having some issues. It took me some time to figure it out but fot the most part i like the changes. However, it is not processing Mana Return at all. could you take a look?

And whats the difference in Skill { and Skill2{ usage?
do i have the self heals in the right spot?

Try encapsulating the check for mana, like this

Source code

1
{ name = "Mana Return",                    use = (pctEB1 <= .7) and (tbuffs['Holy Seals 3']) },
Only you can decide where to put the healing spells, but looks fine to me. That's where I would have it.

Quoted from "Skodziro;480467"

Why this function does not want work at all. Do not use this skill Ciernista Strza&#322;a.

Not sure what language, or skill, that is. However, you could also just try to use a 'true' to call that skill.

Source code

1
                 { name = "Ciernista Strza&#322;a",                          use = true }, 
Also, make sure to add the closing 'end' to your class combo section.

Quoted from "lordmohg;480470"

You need to ad else to the if statement ?

Source code

1
Class: Scout/Warden             [B]ESLE[/B]if mainClass == "RANGER" and subClass == "WARDEN" then

Only if he is adding to the bottom of the statement. If that is the only class combo in his code, then it would only need the opening 'if'. Also, the else would need to be lower case, LUA is case sensitive.

40

Thursday, November 3rd 2011, 9:00pm

thanks Ghost i changed mana return a bit and it works just fine now.

Source code

1
{ name = "Mana Return",                    use = (tbuffs['Holy Seals 3']) and (pctEB1 <= .70) },