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.

161

Friday, November 11th 2011, 4:11pm

awesome job ghost/peryl/ and even sekritnub...my latency timer returns like 0.0. very fast script :p

everything working great but i have a weird issue...i cant kite with it on scout like diyce 1.0. keeps saying must face target and wont fire skills...took out auto target and still same issue. no idea :/ ?

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

162

Friday, November 11th 2011, 4:16pm

Quoted from "pazuzzu;482475"

awesome job ghost/peryl/ and even sekritnub...my latency timer returns like 0.0. very fast script :p

everything working great but i have a weird issue...i cant kite with it on scout like diyce 1.0. keeps saying must face target and wont fire skills...took out auto target and still same issue. no idea :/ ?


I noticed this as well when using my Shot spam ... I am not 100% sure how to fix it though.

163

Friday, November 11th 2011, 5:19pm

Ghost or Peryl, have you had a chance to take a look at my code to find out why diyce won't run while i am in a group? I have scoured both the diyce and custom functions only a few specific places call for group locals. But I can't see any reason why they work solo and don't work grouped. My post was #152 with full code posts.

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

164

Friday, November 11th 2011, 6:00pm

One thing I did notice, Peryl:

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

("1" = my arg2 btw).

I don't get the target's buffs.

When I use debugtbuffs as the arg1, it gives it to me.

Weird. >.>

Posts: 86

Location: Dominating in 3vs3, 6vs6 and siege.

Occupation: Network Administrator for a local NBC T.V. station.

  • Send private message

165

Friday, November 11th 2011, 7:20pm

For those that have made the switchover to 2.0, have you noticed an improvement in the speed that skills are being set off? Or maybe a DPS increase? I'm thinking of trying out this version of DIYCE but would like some thoughts on it from other users. Thanks guys and nice work Ghostwolf.

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

166

Friday, November 11th 2011, 7:27pm

Quoted from "ItIsFinished22;482554"

For those that have made the switchover to 2.0, have you noticed an improvement in the speed that skills are being set off? Or maybe a DPS increase? I'm thinking of trying out this version of DIYCE but would like some thoughts on it from other users. Thanks guys and nice work Ghostwolf.


Look at what Paz posted a few posts above you.

This script is MUCH faster then DIYCE 1.0.

I feel it whenever I smash my buttons.

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

167

Friday, November 11th 2011, 7:45pm

Quoted from "lordmohg;482510"

Ghost or Peryl, have you had a chance to take a look at my code to find out why diyce won't run while i am in a group? I have scoured both the diyce and custom functions only a few specific places call for group locals. But I can't see any reason why they work solo and don't work grouped. My post was #152 with full code posts.

For your P/K, try this macro in a party and see if it works:

Source code

1
/run if PriestFairySequence("v1") then return; elseif BuffParty(14) then return; elseif PartyHealer.Main() then return; elseif KillSequence("v1",11,12) then return; end

168

Friday, November 11th 2011, 9:18pm

I tried your recent macro, and when i am in party with my GF it makes me run 1/2 map away to go buff her. We are in different areas farming. I let it run me to see where it would take me. Then i stayed next to her and changed it to debugskills. It populates the first set of skills 1-24.. all false then the next set of skills2 is empty. i drop group and hit it again. all 24 skills populate as false, and now there are 2 skills2 bone chill and rising tide.

For some reason Mycombat is not reading skills2 when i am in a group.

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

169

Friday, November 11th 2011, 10:20pm

That's really odd. I ran HoS the other day and had no issues what so ever on my p/r... I see no issues in your code that needs to be fixed. Try taking the buff party part out of the macro, and put it on a separate macro, and then run the main macro again.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

170

Friday, November 11th 2011, 11:39pm

Quoted from "mrmisterwaa;482523"

One thing I did notice, Peryl:

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

("1" = my arg2 btw).

I don't get the target's buffs.

When I use debugtbuffs as the arg1, it gives it to me.

Weird. >.>


I'm not really sure what is going on here (I'm assuming you are running the code you posted in your sig)but I'd like you to test a little theory that popped into my head.

