You are not logged in.

Dear visitor, welcome to Runes of Magic US / AU. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

41

Thursday, November 3rd 2011, 9:11pm

I have searched all over the DIYCE forums and cant find quite what i am looking for. What i want to do is either create a new function to check other party members for Holy Protection then apply it to them, or have it as part of the KillSequence() which ever would work best and is easiest to code.

Would you mind taking a stab at it for me? I am not sure how to implement it with the new 2.0 DIYCE to buff the party and exclude myself as the tank.

If it is a separate function my macro would look like

Source code

1
2
/run KillSequence("v1",11,12)
/run HPBuff()

42

Thursday, November 3rd 2011, 10:54pm

I am attempting to add a function from 1.4 that i use frequently DotMaster() both on Priest side to Bone Chill and on Knight side to monitor multiple mobs and their targets.

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
45
46
47
48
49
50
51
52
53
function DoTMaster(spellname)

    local LockedOn = UnitExists("target")
    local tDead = UnitIsDeadOrGhost("target")
    local enemy = UnitCanAttack("player","target")

--Check for level one mobs before doing combat
    if (LockedOn and (UnitLevel("target") < 2)) then
        TargetNearestEnemy()
        return
    end

    local function add_to_focus(thisunit)
        local onlist = false
        local freeslot = 0

        for i = 1,10 do
            if (not UnitExists("focus"..i)) and (freeslot == 0) then
                freeslot = i
            elseif UnitIsUnit(thisunit, "focus"..i) then
                return false
            end
        end

        if freeslot == 0 then
            Msg("All slots full, skipping "..thisunit)
            return false
        else
            FocusUnit(freeslot, thisunit)
        end
    end

    if enemy and not tDead and (UnitLevel("target") > 1) then
        if add_to_focus("target") then
            CastSpellByName(spellname)
            return true
        end
    end

    for i = 1,10 do
        if UnitIsDeadOrGhost("focus"..i) and (not UnitIsPlayer("focus"..i)) then
            FocusUnit(i, "")
        elseif UnitExists("focus"..i) and UnitCanAttack("player", "focus"..i)
        and ([B]BuffTimeLeft[/B]("focus"..i, spellname) <= 2) then
            FocusUnit(11, "target")
            TargetUnit("focus"..i)
            CastSpellByName(spellname)
            TargetUnit("focus11")
            FocusUnit(11, "")
            return true
        end
    end
end
It is adding them to focus but not applying Bone Chill and comes up with an error saying BuffTimeLeft is a nil value

Source code

1
and (BuffTimeLeft("focus"..i, spellname) <= 2) then
I do not see a bufftimeleft in 2.0 but i looked in 1.4 and it was there. Does this change

Source code

1
and (BuffTimeLeft("focus"..i, spellname) <= 2) then
into:

Source code

1
and (BuffList("focus"..i, spellname) <= 2) then
I am not sure how to convert this.

I was hoping to avoid editing the new 2.0 by adding another function to it in case others wanted to use my K/P set. But should i just add

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 BuffTimeLeft(tgt, buffname)
    local cnt = 1
    local buffcmd, bufftimecmd, buff

    if UnitCanAttack("player", tgt) then
        buffcmd = UnitDebuff
        bufftimecmd = UnitDebuffLeftTime
    else
        buffcmd = UnitBuff
        bufftimecmd = UnitBuffLeftTime
    end

    buff = buffcmd(tgt, cnt)

    while buff ~= nil do
        if string.find(buff, buffname) then
            return bufftimecmd(tgt, cnt)
        end
        cnt = cnt + 1
        buff = buffcmd(tgt, cnt)
    end

    return 0
end
into the 2.0 diyce.lua ? and call it good?

Instead of changing DIYCE.lua i just changed the base function into a local function withing dotmaster.

Source code

1
local function BuffTimeLeft(tgt, buffname) 

and put that inside DoTMaster, it works perfectly now and doesnt change base DIYCE

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

43

Friday, November 4th 2011, 1:48am

Okay, after so much testing.

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
local silenceList = {
        ['Annihilation'] = true,
        ['King Bug Shock'] = true,
        ['Mana Rift'] = true,
        ['Dream of Gold'] = true,
        ['Flame'] = true,
        ['Flame Spell'] = true,
        ['Wave Bomb'] = true,
        ['Silence'] = true,
        ['Recover'] = true,
        ['Restore Life'] = true,
        ['Heal'] = true,
        ['Curing Shot'] = true,
        ['Dark Healing'] = true,
        ['Leaves of Fire'] = true,
        ['Urgent Heal'] = true,
                        }    


