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

661

Sunday, June 24th 2012, 11:26pm

The only thing I see that looks off is that the second clause of the outer if statement doesn't verify that you are not in pvp mode. The way you had it, it would only reach that third clause if you were a scout and were in pvp. Try:

Source code

1
    elseif mainClass ~= "RANGER" and not pvp then

You can then also remove the and (not pvp) check inside that clause since it will obviously always be true at that point.

Here's a more human readable version of the outer if statement as you had it before in order to better see how it would have worked:

Source code

1
2
3
4
5
6
7
    if primary class is a scout and not in a party and not in pvp then
        ...
    elseif primary class is [i]not[/i] a scout then
        ...
    elseif in pvp then
        ...
    end

We skip the first clause since we are in pvp mode so that part is false and therefore move to the second clause. This one will trigger for anything that isn't a scout and doesn't look at the pvp flag at all, so the only way to reach the third clause is to be a scout as primary class and also be in pvp mode.
2013... The year from hell....

662

Wednesday, June 27th 2012, 7:00pm

Bah

Quoted from "mrmisterwaa;480680"

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 (tbuffs['Energy Thief'])),      timer = "LBBleed",   ignoretimer = not tbuffs['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 (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.



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.

Well, i tried all this, and all that will cast is shadowstab and vamp arrows. any help?

663

Thursday, June 28th 2012, 11:38pm

Hello. I'm looking for ready DIYCE for S/R. Earliest scripts didn't work.
If someone have this kind of DIYCE I will be greatful for that :)

664

Friday, June 29th 2012, 2:55am

Quoted from "deedee10;541590"

Well, i tried all this, and all that will cast is shadowstab and vamp arrows. any help?


Please post your CustomFunctions.lua so we can look at what is going on.

665

Friday, June 29th 2012, 2:57am

Quoted from "dasdawd;542000"

Hello. I'm looking for ready DIYCE for S/R. Earliest scripts didn't work.
If someone have this kind of DIYCE I will be greatful for that :)


Can you post what you have in your CustomFunctions.lua so we can see it. The DIYCE 2 scripts should still work. If we can't find the issue I have a guildie that has one.

666

Friday, June 29th 2012, 3:06am

Peryl if you are still around, I have an idea to alter the targeting feature in DIYCE. I would like to make it a complete function that can get called from inside the class combo parts of KillSequence.

The idea is that depending on the situation you can have it target only certain targets. The reason I would like it this way is so that I can have multiple targeting options in siege. I can have one macro designated for enemy players that only targets them and another one that is for the buildings and traps.

After all that, the question is, Does the function have to go before KillSequence or can it go after? I have starting reading a really good book about Lua programming and I am starting to understand all the gibberish. LOL :D

P.S. What ever happened to getting DIYCE 2 onto curse?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

667

Friday, June 29th 2012, 5:28am

Quoted from "Alterios;542071"

Peryl if you are still around,

Yup, still around, just busy with work etc. Real life sucks...


Quoted from "Alterios;542071"

I have an idea to alter the targeting feature in DIYCE. I would like to make it a complete function that can get called from inside the class combo parts of KillSequence.

The idea is that depending on the situation you can have it target only certain targets. The reason I would like it this way is so that I can have multiple targeting options in siege. I can have one macro designated for enemy players that only targets them and another one that is for the buildings and traps.

Well yes you could do that, and in many ways too.