DIYCE 2.0 uses a frame to catch events (specifically to know when to re-read the player skills when leveling up, changing classes, etc). One thing about frames is that it uses variables called arg1, arg2, ..., arg9. Now it shouldn't be a problem, but I'm wondering if there is some kind of interference going on with your use of arg1 and arg2 as parameters (if this is the case, then it could affect all DIYCE 2.0 code).

So the test is simply change the name of the arguments to something else (say param1, param2). Of course, you'd need to change the references to those variables in KillSequence() as well. If things start to work after this change, then we found the problem.

Again though, this is merely speculation on my part and I'm not really confident it will work (more like grasping at straws).
2013... The year from hell....

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

171

Friday, November 11th 2011, 11:43pm

Quoted from "lordmohg;482510"

Ghost or Peryl, have you had a chance to take a look at my code to find out why diyce won't run while i am in a group? I have scoured both the diyce and custom functions only a few specific places call for group locals. But I can't see any reason why they work solo and don't work grouped. My post was #152 with full code posts.

I did take a quick look though I had to go to work so didn't have time to really get into it, but like ghost, I didn't see anything that would indicate it shouldn't be working.

I'll go over it again but at the moment I can't think why it would be doing this odd behavior.
2013... The year from hell....

172

Saturday, November 12th 2011, 12:16am

update: i took buffparty out of macro and its working as intended again. something is amiss with buff party. have to look at it in detail later. but at least narrowed it down to buffparty.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

173

Saturday, November 12th 2011, 12:50am

Quoted from "lordmohg;482648"

update: i took buffparty out of macro and its working as intended again. something is amiss with buff party. have to look at it in detail later. but at least narrowed it down to buffparty.


My guess would be that BuffParty is changing your target so by the time it calls KillSequence() you no longer are targeting an enemy but a party member.
2013... The year from hell....

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

174

Saturday, November 12th 2011, 1:42am

Quoted from "Peryl;482638"

I'm not really sure what is going on here (I'm assuming you are running the code you posted in your sig)but I'd like you to test a little theory that popped into my head.

DIYCE 2.0 uses a frame to catch events (specifically to know when to re-read the player skills when leveling up, changing classes, etc). One thing about frames is that it uses variables called arg1, arg2, ..., arg9. Now it shouldn't be a problem, but I'm wondering if there is some kind of interference going on with your use of arg1 and arg2 as parameters (if this is the case, then it could affect all DIYCE 2.0 code).

So the test is simply change the name of the arguments to something else (say param1, param2). Of course, you'd need to change the references to those variables in KillSequence() as well. If things start to work after this change, then we found the problem.

Again though, this is merely speculation on my part and I'm not really confident it will work (more like grasping at straws).


I changed arg2 -> goat2

Tested and still the same problem.

So I doubt it's a conflict problem.

Weird error I have never gotten though:

Source code

1
[string '?']:23: attempt to concatenate field 'time' (a nil value)


This is a brand-new error that never appeared until I updated to DIYCE 2.2 (today)

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

175

Saturday, November 12th 2011, 3:35am

Quoted from "mrmisterwaa;482666"

I changed arg2 -> goat2

Tested and still the same problem.

So I doubt it's a conflict problem.

Yeah, didn't really think it would be, but had to test it just in case.


Quoted from "mrmisterwaa;482666"

Weird error I have never gotten though:

Source code

1
[string '?']:23: attempt to concatenate field 'time' (a nil value)


This is a brand-new error that never appeared until I updated to DIYCE 2.2 (today)


Hmmmm... didn't think the game would return a nil value for some buffs/debuffs. Guess it does.

To fix, change the following lines in the BuffList() function in DIYCE.lua

Source code

1
2
3
4
            -- 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") }

All I did here is added or 0 where I use timeRemaining.
2013... The year from hell....

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

176

Saturday, November 12th 2011, 4:02am

Quoted from "karol891;482283"

Sadly there is no clue/hint , action bar only showing skill's cooldown which is 4sec for Decay.


Hmmm... I can't find any function to get the usable state of an elite skill, but if you can get it onto one of the normal action bars, GetActionUsable(#) might do the trick (it returns a true/false value if an action can be used and you give it the action bar button number).
2013... The year from hell....

