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.

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

981

Sunday, March 3rd 2013, 4:44am

Quoted from "pazuzzu;591243"

huh..weird. only thing i can think of is the obvious....make sure the toc file and customfunctions are saved as txt ANSI encoding. otherwise maybe create a new blank txt file and paste in your code. sometimes win7 ignores you and does what it feels is most irritating.
:confused:


Tried to do that :/ no dice (hahhaahhaha)

982

Sunday, March 3rd 2013, 5:10am

damn, thats a bish. um....make sure you have no other copies of customfunctions.lua/diyce in the addons folder anywhere. scripts are read from there whether or not they're in their own folder. other than that..just plugging someone else's customfunctions in that is known to work...and see if it sees it in game, about all i can dream up. i go back to solitaire and let the experts handle it :o

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

983

Sunday, March 3rd 2013, 6:36am

Well. Since we now know that DIYCE.lua at least is loading I would say there is some kind of error in there somewhere. This would make the game stop the rest since CustomFunctions.lua comes after DIYCE.lua, so maybe post that.
2013... The year from hell....

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

984

Sunday, March 3rd 2013, 6:42am

DIYCE.lua

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
-- DIY Combat Engine version 2.2

local g_skill  = {}
local g_lastaction = ""


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("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
DEFAULT_CHAT_FRAME:AddMessage("DIYCE.lua has loaded")


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, id = ID }
            -- We also list by ID in case two different buffs/debuffs have the same name.
            list[ID] = {stack = stackSize, time = timeRemaining, name = buff:gsub("(%()(.)(%))", "%2") }
        else
            break
        end
    end


    return list
end


function DebuffList(tgt)
    local list = {}
    local buffcmd = UnitDebuff
    local infocmd = UnitDebuffLeftTime


    if UnitCanAttack("player",tgt) then
        buffcmd = UnitBuff
        infocmd = UnitBuffLeftTime
    end


     -- There is a max of 100 buffs/debuffs per unit apparently
    for i = 1,100 do
        local debuff, _, stackSize, ID = debuffcmd(tgt, i)
        local timeRemaining = infocmd(tgt,i)
        if debuff then
            -- Ad to list by name
            list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining, id = ID }
            -- We also list by ID in case two different buffs/debuffs have the same name.
            list[ID] = {stack = stackSize, time = timeRemaining, name = debuff: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 CD(Skill[x].name) then
                if talktome then Msg("- "..Skill[x].name) end
                CastSpellByName(Skill[x].name)
                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


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


I think that the first

Source code

1
DEFAULT_CHAT_FRAME:AddMessage("DIYCE.lua has loaded")
is there by default, so I didn't add it to the end of it again

985

Friday, March 15th 2013, 6:40am

Curious, I have been away for a long time and used to use this tool... is there still good support for it as well as a script for an old KR?

986

Friday, March 15th 2013, 8:13am

Quoted from "ddoine;592885"

Curious, I have been away for a long time and used to use this tool... is there still good support for it as well as a script for an old KR?


Good support yes.

Script you'll have to make on your own.

Ravesden, D/S/Wd 80/75/62
Retired. Click siggy for old RoM vids, among other things.

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

987

Friday, March 15th 2013, 4:38pm

Still not working :/

I tried switching stuff around in the toc file to see if the Customfunctions would load, but still not getting anything.

Also not sure but, the auto swap equipment thing worked while I was in-game. idk if it was that because I was trying to switch my gear when it switched :P, but it shows maybe something was working

988

Friday, March 15th 2013, 10:06pm

Hello, I need some help with this Diyce code seem to not be working at all.

{ name = "Tactical Attack", use = ((EnergyBar1 >= 15) and (tbuffs['Bleed'] and tbuffs['Bleed'].stack >= 2)) },

So the idea behind this code is to use Tactical Attack when there is 2 or more Bleed on Boss but I'm not sure if it also reads other bleeds from other classes. Example, read bleed from Warrior and also bleed from other classes like Rogue and Scouts.

Thanks for your help
Skyomega = Warrior/Champion/Rogue 72/55/50 <Retire
Skylotus = Knight/Warrior/Scout 72/72/59 <Retire
luminousindigo.guildlaunch.com
[img][/img]

989

Friday, March 15th 2013, 10:21pm

go smack a mob with your bleeds and then check the ID#

Source code

1
/run for i=1,100 do local n,_,_,id=UnitDebuff("target",i) if n then DEFAULT_CHAT_FRAME:AddMessage(n.." = "..id) else break end end


then in you skill line just call by the ID

Source code

1
{ name = "Tactical Attack",                     use = ((EnergyBar1 >= 15) and (tbuffs[123456] and  tbuffs[123457].stack >= 2)) },


just make sure you dont put the "" around the ID like i did for several hours of debugging fail

990

Saturday, March 16th 2013, 3:41am

RoMunited, try removing evrything under the killsequence function except the targeting section...like this

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
function KillSequence(arg1)
--arg1 = "v1" or "v2" or for debugging

    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 _,_,_,_,RWB,_ = GetActionInfo( SlotRWB )
    local _,_,_,_,MNB,_ = GetActionInfo( SlotMNB )
    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
    local PsiPoints, PsiStatus = GetSoulPoint()
    local zoneid = (GetZoneID() % 1000)
    local SeigeWar = (zoneid == 402) -- The "Seige War" Zone
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )

    --Select Next Enemy
    if (tDead) then
        TargetUnit("")
        return
    end
    
    if SeigeWar then
        if (not LockedOn) or (not enemy) then
            for i=1,10 do
                if UnitIsPlayer("target") then
                    break
                end
                TargetNearestEnemy()
                return
            end
        end
    
    elseif (not SeigeWar) then
        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