One way would be to add a new "Target:" type much like the "Action:" and "Custom:" stuff is done. You could then have the code do the appropriate targeting depending on what is selected. lets say "Target: player" would target players only, "Target: friendly" to target next friendly player/NPC (for healers, this could use the game's TargetNearestFriend() function), "Target: non-pets" to ignore pets during targeting etc, etc.

Another method to pull this off which wouldn't even require modifications to DIYCE itself would be to trick DIYCE into calling the required targeting code. This can be done via the use clause of the skill line. One of the changes that I had suggested way back for the original DIYCE and that got put into DIYCE 2.0 is that the use clause can be a function! If it is a function, DIYCE will call the function and expect a true/false value as the returned value. So consider the following fudged skill line (spacing here is for readability only):

Source code

1
2
3
4
    { name = "re-target", use = function () 
                                              TargetNearestEnemy() 
                                              return false
                                          end }

Here, the name of the skill is not relevant since the use clause function will always return false and therefore the skill is never actually used (you could return true, but then DIYCE will attempt to use that named skill, which in this case obviously doesn't exist). This line would have to appear before any other skills you want to be affected by this. Do note that this would always re-target when processing a skill list with this line in it.

To have it call an existing function instead of declaring the function in-line as above, just put the name of the function as the use clause (note that you don't get to pass arguments with this method since the code isn't setup for doing that). As an example, lets say you want to trigger Regenerate only if the ALT key is pressed. You could do something like this:

Source code

1
    { name = "Regenerate", use = IsAltKeyDown }

IsAltKeyDown is a game function that returns true or false depending on the state of the ALT key. Funky no?


Quoted from "Alterios;542071"

After all that, the question is, Does the function have to go before KillSequence or can it go after?

Depends. If the function is created and declared globally, it is fine to have it declared after its use since when Lua compiles the code, it won't know about the function and therefore assume that you are attempting to use a name declared globally. However, for local functions or if there is already a global function by that name, confusion can set in so it is always good practice to declared your functions before their use.

Quoted from "Alterios;542071"

I have starting reading a really good book about Lua programming and I am starting to understand all the gibberish. LOL :D

P.S. What ever happened to getting DIYCE 2 onto curse?

Good for you. If you have questions about something that seems odd to you, PM me and I'll try to answer.

As for DIYCE 2.0 going up on Curse, Ghostwolf was supposed to look into doing that but it doesn't appear as if he did finalize the process. Then he left RoM so the whole thing became moot.
2013... The year from hell....

668

Friday, June 29th 2012, 6:38am

Quoted from "Peryl;542111"


Another method to pull this off which wouldn't even require modifications to DIYCE itself would be to trick DIYCE into calling the required targeting code. This can be done via the use clause of the skill line. One of the changes that I had suggested way back for the original DIYCE and that got put into DIYCE 2.0 is that the use clause can be a function! If it is a function, DIYCE will call the function and expect a true/false value as the returned value. So consider the following fudged skill line (spacing here is for readability only):

Source code

1
2
3
4
    { name = "re-target", use = function () 
                                              TargetNearestEnemy() 
                                              return false
                                          end }

Here, the name of the skill is not relevant since the use clause function will always return false and therefore the skill is never actually used (you could return true, but then DIYCE will attempt to use that named skill, which in this case obviously doesn't exist). This line would have to appear before any other skills you want to be affected by this. Do note that this would always re-target when processing a skill list with this line in it.


This is kind of what I was talking about. An example would be:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
   function DIYCE_NextEnemy()
    if (tDead) then
        TargetUnit("")
        return
    end
    if mainClass == "RANGER" and (not party) then
        if (not LockedOn) or (not enemy) then
            TargetNearestEnemy()
            return
        end
    elseif mainClass ~= "RANGER" then 
        if (not LockedOn) or (not enemy) then
            TargetNearestEnemy()
            return
        end
    end


Creating a function for each of the targeting type wanted I could then call it with a line like:

Source code

1
{ name = "re-target", use = DIYCE_NextEnemy()}

Using this method we could modularize the targeting preferences by simply creating a function for each type of targeting desired. A person could have 1 macro for each of the target types and a healer could use the same system for targeting like you said earlier. Once the functions are added all you have to do is change that one line and treat it like a skill.

And yes, I know I didn't even come close to writing that right. To me there is a big difference between reading it and writing it correctly.:o

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

669

Friday, June 29th 2012, 6:51am

First, you need to remove the parentheses after the DIYCE_NextEnemy in the use clause. You are providing a reference to the function, not intending to call the function at that point.
[INDENT]
Aside:
The name of a function is just a variable that refers to a function, not the function itself. You can prove this to yourself by typing the following lines in the chat edit box (or in a macro):

Source code

1
2
3
/run DEFAULT_CHAT_FRAME:AddMessage(tostring(KillSequence))
/run blahblah = KillSequence
/run DEFAULT_CHAT_FRAME:AddMessage(tostring(blahblah))

The first line will show the reference to the memory where the KillSequence function is located. The second will show the same reference even though we are getting the reference from a variable called blahblah.

[/INDENT]

I still recommend the first method though since the same can be done, but you add more flexibility and avoid the problem of having the function automatically when the list is processed (as opposed to used).
2013... The year from hell....

670

Friday, June 29th 2012, 11:01am

This is what i have:

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


function KillSequence(arg1, mode)
--arg1 = "v1" or "v2" for debugging
--mode = "pve" or "pvp"
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 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 <= .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

--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:Scout/Rogue
if mainClass == "RANGER" and subClass == "THIEF" then


--Combat
if enemy and (Mode == "pve") then
Skill2 = {
{ name = "Snipe", use = (CD['Snipe']) and boss },
{ name = "Sapping Arrow", use = (CD['Sapping Arrow']) and boss and elite },
{ name = "Autoshot", use = (not ASon) and boss and elite },
{ name = "Vampire Arrows", use = (CD['Vampire Arrows']) and (EnergyBar1 >=20) },
{ name = "Piercing Arrow", use = (CD['Piercing Arrow']) },
{ name = "Combo Shot", use = (CD['Combo Shot']) },
{ name = "Shot", use = (CD['Shot']) },
{ name = "Weak Spot", use = (CD['Weak Spot']) and (EnergyBar1 >=30) },
{ name = "Deadly Poison Bite", use = (CD['Deadly Poison Bite']) and (EnergyBar1 >=30) and boss },
{ name = "Reflected Shot", use = (CD['Reflected Shot']) },
}
--Combat
elseif enemy and (Mode == "pvp") then
Skill2 = {
{ name = "Neck Strike", use = melee and (silenceThis) },
{ name = "Throat Attack", use = melee and (silenceThis) },
{ name = "Detection", use = (not pbuffs['Detection']) },
{ name = "Piercing Arrow", use = (CD['Piercing Arrow']) },
{ name = "Vampire Arrow", use = (CD['Vampire Arrow']) and (EnergyBar1 >=30) },
{ name = "Shot", use = (CD['Shot']) },
{ name = "Combo Shot", use = (CD['Combo Shot']) },
{ name = "Reflected Shot", use = (CD['Reflected Shot']) },
}
end


--Class: Scout/Warden
elseif mainClass == "RANGER" and subClass == "WARDEN" then

--Potions and Buffs
Skill = {
{ name = "Briar Shield", use = (not pbuffs("Briar Shield")) },
{ name = "Entling Offering", use = (not pbuffs("Entling Offering")) },
{ name = "Target Area", use = (not pbuffs("Target Area")) and combat and boss and (EnergyBar1 >=90) },
{ name = "Archer's Glory", use = (not pbuffs("Archer's Glory")) and (EnergyBar >=50) and boss },
}
--Combat & PVE
if enemy and (mode == "pve") then
Skill2 = {
{ name = "Snipe", use = (pbuffs("Hidden Peril")) },
{ name = "Autoshot", use = (not ASon) },
{ name = "Combo Shot", use = (CD("Combo Shot")) },
{ name = "Vampire Arrows", use = (CD("Vampire Arrows")) and (EnergyBar1 >= 30) },
{ name = "Thorn Arrow", use = (CD("Torn Arrow")) },
{ name = "Hidden Peril", use = (CD("Hidden Peril") and (EnergyBar1 >= 30)) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Shoot", use = (CD("Shoot")) },
}
--Combat & PVP
elseif enemy and (mode == "pvp") then
Skill2 = {
{ name = "Neck Strike", use = melee and (silenceThis) },
{ name = "Throat Stab", use = melee and (silenceThis) },
{ name = "Detection", use = (not pbuffs("Detection")) },
{ name = "Snipe", use = (pbuffs("Hidden Peril")) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Hidden Perril", use = (CD("Hidden Perril") and (EnergyBar1 >=30)) },
{ name = "Vampire Arrows", use = (CD("Vampire Arrows")) },
{ name = "Shot", use = (CD("Shot")) },
{ name = "Thorn Arrow", use = (CD("Torn Arrow")) },
{ name = "Combo Shot", use = (CD("Combo Shot")) },
{ name = "Reflected Shot", use = (CD("Reflected 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 (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" 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

It's from around page 60 but I can't make that work :(

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

671

Friday, June 29th 2012, 1:28pm

Please use code tags when posting code otherwise we get a rather difficult to read thing like the above.

Anyway, how are you calling DIYCE? (as in, what is the macro you are using). The above function is setup so that you need to provide a "pve" or "pvp" flag depending on what you want it to do. So for general questing and instances, you would want to call it with

Source code

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

for Siege war and other PvP stuff, you would want

Source code

1
/run KillSequence("","pvp")
2013... The year from hell....

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

672

Friday, June 29th 2012, 2:04pm

Quoted from "deedee10;541590"

Well, i tried all this, and all that will cast is shadowstab and vamp arrows. any help?

How are you calling DIYCE, that is what is/are the macros you are using. Sekrit had setup that version so that there were different macros for different things/situations and you are expected to have created and be using them seperately. The needed macros are shown in the post itself.
2013... The year from hell....

673

Friday, June 29th 2012, 2:24pm

I call my macro like You wrote and still not working

674

Friday, June 29th 2012, 3:40pm

Peryl, I see you are saying. I like the first way as well. I misread it the first time. I will do some tinkering and see what breaks.

dasdawd, I will look at it closer when i get home from work. Looking at code on my phone isn't the best.

675

Friday, June 29th 2012, 3:55pm

Ok, thaks. I will be really gratefull if You can improve that macro :)

676

Sunday, July 1st 2012, 5:56pm

I'm not sure how to define Soldiers, Attack! skill from SW title. I got "Skill not available: Soldiers, Attack!" even with correct title.

677

Sunday, July 1st 2012, 8:38pm

Can you post your CustomFunctions.lua? (use code tags in the advanced reply editor)
The line with the skill in it should look something like

Source code

1
{ name = "Soldiers, Attack!",                use = (true) and party },

I was able to use a title skill by using a line similar to the one above. If there are any in-game errors, please post them.
As long as I have the title on it works properly. If using the actual name of the skill doesn't work you can use the skill ID [495176].

P.S. I know this will sound dumb but make sure you are not in the guild castle or your house when you try it out.

678

Sunday, July 1st 2012, 10:06pm

Sorry it took so long, work went crazy.
Here is the S/R and R/S block from my friend. If you compare his and yours, you will see that the CD parameters are not needed. The reason that CD is not needed is that cooldowns are handled by the game and will simply not let the skill be used. When this happens DIYCE just passes over that skill and goes to the next one. That's one reason that you never got past those 2 skills. They were always available so it never went past them to read the other skills. There were also several skills that did not have the closing parenthesis. What editor do you use? Notepad++ is free and has good syntax highlighting if you are new to DIYCE. The timers in his file are to keep him from spamming shot during the Exploiting Shot debuff.

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
 -- Class: Scout/Rogue
            elseif mainClass == "RANGER" and subClass == "THIEF" then

            --Timers for this class
            CreateDIYCETimer("ExploitCooldown", 32, false)

                if (enemy and (arg2 == "DPS")) then
                Skill2 = {
                    { name = "Timer: ExploitCooldown",         use = (tbuffs['Exploiting Shot']) and (GetDIYCETimerValue("ExploitCooldown") == 0) },
                    { name = "Autoshot",                       use = (not ASon) },
                    { name = "Sapping Arrow",                  use = (not pbuffs['Sapping Arrow']) },
                    { name = "Shot",                           use = (GetDIYCETimerValue("ExploitCooldown") == 0) },
                    { name = "Reflected Shot",                 use = true },
                    { name = "Vampire Arrows",                 use = true },
                    { name = "Deadly Poison Bite",             use = true },
                    { name = "Piercing Arrow",                 use = true },
                    { name = "Combo Shot",                     use = true },
                    { name = "Weak Spot",                      use = true },
                    { name = "Wind Arrows",                    use = (EnergyBar1 >= 20) }
                            }

                elseif (enemy and (arg2 == "FARM")) then
                Skill2 = {
                    { name = "Reflected Shot",                 use = true },
                    { name = "Piercing Arrow",                 use = true },
                    { name = "Vampire Arrows",                 use = true },
                    { name = "Wind Arrows",                    use = (EnergyBar1 >= 20) }
                            }

                                elseif (enemy and (arg2 == "SEIGE")) then
                Skill2 = {
                    { name = "Vampire Arrows",                 use = true },
                                        { name = "Autoshot",                       use = (not ASon) },
                                        { name = "Reflected Shot",                 use = true },
                    { name = "Piercing Arrow",                 use = true },
                    { name = "Wind Arrows",                    use = (EnergyBar1 >= 20) }
                                                        }
                                end

                -- Class: Rogue/Scout
                elseif mainClass == "THIEF" and subClass == "RANGER" then

                        --Timers for this class
            CreateDIYCETimer("SSBleed", 6.5, true) --Change the value between 6 -> 7.5 depending on your lag.
            CreateDIYCETimer("LBBleed", 8.5, false) --Change the value between 7 ->  8.5 depending on your lag.

                                if ((enemy) and (arg2 == "DPS")) then
                                Skill2 = {
                                        { name = "Energy Thief",                       use = (EnergyBar1 < 20 ) },
                                        { name = "Wound Attack",                       use = (EnergyBar1 >= 35) and (tbuffs[500654]) and (tbuffs[500704]) },
                                        { name = "Low Blow",                           use = (EnergyBar1 >= 25) and ((tbuffs[500654]) or (pbuffs['Energy Thief']))  },
                                        { name = "Shadowstab",                         use = (EnergyBar1 >= 20)  },
                                        --{ 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 (arg2 == "RANGE")) then
                                Skill2 = {
                    { name = "Vampire Arrows",                     use = (EnergyBar2 >= 20) },
                    { name = "Shot",                               use = ((EnergyBar1 > 20 )) },
                                                }
                                end


Here is his whole CustomFunction.lua so that you have the version he is using to minimize issues with the timer calls.

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
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 KillSequence(arg1, arg2, 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(11) -- # is your melee range spell slot number
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(5)  -- # 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 <= .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

    --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: Scout/Priest
        if mainClass == "RANGER" and subClass == "AUGUR" then

            if (enemy and (arg2 == "DPS")) then
                Skill2 = {
                    { name = "Vampire Arrows",                    use = true },
                    { name = "Autoshot",                        use = (not ASon) },
                    { name = "Combo Shot",                        use = true },
                    { name = "Reflected Shot",                    use = true },
                    { name = "Piercing Arrow",                    use = true },
                    { name = "Wind Arrows",                        use = (EnergyBar1 >= 20) },
                    { name = "Shot",                            use = true }
                        }

        elseif (enemy and (arg2 == "FARM")) then
            Skill2 = {
                    { name = "Reflected Shot",                    use = true },
                    { name = "Piercing Arrow",                    use = true },
                    { name = "Vampire Arrows",                    use = true },
                    { name = "Wind Arrows",                        use = (EnergyBar1 >= 20) }
                        }

        elseif (enemy and (arg2 == "SEIGE")) then
            Skill2 = {
                    { name = "Vampire Arrows",                    use = true },
                    { name = "Autoshot",                        use = (not ASon) },
                    { name = "Reflected Shot",                    use = true },
                    { name = "Piercing Arrow",                    use = true },
                    { name = "Wind Arrows",                        use = (EnergyBar1 >= 20) }
                        }
                    end

-- Class: Scout/Rogue
        elseif mainClass == "RANGER" and subClass == "THIEF" then

            --Timers for this class
            CreateDIYCETimer("ExploitCooldown", 32, false)

            if (enemy and (arg2 == "DPS")) then
                Skill2 = {
                    { name = "Timer: ExploitCooldown",            use = (tbuffs['Exploiting Shot']) and (GetDIYCETimerValue("ExploitCooldown") == 0) },
                    { name = "Autoshot",                        use = (not ASon) },
                    { name = "Sapping Arrow",                    use = (not pbuffs['Sapping Arrow']) },
                    { name = "Shot",                            use = (GetDIYCETimerValue("ExploitCooldown") == 0) },
                    { name = "Reflected Shot",                    use = true },
                    { name = "Vampire Arrows",                    use = true },
                    { name = "Deadly Poison Bite",                use = true },
                    { name = "Piercing Arrow",                    use = true },
                    { name = "Combo Shot",                        use = true },
                    { name = "Weak Spot",                        use = true },
                    { name = "Wind Arrows",                        use = (EnergyBar1 >= 20) }
                            }

            elseif (enemy and (arg2 == "FARM")) then
                Skill2 = {
                    { name = "Reflected Shot",                    use = true },
                    { name = "Piercing Arrow",                    use = true },
                    { name = "Vampire Arrows",                    use = true },
                    { name = "Wind Arrows",                        use = (EnergyBar1 >= 20) }
                            }

            elseif (enemy and (arg2 == "SEIGE")) then
                Skill2 = {
                    { name = "Vampire Arrows",                    use = true },
                    { name = "Autoshot",                        use = (not ASon) },
                    { name = "Reflected Shot",                    use = true },
                    { name = "Piercing Arrow",                    use = true },
                    { name = "Wind Arrows",                        use = (EnergyBar1 >= 20) }
                            }
                    end

-- Class: Rogue/Scout
        elseif mainClass == "THIEF" and subClass == "RANGER" then

            --Timers for this class
            CreateDIYCETimer("SSBleed", 6.5, true) --Change the value between 6 -> 7.5 depending on your lag.
            CreateDIYCETimer("LBBleed", 8.5, false) --Change the value between 7 ->  8.5 depending on your lag.

            if ((enemy) and (arg2 == "DPS")) then
                Skill2 = {
                    { name = "Energy Thief",                    use = (EnergyBar1 < 20 ) },
                    { name = "Wound Attack",                    use = (EnergyBar1 >= 35) and (tbuffs[500654]) and (tbuffs[500704]) },
                    { name = "Low Blow",                        use = (EnergyBar1 >= 25) and ((tbuffs[500654]) or (pbuffs['Energy Thief']))  },
                    { name = "Shadowstab",                        use = (EnergyBar1 >= 20)  },
                    --{ 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 (arg2 == "RANGE")) then
                Skill2 = {
                    { name = "Vampire Arrows",                    use = (EnergyBar2 >= 20) },
                    { name = "Shot",                            use = ((EnergyBar1 > 20 )) },
                            }
                        end

-- Class: Mage/Druid
            elseif mainClass == "MAGE" and subClass == "DRUID" then

                if (enemy and (arg2 == "FARM")) then
                Skill2 = {
                    { name = "Magma Blade",                    use = true },
                    { name = "Fireball",                    use = true },
                    { name = "Meteor Shower",                use = true },
                    { name = "Earth Pulse",                    use = true },
                            }
                    end

-- Class: Warlock/Mage
            elseif mainClass == "HARPSYN" and subClass == "MAGE" then

                if (enemy and (arg2 == "FARM")) then
                Skill2 = {
                    { name = "Fireball",                    use = true },
                    { name = "Warp Charge",                    use = true },
                    { name = "Surge of Malice",                use = true },
                        }
                    end

-- Class: Mage/Warlock
            elseif mainClass == "MAGE" and subClass == "HARPSYN" then

                if (enemy and (arg2 == "FARM")) then
                Skill2 = {
                    { name = "Fireball",                    use = true },
                    { name = "Warp Charge",                    use = true },
                    { name = "Surge of Malice",                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" 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

hangman04

Savage Warrior

Posts: 113

Location: Romania

Mood: Smile

  • Send private message

679

Monday, July 2nd 2012, 1:29am

Btw do we have an update for CH5 for diyce 2.0 ?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

680

Monday, July 2nd 2012, 2:37am

Quoted from "hangman04;542663"

Btw do we have an update for CH5 for diyce 2.0 ?

Apart from the new class names and the Warlock PSI point info (see here and here), there is nothing to actually update per-se.

There was a little discussion between Alterios and myself about some possible changes to the re-targeting system (see page 67). Apart from that, there is nothing.
2013... The year from hell....