177

Saturday, November 12th 2011, 9:16am

Did a little testing before bed and still befuddled. I commented out my addition of othersbuffs. I hold shift to vocal buffparty, it tells me my groupmate is out of range while it is running to them to buff them. Is it supposed to move to them to buff? thought it was 'posed to skip 'em. Even with Otherbuffs commented out i still get no skills2 on debugskills with buffparty in macro. And i get skills2 with no buffparty in macro. Hrrrrmh!!! more testing tomorrow.

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
 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 othersbuffs = { "Holy Protection" }
    
    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
--            if vocal then Msg("- Checking others buffs on "..UnitName("party"..num)) end
--              for i,buff in ipairs(othersbuffs) 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

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

178

Saturday, November 12th 2011, 12:49pm

Quoted from "Peryl;482677"

Yeah, didn't really think it would be, but had to test it just in case.




Hmmmm... didn't think the game would return a nil value for some buffs/debuffs. Guess it does.

To fix, change the following lines in the BuffList() function in DIYCE.lua

Source code

1
2
3
4
            -- 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") }
All I did here is added or 0 where I use timeRemaining.


As far as I can tell, it's working fine.

No more error and it shows the buffs of the target when I put debugall.

179

Tuesday, November 15th 2011, 6:45pm

im really noob on this but i was trying to work in a diyce for k/s and work fine for just melee combat but idk how to adds the range atack i was trying to get in a second macro but i get a error.
[string '?' ]:163: 'end' expected (to close 'function' at line 19) near '<eof>'

also if i can get a tips for make it work better i will glad to know =)

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
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,
                        }    