end


Something like that. If that works, then you can start building from that. If that doesn't work then you have other issues we can take care of.

@skylotus - Yes, this addon keeps track of the bleeds from every class. What you need to do is research. As ghostwolf, I went into much detail on how to pick out which bleeds are which in both this thread and the original. Also, Peryl has given instruction on it in the past. I also believe Drake gave some info at some point in time as well. For a direction in which to aim your research, look for using buff/debuff ID numbers.

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

991

Saturday, March 16th 2013, 5:17am

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
local WHITE = "|cffffffff"
local SILVER = "|cffc0c0c0"
local GREEN = "|cff00ff00"
local LTBLUE = "|cffa0a0ff"




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




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,
        ['Rune Pulse']        = true,
        ['Dark Healing']    = true,
        ['Heavy Shelling']  = true,
        ['Cure']            = true,
        ['Earth Arrow']        = true,
        ['Advanced Rebirth'] = true,
        ['Rebirth']            = true,
        ['Supreme Rebirth'] = true,
        ['Resurrection']    = true,
        ['Group Heal']        = true,
        ['Snipe']            = true,
        ['Ancestral Fury']  = true,
                    }
    
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
end
                        
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(3) -- # 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
    local tgtName = UnitName("target") or ""
    local pdebuffs = DebuffList("player")
    local tdebuffs = DebuffList("target")
    local zone = GetZoneID() 
    local SiegeWar = (zoneid == 402) -- The "Siege War" Zone
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )
    
    --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
DEFAULT_CHAT_FRAME:AddMessage("CustomFunctions.lua has loaded")


This is what I have in my CustomFunctions now, still doesn't load

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

992

Saturday, March 16th 2013, 5:49am

My guess is that the problem does not lie in CustomFunctions.lua at all but instead in DIYCE.lua.

Put a second copy of that "DIYCE.lua has loaded" line to the very end of the file, like in CustomFunctions.lua. (you can change the text between the double quotes so that you know which line it is, BTW).

Now you should get two of those messages, if you don't you know the problem lies somewhere between those two lines (or you would indeed get the two lines). If this happens, and I expect it will, put a new copy of this text line between two function definitions and try again.