function KillSequence(arg1, arg2, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--arg2 = Use for multiple buttons for cooldowns and other stuff
--healthpot = # of actionbar slot for health potions
--manapot = # of actionbar slot for mana potions
--foodslot = # of actionbar slot for food (add more args for more foodslots if needed)

    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local EnergyBar1 = UnitMana("player")
    local EnergyBar2 = UnitSkill("player")
    local pctEB1 = PctM("player")
    local pctEB2 = PctS("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    local behind = (not UnitIsUnit("player", "targettarget"))
    local melee = GetActionUsable(2) -- # is your melee range spell slot number
    local phealth = PctH("player")
    local thealth = PctH("target")
    local LockedOn = UnitExists("target")
    local boss = UnitSex("target") > 2
    local elite = UnitSex("target") == 2
    local party = GetNumPartyMembers() >= 2
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )

    --Silence Logic
    local tSpell,tTime,tElapsed = UnitCastingTime("target")
    local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
    
    --Potion Checks
    healthpot = healthpot or 0
    manapot = manapot or 0
    
    --Equipment and Pet Protection
    if phealth <= .03 then
            SwapEquipmentItem()        --Note: Remove the first double dash to re-enable equipment protection.
        for i=1,6 do
            if (IsPetSummoned(i) == true) then
                ReturnPet(i);
            end
        end        
    end
        
    if (LockedOn and (UnitLevel("target") < 2)) then
        TargetUnit("")
        TargetNearestEnemy()
        return
    end
    
    --Begin Player Skill Sequences
    
        --Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT, 
        --Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR
        
        -- Class: Rogue/Scout
            if mainClass == "THIEF" and subClass == "RANGER" then
            --arg2: 0 = Buffs, 1 = Melee, 2 = Ranged, 3 = Cooldowns & Potions, 4 = Longer Cooldowns
            
            if (arg2 == "0") then
            Skill = {
                { name = "Combat Master",                      use = ((not pbuffs['Combat Master'])) },
                { name = "Action: 62 (Yawaka's Blessing)",     use = ((not pbuffs['Yawaka's Blessing'])) },
                { name = "Action: 69 (Unbridled Enthusiam)",   use = ((not pbuffs['Unbridled Enthusiasm'])) }, -- Speed Potion
                    }
            elseif (arg2 == "3") then
            Skill = {
               { name = "Informer",                            use = ((not pbuffs['Informer'])) },
               { name = "Action: 64 (Unknown Choice)",         use = ((EnergyBar1 > 20)) },
               { name = "Action: 65 (Caviar Sandwich)",        use = ((not pbuffs['Caviar Sandwich'])) },
                     }
            elseif (arg2 == "4") then
            Skill = {
                { name = "Action: 46 (Energy Potion)",         use = ((EnergyBar1) <= 15 and (boss)) },
                { name = "Action: 30 (Strong Stimulant)",      use = ((boss) and (not pbuffs['Fervent Attack'])) },
                { name = "Action: 34 (Extinction Potion)",     use = ((boss) and (not pbuffs['Extinction Potion'])) },
                { name = "Energy Thief",                       use = ((EnergyBar1 < 50) and (boss) and (not tDead)) },
                { name = "Assassins Rage",                     use = ((boss) and (not tDead)) },
                { name = "Fervent Attack",                     use = ((boss) and (not tDead) and (not pbuffs['Strong Stimulant'])) },
                     }
            end

            if ((enemy) and (arg2 == "1")) then
            Skill2 = {
                { name = "Wound Attack",                       use = ((EnergyBar1 >= 35) and (tbuffs[500654] and tbuffs[500704])) },
                { name = "Blind Spot",                         use = (((EnergyBar1 >= 25) and boss and behind) and (pbuffs['Energy Thief'] or pbuffs['Premeditation'])) },
                { name = "Shadowstab",                         use = ((EnergyBar1 >= 20) and (not tbuffs[500654])) },
                { name = "Low Blow",                           use = ((EnergyBar1 >= 25) and (tbuffs[500654]) and ((not tbuffs[500704]) or pbuffs['Energy Thief'])) },
                { name = "Throat Attack",                      use = ((EnergyBar2 >= 50) and (boss or elite) and silenceThis) },
                { name = "Vampire Arrows",                     use = (EnergyBar2 >= 20) },
                { name = "Wrist Attack",                       use = ((EnergyBar2 >= 50) and (boss)) },
                { name = "Shot",                               use = ((EnergyBar1 < 20 )) },
                    }
            elseif (arg2 == "2") then
            Skill2 = {
                { name = "Vampire Arrows",                     use = (EnergyBar2 >= 20) },
                { name = "Shot",                               use = (not melee) },
                     }
            end
            
            --ADD MORE CLASS COMBOS HERE. 
            --USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS.
            --THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS.
            --DO NOT POST BELOW THE FOLLOWING "END" STATEMENT!
            end
    --End Player Skill Sequences
    
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
        
    --Select Next Enemy
    --[[
    if (tDead) then
        TargetUnit('')
        TargetNearestEnemy()
        return
    elseif (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
        return
    end
    --]]
    
end


Experiencing a rather bad problem.

Wound Attack never triggers.

Why is it not being triggered based on the Bleeds? o.O

I do not want it to trigger without doing a bleed-check either.

44

Friday, November 4th 2011, 1:57am

hmm

testing, i couldnt get these two to work:

{ name = "Stars of Light", use = (pbuffs[506424]) },
{ name = "Stars of Light", use = (pbuffs['Messenger of Light']) },

but this was fine:

{ name = "Stars of Light", use = (pbuffs['Messenger of Light']) and enemy },

but not trying by ID
WTS 1400 cards and 2 enormous fishbone aggs for some beef jerkie and a twinkie

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

45

Friday, November 4th 2011, 3:26am

Quoted from "lordmohg;480520"

I have searched all over the DIYCE forums and cant find quite what i am looking for. What i want to do is either create a new function to check other party members for Holy Protection then apply it to them, or have it as part of the KillSequence() which ever would work best and is easiest to code.

Would you mind taking a stab at it for me? I am not sure how to implement it with the new 2.0 DIYCE to buff the party and exclude myself as the tank.

If it is a separate function my macro would look like

Source code

1
2
/run KillSequence("v1",11,12)
/run HPBuff()

The answer to this is similar to the post jtanner28 answered earlier. Use the 'mode' argument for this, and just set up a second macro in game to call that with. You can put it right into the k/p section of killsequence, since it is an elite skill.

BuffTimeLeft is now being called with a .time modifier in the lua code. Like this

Source code

1
(pbuffs['Perception'].time <= 45)
@sekrit - Did you verify the buff ID for your grievous?

@pazuzzu - rather odd. Not sure why that is. Thanks for letting us know your findings. ...Something new to figure out <.< how dare you diyce2, I am disappointed.

AddOn: DIY Combat Engine v2 AddOn: Auto Ding
Reni - Malkira
Warlock Guide
Retired from RoM with patch 6.1.0

46

Friday, November 4th 2011, 8:02am

Source code

1
2
3
4
5
6
7
 if enemy then 
                Skill2 = {
				 { name = "Ciernista Strza&#322;a",                        use = true },
				 { name = "Wampiryczne Strza&#322;y",                      use = (pbuffs['Strza&#322;a Esencji']) },
				 { name = "Na&#322;adowane Ci&#281;cie",                        use = true },
			            }
                end


this function

Source code

1
{ name = "Ciernista Strza&#322;a",                        use = true },


but this function not work, why?

Source code

1
2
{ name = "Wampiryczne Strza&#322;y",                      use = (pbuffs['Strza&#322;a Esencji']) },
           Vampire Arrows                                           Arrow of Essence


This is in Polish

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

47

Friday, November 4th 2011, 9:25am

Quoted from "ghostwolf82;480601"

The answer to this is similar to the post jtanner28 answered earlier. Use the 'mode' argument for this, and just set up a second macro in game to call that with. You can put it right into the k/p section of killsequence, since it is an elite skill.

BuffTimeLeft is now being called with a .time modifier in the lua code. Like this

Source code

1
(pbuffs['Perception'].time <= 45)
@sekrit - Did you verify the buff ID for your grievous?

@pazuzzu - rather odd. Not sure why that is. Thanks for letting us know your findings. ...Something new to figure out <.< how dare you diyce2, I am disappointed.


Yup, I did.

I even made sure that I did it the ID buff check with 3 other Rogues in the party too and with two warriors.

Warrior Bleed was a different ID number (confirmed it many many many times).

The ID numbers are not wrong.

@Skodziro,

Can you try to make an English version of your DIYCE? So we can debug it with you in an easier manner? You can convert it to Polish after we fix the problem you seem to be having.

48

Friday, November 4th 2011, 1:31pm

Quoted from "mrmisterwaa;480583"

Okay, after so much testing.

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
local silenceList = {
        ['Annihilation'] = true,
        ['King Bug Shock'] = true,
        ['Mana Rift'] = true,
        ['Dream of Gold'] = true,
        ['Flame'] = true,
        ['Flame Spell'] = true,
        ['Wave Bomb'] = true,
        ['Silence'] = true,
        ['Recover'] = true,
        ['Restore Life'] = true,
        ['Heal'] = true,
        ['Curing Shot'] = true,
        ['Dark Healing'] = true,
        ['Leaves of Fire'] = true,
        ['Urgent Heal'] = true,
                        }    


function KillSequence(arg1, arg2, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--arg2 = Use for multiple buttons for cooldowns and other stuff
--healthpot = # of actionbar slot for health potions
--manapot = # of actionbar slot for mana potions
--foodslot = # of actionbar slot for food (add more args for more foodslots if needed)

    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local EnergyBar1 = UnitMana("player")
    local EnergyBar2 = UnitSkill("player")
    local pctEB1 = PctM("player")
    local pctEB2 = PctS("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    local behind = (not UnitIsUnit("player", "targettarget"))
    local melee = GetActionUsable(2) -- # is your melee range spell slot number
    local phealth = PctH("player")
    local thealth = PctH("target")
    local LockedOn = UnitExists("target")
    local boss = UnitSex("target") > 2
    local elite = UnitSex("target") == 2
    local party = GetNumPartyMembers() >= 2
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )

    --Silence Logic
    local tSpell,tTime,tElapsed = UnitCastingTime("target")
    local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
    
    --Potion Checks
    healthpot = healthpot or 0
    manapot = manapot or 0
    
    --Equipment and Pet Protection
    if phealth <= .03 then
            SwapEquipmentItem()        --Note: Remove the first double dash to re-enable equipment protection.
        for i=1,6 do
            if (IsPetSummoned(i) == true) then
                ReturnPet(i);
            end
        end        
    end
        
    if (LockedOn and (UnitLevel("target") < 2)) then
        TargetUnit("")
        TargetNearestEnemy()
        return
    end
    
    --Begin Player Skill Sequences
    
        --Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT, 
        --Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR
        
        -- Class: Rogue/Scout
            if mainClass == "THIEF" and subClass == "RANGER" then
            --arg2: 0 = Buffs, 1 = Melee, 2 = Ranged, 3 = Cooldowns & Potions, 4 = Longer Cooldowns
            
            if (arg2 == "0") then
            Skill = {
                { name = "Combat Master",                      use = ((not pbuffs['Combat Master'])) },
                { name = "Action: 62 (Yawaka's Blessing)",     use = ((not pbuffs['Yawaka's Blessing'])) },
                { name = "Action: 69 (Unbridled Enthusiam)",   use = ((not pbuffs['Unbridled Enthusiasm'])) }, -- Speed Potion
                    }
            elseif (arg2 == "3") then
            Skill = {
               { name = "Informer",                            use = ((not pbuffs['Informer'])) },
               { name = "Action: 64 (Unknown Choice)",         use = ((EnergyBar1 > 20)) },
               { name = "Action: 65 (Caviar Sandwich)",        use = ((not pbuffs['Caviar Sandwich'])) },
                     }
            elseif (arg2 == "4") then
            Skill = {
                { name = "Action: 46 (Energy Potion)",         use = ((EnergyBar1) <= 15 and (boss)) },
                { name = "Action: 30 (Strong Stimulant)",      use = ((boss) and (not pbuffs['Fervent Attack'])) },
                { name = "Action: 34 (Extinction Potion)",     use = ((boss) and (not pbuffs['Extinction Potion'])) },
                { name = "Energy Thief",                       use = ((EnergyBar1 < 50) and (boss) and (not tDead)) },
                { name = "Assassins Rage",                     use = ((boss) and (not tDead)) },
                { name = "Fervent Attack",                     use = ((boss) and (not tDead) and (not pbuffs['Strong Stimulant'])) },
                     }
            end

            if ((enemy) and (arg2 == "1")) then
            Skill2 = {
                { name = "Wound Attack",                       use = ((EnergyBar1 >= 35) and (tbuffs[500654] and tbuffs[500704])) },
                { name = "Blind Spot",                         use = (((EnergyBar1 >= 25) and boss and behind) and (pbuffs['Energy Thief'] or pbuffs['Premeditation'])) },
                { name = "Shadowstab",                         use = ((EnergyBar1 >= 20) and (not tbuffs[500654])) },
                { name = "Low Blow",                           use = ((EnergyBar1 >= 25) and (tbuffs[500654]) and ((not tbuffs[500704]) or pbuffs['Energy Thief'])) },
                { name = "Throat Attack",                      use = ((EnergyBar2 >= 50) and (boss or elite) and silenceThis) },
                { name = "Vampire Arrows",                     use = (EnergyBar2 >= 20) },
                { name = "Wrist Attack",                       use = ((EnergyBar2 >= 50) and (boss)) },
                { name = "Shot",                               use = ((EnergyBar1 < 20 )) },
                    }
            elseif (arg2 == "2") then
            Skill2 = {
                { name = "Vampire Arrows",                     use = (EnergyBar2 >= 20) },
                { name = "Shot",                               use = (not melee) },
                     }
            end
            
            --ADD MORE CLASS COMBOS HERE. 
            --USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS.
            --THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS.
            --DO NOT POST BELOW THE FOLLOWING "END" STATEMENT!
            end
    --End Player Skill Sequences
    
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
        
    --Select Next Enemy
    --[[
    if (tDead) then
        TargetUnit('')
        TargetNearestEnemy()
        return
    elseif (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
        return
    end
    --]]
    
end


Experiencing a rather bad problem.

Wound Attack never triggers.

Why is it not being triggered based on the Bleeds? o.O

I do not want it to trigger without doing a bleed-check either.


Your Wound Attack never triggers due to a bug.

There is a logic error in the main DIYCE function, the following assumes the "use" field is a boolean but notice that in some cases it can actually be a table reference.

Quoted

local useit = type(Skill[x].use) == "boolean" and Skill[x].use or (type(Skill[x].use) == "function" and Skill[x].use() or false);


Ex: if the use clausule is 'use=(a>1 and tbuffs['Bleed'])' then the result will be that type(use) = table, not a boolean and the DIYCE test on use will fail.

So, until ghost rewrites u should make sure your use clausules always return a boolean, ex by reordering them as 'use=(tbuff['Bleed'] and a>1)'. To get the current version working 100% u really need to know how type resolution will be handled in your "use" expressions.

-f

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

49

Friday, November 4th 2011, 1:59pm

@frafall, sorry I didn't exactly understand that... So in other words, it isn't returning a boolean because of a tiny bug in the useit variable.

How would I rearranged it though so it can be a boolean? o.O

50

Friday, November 4th 2011, 2:03pm

To make sure result is a boolean you could ex. use "(tbuff['Bleed'] ~= nil)"

-f

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

51

Friday, November 4th 2011, 2:05pm

Quoted from "mrmisterwaa;480668"

@frafall, sorry I didn't exactly understand that... So in other words, it isn't returning a boolean because of a tiny bug in the useit variable.

How would I rearranged it though so it can be a boolean? o.O


Don't. Instead change the useit line in MyCombat() to this (hey, I wrote the buggy line in the first place :))

Edit:
Ignore this version, see my next post for a fix to the "fix"


Source code

1
local useit = type(Skill[x].use) == "function" and Skill[x].use() or Skill[x].use;

That should do the trick.
2013... The year from hell....

RoMage

rustyx is lame rogue

Posts: 2,694

Location: web

Occupation: DB Admin

Mood: Unsure

  • Send private message

52

Friday, November 4th 2011, 2:21pm

Great work Ghostwolf & Peril!

I will install new DIYCE tonight, but I might hold on new class specific functions. At the moment I just using my old function for rogue (not even DIYCE) and for mage I did not even need one as most fights are flame, fireball, move to next target or shit, I'm dead. :D

Is there specific set of custom made functions, similar to the pet call/recall functions that we might use as good start for buffs and class specifics?

Do we need to create web site to hold this very useful information?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

53

Friday, November 4th 2011, 2:35pm

D'oh, just noticed another possible logic error in the so called fix I posted earlier (I think it was what I was trying to avoid in the original version too... sigh)

Anyway, the corrected, fixed version should be:

Source code

1
local useit = type(Skill[x].use) ~= "function" and Skill[x].use or (type(Skill[x].use) == "function" and Skill[x].use() or false)

Brownie points if you can spot why it needs to be this way.
2013... The year from hell....

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

54

Friday, November 4th 2011, 2:36pm

Quoted from "Peryl;480670"

Don't. Instead change the useit line in MyCombat() to this (hey, I wrote the buggy line in the first place :))

Source code

1
local useit = type(Skill[x].use) == "function" and Skill[x].use() or Skill[x].use;
That should do the trick.


I will be testing right now.

Thank you very much Peryl.

Edit: *raspberry*.

I will try the new fix now. Lol.

Tbh, I am not 100% sure.

But I am going to assume that it has something to do with the False in the end. >.>

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

55

Friday, November 4th 2011, 2:42pm

Sort of.

Here's a big hint: Ask yourself, what would happen if the use clause is a boolean but has the value false.
2013... The year from hell....

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

56

Friday, November 4th 2011, 2:48pm

RogueScout v1.1

A few changes were added to the DIYCE.lua that ghostwolf posted in the OP.

This macro now works with other Rogues in the party.

Line 222 & 223 have the timers for Shadowstab & Low Blow, these values can be changed to ensure that energy conservation is maintained during combat (non-burns) and that during burns with Energy Thief active, it will not activate the counter on Low Blow.

Everything is working perfectly (well, as far as I can tell.)

If you want to use it, don't forget you also have to change the Action #'s for the following:

Melee Check (Line 177) (Any skill with a range of 50, Shadowstab, Low Blow, Wound Attack from your hot-bar should be put here for me it's Low Blow)
Yawaka's Blessing (Line 229),
Unbridled Enthusiam (Line 230),
Unknown Choice (Line 235),
Caviar Sandwich (Line 236),
Energy Potion (Line 240),
Strong Stimulant (Line 241),
Extinction Potion (Line 242).

A macro should be made for each one.

/run KillSequence("","0") --- Buffs
/run KillSequence("","1") --- Melee Combat
/run KillSequence("","2") --- Ranged Combat
/run KillSequence("","3") --- Long Cooldowns (Informer, Unknown Choice, Caviar Sandwich)
/run KillSequence("","4") --- Burning Cooldowns (Strong Stimluant etc.)

iluperylghostwolf.

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
-- DIY Combat Engine version 2.2

local g_skill  = {}
local g_lastaction = ""
-- Holds the created timers
local DIYCE_Timers = {}

function Msg(outstr,a1,a2,a3)
    DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end

function ReadSkills()
    g_skill = {}
    local skillname,slot

    for page = 1,4 do
        slot = 1
        skillname = GetSkillDetail(page,slot)
        repeat
            local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot)
            if skillusable then
                g_skill[skillname] = { ['page'] = page, ['slot'] = slot }
            end
            slot = slot + 1
            skillname = GetSkillDetail(page,slot)
        until skillname == nil
    end
end

-- Read Skills on Log-In/Class Change/Level-Up
        local DIYCE_EventFrame = CreateUIComponent("Frame","DIYCE_EventFrame","UIParent")
        DIYCE_EventFrame:SetScripts("OnUpdate", [=[ DIYCE_TimerUpdate(elapsedTime) ]=] )
            DIYCE_EventFrame:SetScripts("OnEvent", [=[ 
                    if event == 'PLAYER_SKILLED_CHANGED' then
                        ReadSkills()
                        end
                    ]=] )
            DIYCE_EventFrame:RegisterEvent("PLAYER_SKILLED_CHANGED")

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

function PctM(tgt)
    return (UnitMana(tgt)/UnitMaxMana(tgt))
end

function PctS(tgt)
    return (UnitSkill(tgt)/UnitMaxSkill(tgt))
end

function CancelBuff(buffname)
    local i = 1
    local buff = UnitBuff("player",i)

    while buff ~= nil do
        if buff == buffname then
            CancelPlayerBuff(i)
            return true
        end

        i = i + 1
        buff = UnitBuff("player",i)
    end
    return false
end

function BuffList(tgt)
    local list = {}
    local buffcmd = UnitBuff
    local infocmd = UnitBuffLeftTime

    if UnitCanAttack("player",tgt) then
        buffcmd = UnitDebuff
        infocmd = UnitDebuffLeftTime
    end

    -- There is a max of 100 buffs/debuffs per unit apparently
    for i = 1,100 do
        local buff, _, stackSize, ID = buffcmd(tgt, i)
        local timeRemaining = infocmd(tgt,i)
        if buff then
            -- Ad to list by name
            list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining or 0, id = ID }
            -- We also list by ID in case two different buffs/debuffs have the same name.
            list[ID] = {stack = stackSize, time = timeRemaining or 0, name = buff:gsub("(%()(.)(%))", "%2") }
        else
            break
        end
    end

    return list
end

function CD(skillname)
    local firstskill = GetSkillDetail(2,1)
    if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then
        ReadSkills()
    end

    if g_skill[skillname] ~= nil then
        local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)
        return cd <= 0.4
    elseif skillname == nil then
        return false
    else
        Msg("Skill not available: "..skillname)        --Comment this line out if you do not wish to recieve this error message.
        return
    end
end

function MyCombat(Skill, arg1)
    local spell_name = UnitCastingTime("player")
    local talktome = ((arg1 == "v1") or (arg1 == "v2"))
    local action,actioncd,actiondef,actioncnt
    
    if spell_name ~= nil then
        if (arg1 == "v2") then Msg("- ['..spell_name..']", 0, 1, 1) end
        return true
    end

    for x,tbl in ipairs(Skill) do
        
    local useit = type(Skill[x].use) ~= "function" and Skill[x].use or (type(Skill[x].use) == "function" and Skill[x].use() or false)
        if useit then
            if string.find(Skill[x].name, "Action:") then
                action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(%d+)(.*)", "%3")))
                _1,actioncd = GetActionCooldown(action)
                actiondef,_1,actioncnt = GetActionInfo(action)
                if GetActionUsable(action) and (actioncd == 0) and (actiondef ~= nil) and (actioncnt > 0) then
                    if talktome then Msg("- "..Skill[x].name) end
                    UseAction(action)
                    return true
                end
            elseif string.find(Skill[x].name, "Custom:") then
                action = string.gsub(Skill[x].name, "(Custom:)( *)(.*)", "%3")
                if CustomAction(action) then
                    return true
                end
            elseif string.find(Skill[x].name, "Item:") then
                action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3")
                if talktome then Msg("- "..Skill[x].name) end
                UseItemByName(action)
                return true
            elseif (Skill[x].ignoretimer or GetDIYCETimerValue(Skill[x].timer) == 0) and CD(Skill[x].name) then
                if talktome then Msg("- "..Skill[x].name) end
                CastSpellByName(Skill[x].name)
                StartDIYCETimer(Skill[x].timer)
                return true
            elseif string.find(Skill[x].name, "Pet Skill:") then
                action = string.gsub(Skill[x].name, "(Pet Skill:)( *)(%d+)(.*)", "%3")
                    UsePetAction(action)
                if (arg1 == "v2") then Msg(Skill[x].name.." has been fully processed") end
                return true
            end
        end
    end
    if (arg1 == "v2") then Msg("- [IDLE]", 0, 1, 1) end
    
    return false
end

--[[ Timer Update function ]]--
-- Tick down any active timers
function DIYCE_TimerUpdate(elapsed)
    for k,v in pairs(DIYCE_Timers) do
        v.timeLeft = v.timeLeft - elapsed
        if v.timeLeft < 0 then
            v.timeLeft = 0
        end
    end
end

--[[ Create a named timer ]]--
-- if the named timer already exists, this does nothing.
function CreateDIYCETimer(timerName, waitTime)
    if not DIYCE_Timers[timerName] then
        DIYCE_Timers[timerName] = { timeLeft = 0, waitTime = waitTime }
    end
end

--[[ Set/reset waitTimer of an existing timer ]]--
-- if the timer doesn't exist, this does nothing
function SetDIYCETimerDelay(timerName, waitTime)
    if DIYCE_Timers[timerName] then
        DIYCE_Timers[timerName].waitTime = waitTime
    end
end

--[[ Delete named timer ]]--
-- if the timer doesn't exist, this does nothing
-- Not really needed, but added for completeness
function DeleteDIYCETimer(timerName)
    if DIYCE_Timers[timerName] then
        DIYCE_Timers[timerName] = nil
    end
end

--[[ Get a timer's current time ]]--
-- if the timer doesn't exist, this returns 0
function GetDIYCETimerValue(timerName)
    if timerName then
        return DIYCE_Timers[timerName] and DIYCE_Timers[timerName].timeLeft or 0
    end
    return 0
end

--[[ Starts a timer ticking down ]]--
-- if timer doesn't exist, this does nothing
function StartDIYCETimer(timerName)
    if timerName and DIYCE_Timers[timerName] then
        DIYCE_Timers[timerName].timeLeft = DIYCE_Timers[timerName].waitTime
    end
end

function CustomAction(action)
    if CD(action) then
        if IsShiftKeyDown() then Msg("- "..action) end
        g_lastaction = action
        CastSpellByName(action)
        return true
    else
        return false
    end
end

function BuffTimeLeft(tgt, buffname)
    local cnt = 1
    local buff = UnitBuff(tgt,cnt)

    while buff ~= nil do
        if string.find(buff,buffname) then
            return UnitBuffLeftTime(tgt,cnt)
        end
        cnt = cnt + 1
        buff = UnitBuff(tgt,cnt)
    end

    return 0
end

function BuffParty(arg1,arg2)
--    arg1 = Quickbar slot # for targetable, instant-cast buff without a cooldown (eg. Amp Attack) for range checking.
--    arg2 = buff expiration time cutoff (in seconds) for refreshing buffs, default is 45 seconds.

    local selfbuffs = { "Soul Bond", "Enhanced Armor", "Holy Seal" }
    local groupbuffs = { "Grace of Life", "Amplified Attack", "Angel's Blessing", "Essence of Magic", "Magic Barrier", "Blessed Spring Water", "Fire Ward", "Savage Blessing", "Concentration Prayer", "Shadow Fury"  }

    local buffrefresh = arg2 or 45           -- Refresh buff time (seconds)
    local spell = UnitCastingTime("player")  -- Spell being cast?
    local vocal = IsShiftKeyDown()           -- Generate feedback if Shift key held

    if (spell ~= nil) then
        return
    end

    if vocal then Msg("- Checking self buffs on "..UnitName("player")) end
    for i,buff in ipairs(selfbuffs) do
        if (g_skill[buff] ~= nil) and CD(buff) and (BuffTimeLeft("player",buff) <= buffrefresh) then
            if vocal then Msg("- Casting "..buff.." on "..UnitName("player")) end
            TargetUnit("player")
            CastSpellByName(buff)
            return
        end
    end

    if vocal then Msg("- Checking group buffs on "..UnitName("player")) end
    for i,buff in ipairs(groupbuffs) do
        if (g_skill[buff] ~= nil) and CD(buff) and (BuffTimeLeft("player",buff) <= buffrefresh) then
            if vocal then Msg("- Casting "..buff.." on "..UnitName("player")) end
            TargetUnit("player")
            CastSpellByName(buff)
            return
        end
    end

    for num=1,GetNumPartyMembers()-1 do
        TargetUnit("party"..num)
        if GetActionUsable(arg1) and (UnitHealth("party"..num) > 0) then
            if vocal then Msg("- Checking group buffs on "..UnitName("party"..num)) end
            for i,buff in ipairs(groupbuffs) do
                if (g_skill[buff] ~= nil) and CD(buff) and (BuffTimeLeft("target",buff) <= buffrefresh) then
                    if UnitIsUnit("target","party"..num) then
                        if vocal then Msg("- Casting "..buff.." on "..UnitName("target")) end
                        CastSpellByName(buff)
                        return
                    else
                        if vocal then Msg("- Error: "..UnitName("target").." != "..UnitName("party"..num)) end
                    end
                end
            end
        else
            if vocal then Msg("- Player "..UnitName("party"..num).." out of range or dead.") end
        end
    end

    if vocal then Msg("- Nothing to do.") end
end
A few changes to the OP's Customfunctions to suit my needs.

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
local WHITE = "|cffffffff"
local SILVER = "|cffc0c0c0"
local GREEN = "|cff00ff00"
local LTBLUE = "|cffa0a0ff"

function DIYCE_DebugSkills(skillList)
    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."Skill List:")
    
    for i,v in ipairs(skillList) do
        DEFAULT_CHAT_FRAME:AddMessage(SILVER.."  ['..WHITE..i..SILVER..']: "..LTBLUE.."" "..WHITE..v.name..LTBLUE..""  use = "..WHITE..(v.use and "true" or "false"))
    end

    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."----------")
end

function DIYCE_DebugBuffList(buffList)
    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."Buff List:")
    
    for k,v in pairs(buffList) do
        -- We ignore numbered entries because both the ID and name 
        -- are stored in the list. This avoids doubling the output.
        if type(k) ~= "number" then
            DEFAULT_CHAT_FRAME:AddMessage(SILVER.."  ['..WHITE..k..SILVER..']:  "..LTBLUE.."id: "..WHITE..v.id..LTBLUE.."  stack: "..WHITE..v.stack..LTBLUE.."  time: "..WHITE..v.time)
        end
    end
    
    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."----------")    
end

local silenceList = {
        ['Annihilation']    = true,
        ['King Bug Shock']  = true,
        ['Mana Rift']       = true,
        ['Dream of Gold']   = true,
        ['Flame']           = true,
        ['Flame Spell']     = true,
        ['Wave Bomb']       = true,
        ['Silence']         = true,
        ['Recover']         = true,
        ['Restore Life']    = true,
        ['Heal']            = true,
        ['Curing Shot']     = true,
        ['Leaves of Fire']  = true,
        ['Urgent Heal']     = true,
        ['Heavy Shelling']  = true, --Juggler Apprentice in Grafu
        ['Dark Healing']    = true, --Mini-boss in Sardo
                    }
                    
function PriestFairySequence(arg1)
    local Skill = {}
    local Skill2 = {}
    local i = 0
    local FairyExists = UnitExists("playerpet")
    local FairyBuffs = BuffList("playerpet")
    local combat = GetPlayerCombatState()

    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )

    --Summon Fairy
    if (not FairyExists) and (not combat) then
        if mainClass == "AUGUR" then
            if subClass == "THIEF" then
                Skill = {
                    { name = "Shadow Fairy",            use = true },
                        }
            elseif subClass == "RANGER" then
                Skill = {
                    { name = "Water Fairy",                use = true },
                        }
            elseif subClass == "MAGE" then
                Skill = {
                    { name = "Wind Fairy",                use = true },
                        }            
            elseif subClass == "KNIGHT" then
                Skill = {
                    { name = "Light Fairy",                use = true },
                        }            
            elseif subClass == "WARRIOR" then
                Skill = {
                    { name = "Fire Fairy",                use = true },
                        }
            end
        end
    end    
    
    --Cast Halo
    if FairyExists then
        if mainClass == "AUGUR" then
            if subClass == "THIEF" then
                if (not FairyBuffs[503459]) then
                    if (arg1 == "v1") then
                        Msg("- Activating Halo", 0, 1, 1)
                    end
                    Skill = {
                        { name = "Pet Skill: 6 (Wraith Halo)",    use = true },
                            }
                end
            elseif subClass == "RANGER" then
                if (not FairyBuffs[503457]) then
                    if (arg1 == "v1") then
                        Msg("- Activating Halo", 0, 1, 1)
                    end
                    Skill = {
                        { name = "Pet Skill: 6 (Frost Halo)",    use = true },
                            }
                end
            elseif subClass == "MAGE" then
                if (not FairyBuffs[503461]) then
                    if (arg1 == "v1") then
                        Msg("- Activating Halo", 0, 1, 1)
                    end
                    Skill = {
                        { name = "Pet Skill: 6 (Windrider Halo)",    use = true },
                            }
                end
            elseif subClass == "KNIGHT" then
                if (not FairyBuffs[503507]) then
                    if (arg1 == "v1") then
                        Msg("- Activating Halo", 0, 1, 1)
                    end
                    Skill = {
                        { name = "Pet Skill: 6 (Devotion Halo)",    use = true },
                            }
                end
            elseif subClass == "WARRIOR" then
                if (not FairyBuffs[503455]) then
                    if (arg1 == "v1") then
                        Msg("- Activating Halo", 0, 1, 1)
                    end
                    Skill = {
                        { name = "Pet Skill: 6 (Accuracy Halo)",    use = true },
                            }
                end
            end
        
            --Cast Conceal
        if (not MyCombat(Skill, arg1)) then
            if (not FairyBuffs[503753]) then
                if (arg1 == "v1") then
                    Msg("- Activating Conceal", 0, 1, 1)
                end
                Skill2 = {
                    { name = "Pet Skill: 7 (Conceal)",    use = true },
                        }
            end
        end
        end
    end
    
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
end
                        
function KillSequence(arg1, goat2, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--healthpot = # of actionbar slot for health potions
--manapot = # of actionbar slot for mana potions
--foodslot = # of actionbar slot for food (add more args for more foodslots if needed)

    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local EnergyBar1 = UnitMana("player")
    local EnergyBar2 = UnitSkill("player")
    local pctEB1 = PctM("player")
    local pctEB2 = PctS("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    local behind = (not UnitIsUnit("player", "targettarget"))
    local melee = GetActionUsable(2) -- # is your melee range spell slot number
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(14)  -- # is your Autoshot slot number
    local phealth = PctH("player")
    local thealth = PctH("target")
    local LockedOn = UnitExists("target")
    local boss = UnitSex("target") > 2
    local elite = UnitSex("target") == 2
    local party = GetNumPartyMembers() >= 2
    
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )

    --Silence Logic
    local tSpell,tTime,tElapsed = UnitCastingTime("target")
    local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
    
    --Potion Checks
    healthpot = healthpot or 0
    manapot = manapot or 0
    
    --Equipment and Pet Protection
    if phealth <= .03 then
            SwapEquipmentItem()        --Note: Remove the first double dash to re-enable equipment protection.
        for i=1,6 do
            if (IsPetSummoned(i) == true) then
                ReturnPet(i);
            end
        end        
    end
        
    --Check for level 1 mobs, if it is, drop target and acquire a new one.
    if (LockedOn and (UnitLevel("target") < 2)) then
        TargetUnit("")
        return
    end
    
    --Begin Player Skill Sequences
    
        --Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT, 
        --Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR
        
        -- Class: Rogue/Scout
            if mainClass == "THIEF" and subClass == "RANGER" then
            --Timers for this class
            CreateDIYCETimer("SSBleed", 6.5) --Change the value between 6 -> 7.5 depending on your lag.
            CreateDIYCETimer("LBBleed", 8.5) --Change the value between 7 ->  8.5 depending on your lag.
            --goat2: 0 = Buffs, 1 = Melee, 2 = Ranged, 3 = Cooldowns & Potions, 4 = Longer Cooldowns
            
            if (goat2 == "0") then
            Skill =  {
                { name = "Combat Master",                      use = ((not pbuffs['Combat Master'])) },
                { name = "Action: 62 (Yawaka's Blessing)",     use = ((not pbuffs['Yawaka's Blessing'])) },
                { name = "Action: 69 (Unbridled Enthusiam)",   use = ((not pbuffs['Unbridled Enthusiasm'])) }, -- Speed Potion
                     }
            elseif (goat2 == "3") then
            Skill =  {
               { name = "Informer",                            use = ((not pbuffs['Informer'])) },
               { name = "Action: 64 (Unknown Choice)",         use = ((EnergyBar1 > 20)) },
               { name = "Action: 65 (Caviar Sandwich)",        use = ((not pbuffs['Caviar Sandwich'])) },
                     }
            elseif (goat2 == "4") then
            Skill = {
                { name = "Action: 46 (Energy Potion)",         use = ((EnergyBar1) <= 15 and (boss)) },
                { name = "Action: 30 (Strong Stimulant)",      use = ((boss) and (not pbuffs['Fervent Attack'])) },
                { name = "Action: 34 (Extinction Potion)",     use = ((boss) and (not pbuffs['Extinction Potion'])) },
                { name = "Energy Thief",                       use = ((EnergyBar1 < 50) and (boss) and (not tDead)) },
                { name = "Assassins Rage",                     use = ((boss) and (not tDead)) },
                { name = "Fervent Attack",                     use = ((boss) and (not tDead) and (not pbuffs['Strong Stimulant'])) },
                    }
            end

            if ((enemy) and (goat2 == "1")) then
            Skill2 = {
                { name = "Wound Attack",                       use = ((EnergyBar1 >= 35) and ((tbuffs[500654]) and (tbuffs[500704]))) },
                { name = "Blind Spot",                         use = (((EnergyBar1 >= 25) and (boss) and (behind)) and (pbuffs['Energy Thief'] or pbuffs['Premeditation'])) },
                { name = "Shadowstab",                         use = (EnergyBar1 >= 20),       timer = "SSBleed" },
                { name = "Low Blow",                           use = (((EnergyBar1 >= 25) and (tbuffs[500654])) or (pbuffs['Energy Thief'])),      timer = "LBBleed",   ignoretimer = not pbuffs['Energy Thief'] },
                { name = "Throat Attack",                      use = ((EnergyBar2 >= 50) and (boss or elite) and (silenceThis)) },
                { name = "Vampire Arrows",                     use = (EnergyBar2 >= 20) },
                { name = "Wrist Attack",                       use = ((EnergyBar2 >= 50) and (boss)) },
                { name = "Shot",                               use = ((EnergyBar1 < 20 )) },
                    }
            elseif ((enemy) and (goat2 == "2")) then
            Skill2 = {
                { name = "Vampire Arrows",                     use = (EnergyBar2 >= 20) },
                { name = "Shot",                               use = (true) },
                     }
            end
                
            --ADD MORE CLASS COMBOS HERE. 
            --USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS.
            --THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS.
            --DO NOT POST BELOW THE FOLLOWING "END" STATEMENT!
            end
    --End Player Skill Sequences
    
    if (arg1=="debugskills") then        --Used for printing the skill table, and true/false usability
        DIYCE_DebugSkills(Skill)
        DIYCE_DebugSkills(Skill2)
    elseif (arg1=="debugpbuffs") then    --Used for printing your buff names, and buffID
        DIYCE_DebugBuffList(pbuffs)
    elseif (arg1=="debugtbuffs") then    --Used for printing target buff names, and buffID
        DIYCE_DebugBuffList(tbuffs)
    elseif (arg1=="debugall") then        --Used for printing all of the above at the same time
        DIYCE_DebugSkills(Skill)
        DIYCE_DebugSkills(Skill2)
        DIYCE_DebugBuffList(pbuffs)
        DIYCE_DebugBuffList(tbuffs)
    end
    
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
        
    --Select Next Enemy
    if (tDead) then
        TargetUnit("")
        return
    end
    if (mainClass == "RANGER" or subClass == "RANGER")  and (not party) then        --To keep scouts from pulling mobs without meaning to.
        if (not LockedOn) or (not enemy) then
            TargetNearestEnemy()
            return
        end
    elseif mainClass ~= "RANGER" then                    --Let all other classes auto target.
        if (not LockedOn) or (not enemy) then
            TargetNearestEnemy()
            return
        end
    end
end


Change log (22/04/2013): Updated to fix tiny bug in Low Blow's custom cooldown timer - (pbuff should be the condition not tbuff)
Change log (06/11/2011): Updated to DIYCE 2.1 & Updated the silenceList with a few spells to interrupt during Sardo/Grafu.
Change log (11/11/2011): Updated to DIYCE 2.2.
Change log (12/11/2011): Fixed a tiny bug.
Change log (23/11/2011): Timers have been added.

Quoted from "Peryl;480678"

Sort of.

Here's a big hint: Ask yourself, what would happen if the use clause is a boolean but has the value false.


Well if use had a value of false, it wouldn't cast that specific skill.
As far as I can tell, it's working perfectly, a little delay that I do not enjoy. But it's perfect for people who have a low-ping to the server.

57

Friday, November 4th 2011, 6:16pm

Quoted from "mrmisterwaa;480680"

(Btw, Targetnearestenemy is disabled due to it being annoying in GrafuHM.)


I don't know if it's that important to you, but you could theoretically set up an array similar to the silenceList array named "zoneList" that could hold a list of zone names (Grafu Castle, Sardo Castle, etc) and then use the GetZoneName() and GetInstanceLevel() functions to check against before calling the re-targeting code block. That way, re-targeting would work in all instances and zones except the ones you specify.

It's just a thought. :)

Also, here's a macro to get your exact zone name and instance difficulty level so that you can begin to build your exclusion list:

Source code

1
/script DEFAULT_CHAT_FRAME:AddMessage(GetZoneName(), GetInstanceLevel());


I haven't tried it yet, but it looks solid. The zoneList array could also be used to change your combat mode from "like a farmer" to "like a boss" depending on what zone you're in so that you wouldn't need multiple macros (and hence multiple action bar slots... unless you use the shift key method, that is). Samohn had requested a mode change method earlier in the thread. I showed him a way with function arguments, but this would work too if you already have an idea of how you'd change your fighting style based in where you are.

Auros

Professional

Posts: 1,345

Mood: Mellow

  • Send private message

58

Friday, November 4th 2011, 8:07pm

Under Player and Target status, you have the line:
local Melee = GetActionUsable (13) -- # is your melee range spell slot number

From what little I understand is this reading something in slot 13 on your action bar? What would be the thing that should be in slot 13? Autoattack, white hits, the macro call, what?

Also, in the original post you state the macro call should be /run Killsequence ()
In the script the function is named KillSequence , is the capitalization of the S required in the macro call?

Similar to the first question, in your warrior/mage script you had:
-- Class: Warrior/Mage
if mainClass == "WARRIOR" and subClass == "MAGE" then
local SurpriseAttack = GetActionUsable (14)
Just wondering what this action does, or what you have in slot 14

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

59

Friday, November 4th 2011, 8:30pm

Quoted from "jtanner28;480719"

I don't know if it's that important to you, but you could theoretically set up an array similar to the silenceList array named "zoneList" that could hold a list of zone names (Grafu Castle, Sardo Castle, etc) and then use the GetZoneName() and GetInstanceLevel() functions to check against before calling the re-targeting code block. That way, re-targeting would work in all instances and zones except the ones you specify.

It's just a thought. :)

Also, here's a macro to get your exact zone name and instance difficulty level so that you can begin to build your exclusion list:

Source code

1
/script DEFAULT_CHAT_FRAME:AddMessage(GetZoneName(), GetInstanceLevel());
I haven't tried it yet, but it looks solid. The zoneList array could also be used to change your combat mode from "like a farmer" to "like a boss" depending on what zone you're in so that you wouldn't need multiple macros (and hence multiple action bar slots... unless you use the shift key method, that is). Samohn had requested a mode change method earlier in the thread. I showed him a way with function arguments, but this would work too if you already have an idea of how you'd change your fighting style based in where you are.


Actually, it's not that. I don't like TargetNearestEnemy.

I would use it if you could someone bind the tab button into DIYCE.

I tend to rotate my screen to suit my tab-targetting as well. It's a hard habit to break.

@Auros,

local melee is a melee check. So you can use any skill that pretty much has a range of 50. For SurpriseAttack, (I am assuming it's a set skill) you need it to be on your bar so you can let DIYCE use it.

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

60

Friday, November 4th 2011, 8:36pm

Will work on putting the fixes into the OP, and the .zip file as well. Thanks for pointing that out guys, and thanks for the subsequent fix for it Peryl.

@Auros - GetActionUsable(#) will read the action bar slot you specify in the # designator. Change it from 13 if you want, to any slot you want it to be. As for what it should be, use whatever skill you have that is 50 in range, is instant cast, no cooldown, and either cost you nothing, or very little to cast. Most rogues or X/Rogues will choose to use Shadowstab for thier melee check. However, you can also reverse engineer this to determine any range value you want, like I do with warriors and Surprise Attack (which is what I have in slot 14 for the war/mage section of script).

AddOn: DIY Combat Engine v2 AddOn: Auto Ding
Reni - Malkira
Warlock Guide
Retired from RoM with patch 6.1.0

1 user apart from you is browsing this thread:

1 guests