function KillSequence(arg1, 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(13) -- # 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 <= .04 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: Warrior/Mage
            if mainClass == "WARRIOR" and subClass == "THIEF" then
                local SurpriseAttack = GetActionUsable(14)
    
            --Potions and Buffs
            Skill = {
                { name = "Action: "..healthpot,            use = (phealth <= .70) },
                { name = "Survival Instinct",              use = (phealth <= .40) and combat },
                { name = "Action: "..manapot,              use = (pctEB2 <= .40) },
                    }
                    
            --Combat
                if enemy then
                Skill2 = {
                    { name = "Enraged",                    use = (EnergyBar1 <= 30) and (boss or elite) },
                    { name = "Slash",                      use = ( not tbuffs[500081]) and(EnergyBar1 >= 25) },
                    { name = "Probing Attack",             use = ( not tbuffs[501502]) and (EnergyBar1 >= 20)  },
                    { name = "Open Flank",                 use = ( tbuffs[501502])  and (not tbuffs[503161]) and(EnergyBar1 >= 10) },
                    { name = "Keen Attack",                use = ( tbuffs[501502]) and(EnergyBar2 >= 20) },
                    { name = "Splitting Chop",             use = ( tbuffs[501503])  and (EnergyBar1 >= 15)  },
                    { name = "Tactical Attack",            use = ( tbuffs[500081]) and (EnergyBar1 >= 15) },
                    { name = "Blood Dance",                use = (phealth >= .70) and combat },
                    { name = "Shadowstab",                 use = (EnergyBar2 >= 20) },
                    { name = "Attack",                     use = (thealth == 1) },
                        }
                end

        --Class: Knight/Scout
            elseif mainClass == "KNIGHT" and subClass == "RANGER" then
            
            --Potions and Buffs
            Skill = {
                { name = "Action: "..healthpot,           use = (phealth <= .70) },
                { name = "Action: "..manapot,             use = (pctEB2 <= .40) },
                { name = "Resolution",                    use = (phealth <= .30) and combat },
                    }
            
            --Combat
                if enemy then
                Skill2 = {
                --  Use Throat Attack on detect enemy spell cast.                
                    { name = "Throat Attack",                use = (melee and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and pctEB1 >= 15) },
                    { name = "Schock",                       use = (silenceThis) },
                    { name = "Shield of Valor",              use = ((phealth <= .8) and shield) },
                    { name = "Shield of Discipline",         use = (silenceThis and shield) },
                    { name = "Shield of Atonement",          use = (combat and shield and (not tbuffs['Restrained'])) },                    
                    { name = "Mana Return",                  use = (tbuffs['Holy Seals 3']) and (pctEB1 <= .70) },
                    { name = "Threaten",                     use = (tbuffs['Holy Seals 3']) and (not tbuffs['Threaten']) },
                    { name = "Hatred Strike",                use = (combat and party) },-- Agro Multiplier if in party only                    
                    { name = "Charge",                       use = (combat and (tspell ~= nil)) or (not melee and not tbuffs['Charge']) }, -- charge spellcasters
                    { name = "Whirlwind Shield",             use = (CD("Whirlwind Shield") and (EnergyBar1 >= 189)) },            
                    { name = "Holy Strike",                  use = (EnergyBar1 >= 145 ) and not tbuffs['Light Seal III'] },
                        }
            --Combat & arrow
                if enemy and (mode == "arrow") then 
                Skill2 = {
                    { name = "Vampire Arrows",             use = (CD("Vampire Arrows")) }, 
                    { name = "Sacred Resistance",          use = (CD("Sacred Resistance")) },
                    { name = "Shot",                       use = (CD("Shot")) },
                         }    
                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
RoM US - Osha - Core
Lucho
K/W/S 31k sta still looking for more :D - S/K VN and GCH tanking complete :D
[img][/img]

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

180

Wednesday, November 16th 2011, 5:14am

@hefusuto - You have incorrect formatting in your syntax, which is causing both errors simultaneously.

Also, you are using the CD check erroneously throughout the code. The CD check is called with each passthrough of the code already, so you are using it redundantly which will in fact lessen the effectiveness of the code.

Try the following for your K/S portion:

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
        --Class: Knight/Scout
            elseif mainClass == "KNIGHT" and subClass == "RANGER" then
            
            --Potions and Buffs
            Skill = {
                { name = "Action: "..healthpot,           use = (phealth <= .70) },
                { name = "Action: "..manapot,             use = (pctEB2 <= .40) },
                { name = "Resolution",                    use = (phealth <= .30) and combat },
                    }
            
            --Combat
                if enemy then 
                    if (mode == "arrow") then        --set mode to "arrow" in a seperate macro to call the ranged spells, otherwise it will go right to the melee spells (this is how mode is meant to work).
                        Skill2 = {
                            { name = "Vampire Arrows",             use = true }, 
                            { name = "Sacred Resistance",          use = true },
                            { name = "Shot",                       use = true },
                                    } 
                    else
                        Skill2 = {
                            --  Use Throat Attack on detect enemy spell cast.                
                                { name = "Throat Attack",                use = (melee and (silenceThis) and pctEB1 >= 15) },
                                { name = "Schock",                       use = (silenceThis) },
                                { name = "Shield of Valor",              use = ((phealth <= .8) and shield) },
                                { name = "Shield of Discipline",         use = (silenceThis and shield) },
                                { name = "Shield of Atonement",          use = (combat and shield and (not tbuffs['Restrained'])) },                    
                                { name = "Mana Return",                  use = (tbuffs['Holy Seals 3']) and (pctEB1 <= .70) },
                                { name = "Threaten",                     use = (tbuffs['Holy Seals 3']) and (not tbuffs['Threaten']) },
                                { name = "Hatred Strike",                use = (combat and party) },-- Agro Multiplier if in party only                    
                                { name = "Charge",                       use = (combat and (tspell ~= nil)) or (not melee and not tbuffs['Charge']) }, -- charge spellcasters
                                { name = "Whirlwind Shield",             use = (EnergyBar1 >= 189) },            
                                { name = "Holy Strike",                  use = (EnergyBar1 >= 145 ) and not tbuffs['Light Seal III'] },
                                    }
                    end


Note: No idea if this is how most K/S play, I simply fixed errors in this code. I do not endorse this set up for a K/S, again this is simply a fix and not my code at all.

@ Peryl - I'll get that into the main code. I never would have guessed at a nil return on a buff/debuff either. Not even sure how that's possible... The people who code this game astonish me at every turn...