To speed things up a bit, you can just go ahead and put many of these messages between functions with specific text lines so that it is easier to know which lines they are, then try it out. The problem will lie somewhere between the last line that did get displayed and the next one that didn't.
2013... The year from hell....

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

993

Saturday, March 16th 2013, 5:50am

Both "DIYCE.lua has loaded" showed up

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

994

Saturday, March 16th 2013, 6:40am

Then everything has indeed loaded. Therefore, the macro must be incorrect or something else is interfering with DIYCE.
2013... The year from hell....

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

995

Saturday, March 16th 2013, 6:47am

Quoted from "Peryl;593074"

Then everything has indeed loaded. Therefore, the macro must be incorrect or something else is interfering with DIYCE.

KillSequence("","DPS")

I get two "DIYCE.lua has loaded" btw because "DIYCE.lua has loaded" is in the DIYCE.lua twice. "Customfunctions.lua has loaded" does not appear

996

Saturday, March 16th 2013, 4:43pm

Try this as your customfuinction.lua

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
local WHITE = "|cffffffff"
local SILVER = "|cffc0c0c0"
local GREEN = "|cff00ff00"
local LTBLUE = "|cffa0a0ff" 
                        
function KillSequence(arg1)
--arg1 = "v1" or "v2" for debugging

    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(3) -- # 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
    local tgtName = UnitName("target") or ""
    local pdebuffs = DebuffList("player")
    local tdebuffs = DebuffList("target")
    local zone = GetZoneID() 
    local SiegeWar = (zoneid == 402) -- The "Siege War" Zone
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )
    
    --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
DEFAULT_CHAT_FRAME:AddMessage("CustomFunctions.lua has loaded")

See if you can target anything with the macro being /run KillSequence("v1")



Also, 100 pages finally WOOHOO!

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

997

Saturday, March 16th 2013, 11:47pm

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




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,
        ['Rune Pulse']        = true,
        ['Dark Healing']    = true,
        ['Heavy Shelling']  = true,
        ['Cure']            = true,
        ['Earth Arrow']        = true,
        ['Advanced Rebirth'] = true,
        ['Rebirth']            = true,
        ['Supreme Rebirth'] = true,
        ['Resurrection']    = true,
        ['Group Heal']        = true,
        ['Snipe']            = true,
        ['Ancestral Fury']  = true,
                    }
    
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)



What you gave me worked :D so ^that^ would be where the problem is

It might have to do with me downloading the DIYCE.lua from the first post of this thread. I don't remember (shame on me) if I copied in an up-dated version, but that might be why these functions don't work. Peryl already checked my Customfunctions and said it looked fine so either he missed something or something is wrong with my DIYCE.lua code

Now I guess I'll slowly start to add stuff in to see what the problem is: My original CustomFunctions

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
local WHITE = "|cffffffff"local SILVER = "|cffc0c0c0"
local GREEN = "|cff00ff00"
local LTBLUE = "|cffa0a0ff"




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




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,
		['Rune Pulse']		= true,
		['Dark Healing']    = true,
		['Heavy Shelling']  = true,
		['Cure']			= true,
		['Earth Arrow']		= true,
		['Advanced Rebirth'] = true,
		['Rebirth']			= true,
		['Supreme Rebirth'] = true,
		['Resurrection']	= true,
		['Group Heal']		= true,
		['Snipe']			= true,
		['Ancestral Fury']  = true,
					}
	
	if (not MyCombat(Skill, arg1)) then
		MyCombat(Skill2, arg1)
end
						
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(3) -- # 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
	local tgtName = UnitName("target") or ""
	local pdebuffs = DebuffList("player")
	local tdebuffs = DebuffList("target")
	local zone = GetZoneID() 
	local SiegeWar = (zoneid == 402) -- The "Siege War" Zone
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )
	
	--Universal Immunes
	 if LockedOn and tdebuff['Fearless'] then
        DEFAULT_CHAT_FRAME:AddMessage("Target is Fearless, aborting DIYCE")
        return
    end
	--Magic Immunes
	local mImmuneList = {
		['Serenstum'] 	= true,


	}
	
	--Physical Immunes
	local pImmuneList = {
		['Rainbow Crystal Candy'] 	= true,


	}
	--Immune Logic
	local pimmune = tSpell and pImmuneList[tSpell]
	local mimmune = tSpell and mImmuneList[tSpell]
	
	--Magical Immune
	  if LockedOn and tSpell and mImmuneList[tSpell] then
	  DEFAULT_CHAT_FRAME:AddMessage("Target has Magical Immunity, aborting DIYCE")
	  return
	  end
	  
	 --Physical Immune
	  if LockedOn and tSpell and pImmuneList[tSpell] then
	  DEFAULT_CHAT_FRAME:AddMessage("Target has Physical Immunity, aborting DIYCE")
	  return
	  end


    --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 <= .5 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
		--Champion = Psyron, Warlock = Harpsyn
        
        -- Class: Champion/Rogue
            if mainClass == "PYSRON" and subClass == "THIEF" then
                local Shadowstab = GetActionUsable(3)
    
            --Potions and buffs
            Skill = {
					{ name = "Forge",                	use = (not pbuffs['Forge']) or (pbuffs['Forge'].time <= 45) },
                    }
            --Combat
                if enemy and (mode == "DPS") then
				
                Skill2 = {
                    { name = "Shield Form",				use = (phealth <= 0.10) and (not pbuffs['Shield Form']) },
					{ name = "Shield Form",				use = (phealth >= 0.20) and (pbuffs['Shield Form']) },
					{ name = "Remodled Body",			use = (phealth <= 0.075) and (pbuffs['Shield Form']) },
				--	{ name = "Overrule",  				use = pdebuffs[Tests with skill] and (EnergyBar1 >= 20) },
					{ name = "Electrocution",           use = (EnergyBar1 >= 20) and (silenceThis) }, 
					{ name = "Throw",					use = true },
					{ name = "Rune Growth",				use = true },
                    { name = "Rune Overload",			use = boss and (pbuffs['Death Arrives']) },
					{ name = "Heavy Bash",   			use = (EnergyBar1 >= 20) and (tbuffs[621616]) and ((not tbuffs['Heavy Bash']) or (tbuffs['Heavy Bash'].stack < 3)) },
					{ name = "Rune Pulse",              use = tgtName == "Kulech Inspector" or tgtName == "Kulech Patrol" or tgtName == "Kulech Corpse Carrier" or tgtName == "Kulech Bandit" or tgtName == "Kulech Lookout" or(boss and pbuffs['Chain Drive']) },
					{ name = "Shadowstab",				use = (EnergyBar2 >= 20) },
					{ name = "Attack",					use = (thealth == 1) },
                            }
				elseif enemy and (mode == "farm") then
				Skill2 = {
					{ name = "Shadowstab",				use = (EnergyBar2 >= 20) },
							}
				elseif enemy and (mode == "tank") and pbuffs['Shield Form'] then
				Skill2 = {
					{ name = "Remodled Body",			use = (phealth <= 0.1) }, 
					{ name = "Smoke Diffusion",			use = false },
					{ name = "Rune Overload",			use = boss and (pbuffs['Death Arrives']) },
					{ name = "Electrocution",           use = (EnergyBar1 >= 20) and (silenceThis) },
					{ name = "Rune Energy Influx",		use = (EnergyBar1 >= 10) and boss },
					{ name = "Shock Strike",			use = (EnergyBar1 >= 25) },
					{ name = "Heavy Bash",   			use = (EnergyBar1 >= 20) and (tbuffs[621616]) and ((not tbuffs['Heavy Bash']) or (tbuffs['Heavy Bash'].stack < 3)) },
					{ name = "Rune Pulse",              use = tgtName == "Kulech Inspector" or tgtName == "Kulech Patrol" or tgtName == "Kulech Corpse Carrier" or tgtName == "Kulech Bandit" or tgtName == "Kulech Lookout" or(boss and pbuffs['Chain Drive']) },
					{ name = "Shadowstab",				use = (EnergyBar2 >= 20) },
                    { name = "Throw",					use = true },
					{ name = "Attack",					use = (thealth == 1) },
							}
	
                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
DEFAULT_CHAT_FRAME:AddMessage("CustomFunctions.lua has loaded")

RoMunited

Professional

Posts: 889

Location: Reni

  • Send private message

998

Sunday, March 17th 2013, 12:17am

The following doesn't have to do much with my problem, but I have questions about it :P

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
--Universal Immunes    
 if LockedOn and tdebuff['Fearless'] then
        DEFAULT_CHAT_FRAME:AddMessage("Target is Fearless, aborting DIYCE")
        return
    end
    --Magic Immunes
    local mImmuneList = {
        ['Serenstum']     = true,


    }
    
    --Physical Immunes
    local pImmuneList = {
        ['Rainbow Crystal Candy']     = true,


    }
    --Immune Logic
    local pimmune = tSpell and pImmuneList[tSpell]
    local mimmune = tSpell and mImmuneList[tSpell]
    
    --Magical Immune
      if LockedOn and tSpell and mImmuneList[tSpell] then
      DEFAULT_CHAT_FRAME:AddMessage("Target has Magical Immunity, aborting DIYCE")
      return
      end
      
     --Physical Immune
      if LockedOn and tSpell and pImmuneList[tSpell] then
      DEFAULT_CHAT_FRAME:AddMessage("Target has Physical Immunity, aborting DIYCE")
      return
      end


^^ Should that work?

Physical and Magical Immune Lists so that you don't waste your time/mana on someone who is immuned :P Just add the mImmuneList/pImmuneList to the necessary skill lines

I don't want to try to have something that will tell you the total amount of time left :P. Smartbb with buff filters should be more than enough :P

Am I using tSpell correctly?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

999

Sunday, March 17th 2013, 5:40am

Quoted from "RoMunited;593127"

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




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

You have DIYCE_DebugBuffList in there twice, though that shouldn't actually be a problem. I can't see anything else there that would be problematic.
2013... The year from hell....

1,000

Tuesday, March 19th 2013, 2:47pm

Rogue/Champion and DIYCE:

I have been trying to program the mechanism elite skills into a rotation for leveling my secondary. I can't seem to get them to work and it would help with keeping the nerve gear buff up. The 5 sec buff timer on nerve gear is brutal, I am not even sure it is possible to keep it rolling.

Quoted

--Class: Rogue/Champion
elseif mainClass == "THIEF" and subClass == "PSYRON" then

--Potions and Buffs
Skill = {
{ name = "Poison", use = (not combat) and (not pbuffs['Poisonous']) },
}

--Combat
if enemy then
Skill2 = {
{ name = "Stepping Mechanism", use = (CD("Stepping Mechanism")) and (EnergyBar1 >= 25) and melee },
{ name = "Burying Mechanism", use = (CD("Burying Mechanism")) and (EnergyBar1 >= 25) and melee },
{ name = "Foot Mechanism", use = (CD("Foot Mechanism")) and (EnergyBar2 >= 20) and melee },
{ name = "Electrocution Mechanism", use = (CD("Electrocution Mechanism")) and (EnergyBar2 >= 20) and melee },
{ name = "Shadowstab", use = (EnergyBar1 >= 25) and melee },
{ name = "Heavy Bash", use = (EnergyBar2 > 35) and melee },
{ name = "Attack", use = (thealth == 1) },
}
end


Anyone have a kill squence for this that is tested and working? If not rogue/champion then are any rogue/mage having issues with elites and DIYCE?

Fixed