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.

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

321

Wednesday, January 4th 2012, 4:22pm

Quoted from "Chucknrz;498910"

i gave it a shot, still getting error on 220 near if, dunno what to do with that lol.


Install notepad++ as Ghostwolf suggested in the OP and try to solve the problem occurring at line 220+.

322

Saturday, January 7th 2012, 9:54am

Can help me. I can't get the ingame /run KillSequence() macro to work??
Im clicking it but nothing happens im a ROGUE/SCOUT this is my custom file :-

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
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 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, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--healthpot = # of actionbar slot for health potions
--manapot = # of actionbar slot for mana potions
--foodslot = # of actionbar slot for food (add more args for more foodslots if needed)
    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local EnergyBar1 = UnitMana("player")
    local EnergyBar2 = UnitSkill("player")
    local pctEB1 = PctM("player")
    local pctEB2 = PctS("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    local behind = (not UnitIsUnit("player", "targettarget"))
    local melee = GetActionUsable(13) -- # is your melee range spell slot number
    local 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: 
            if mainClass == "THIEF" and subClass == "RANGER" then
            
            Skill = {
                { name = "Combat Master",                   use = ((not pbuffs['Combat Master')) }
                { name = 'Action: 62',                      use = ((not pbuffs['Yawaka's Blessing')) }
                { name = 'Action: 69',                      use = ((not pbuffs['Unbridled Enthusiasm')) } -- Speed Potion
                { name = 'Poison',                          use = ((not pbuffs['Poisonous']) or (pbuffs['Poisonous'].time <= 45)) },
                    }
                    
            if enemy then
            Skill2 = {
                { name = "Wound Attack",                    use = (EnergyBar1 >= 35 and (tbuffs[620313] and tbuffs[500704])) },
                { name = "Blind Spot",                      use = (EnergyBar1 >= 20) and boss and behind and (pbuffs['Energy Thief'] or pbuffs['Premeditation']) },
                { name = "Shadowstab",                      use = (EnergyBar1 >= 20) and (not tbuffs[620313]) },
                { name = "Low Blow",                        use = (EnergyBar1 >= 25) and (tbuffs[620313]) and ((not tbuffs[500704]) or pbuffs['Energy Thief']) },
                { name = "Vampire Arrows",                  use = (not EnergyBar1 >= 20) },
                { name = "Shot",                            use = (not EnergyBar1 >= 20) },
                    }
            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

323

Saturday, January 7th 2012, 1:19pm

also i've removed the old diye maro version 1.0 and replaed it with this one and still dosnt work help.........

324

Sunday, January 8th 2012, 2:58am

any help would be great, cannot get this to work - this is my CustomFunctions.lua .

I cannot get the s/wd diyce to work and am using /run KillSequence() in game.

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 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, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--healthpot = # of actionbar slot for health potions
--manapot = # of actionbar slot for mana potions
--foodslot = # of actionbar slot for food (add more args for more foodslots if needed)

local Skill = {}
local Skill2 = {}
local i = 0

-- Player and target status.
local combat = GetPlayerCombatState()
local enemy = UnitCanAttack("player","target")
local EnergyBar1 = UnitMana("player")
local EnergyBar2 = UnitSkill("player")
local pctEB1 = PctM("player")
local pctEB2 = PctS("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local tDead = UnitIsDeadOrGhost("target")
local behind = (not UnitIsUnit("player", "targettarget"))
local melee = GetActionUsable(13) -- # is your melee range spell slot number
local a1,a2,a3,a4,a5,ASon = GetActionInfo(1) -- # 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/Warden
if mainClass == "RANGER" and subClass == "WARDEN" then

--Potions and Buffs
Skill = {
{ name = "Frost Arrow", use = (not pbuffs("Frost Arrow")) },
{ name = "Briar Shield", use = (not pbuffs("Briar Shield")) },
{ name = "Entling Offering", use = (not pbuffs("Entling Offering")) },
--Combat & PVE
if enemy and (mode == "PvE") then
Skill2 = {
{ name = "Snipe", use = (pbuffs("Hidden Peril")) },
{ name = "Combo Shot", use = (CD("Combo Shot")) },
{ name = "Autoshot", use = (not ASon) },
{ 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 = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Wind Arrows", use = ((CD("Wind Arrows")) and (EnergyBar1 >= 55)) },
{ name = "Shoot", use = (CD("Shoot")) },
}
--Combat & PVP
elseif enemy and (mode == "PvP") then
Skill2 = {
{ name = "Detection", use = (not pbuffs("Detection")) },
{ name = "Snipe", use = (pbuffs("Hidden Peril")) },
{ name = "Autoshot", use = (not ASon) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Vampire Arrows", use = (CD("Vampire Arrows")) },
{ name = "Thorn Arrow", use = (CD("Torn Arrow")) },
{ name = "Hidden Peril", use = (CD("Hidden Peril") and (EnergyBar1 >= 30)) },
{ name = "Combo Shot", use = (CD("Combo Shot")) },
{ name = "Wind Arrows", use = ((CD("Wind Arrows")) and (EnergyBar1 >= 35)) },
}
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
Wasko
Server: Osha
Guild: Greed2Sell
Class(s): S/Wd/W 67/50/62

326

Sunday, January 8th 2012, 9:10am

Quoted from "billswin;500077"

any help would be great, cannot get this to work - this is my CustomFunctions.lua .

I cannot get the s/wd diyce to work and am using /run KillSequence() in game.




From what I can see (you didn't wrap your code in tags so it is hard to read) you need to change your macro depending on if you want PvE or PvP like:

Source code

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

and

Source code

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


Also any error messages would have been helpful.

~wurm

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

327

Sunday, January 8th 2012, 10:44am

@fammyone,
I can't see anything wrong.

I suggest you grab my macro and try it to see if it works.

328

Sunday, January 8th 2012, 2:09pm

@billswin:
You could also do a local definition of PVP like this

Source code

1
2
 local zone = GetZoneID() 
 local pvp = zone == 402 -- Siege Wars

329

Monday, January 9th 2012, 1:19am

Quoted from "mrmisterwaa;500137"

@fammyone,
I can't see anything wrong.

I suggest you grab my macro and try it to see if it works.


I have no clue, I downloaded your diyce.lua and customfunctions.lua and cannot get it to work in game granted I am a s/wd but it should still work you would think or try.

my in game macro was /run KillSequence ("2"), but I tried everything I can think of, seems alot more complicated than the old diyce.
Wasko
Server: Osha
Guild: Greed2Sell
Class(s): S/Wd/W 67/50/62

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

330

Monday, January 9th 2012, 1:32am

Quoted from "billswin;500287"

I have no clue, I downloaded your diyce.lua and customfunctions.lua and cannot get it to work in game granted I am a s/wd but it should still work you would think or try.

my in game macro was /run KillSequence ("2"), but I tried everything I can think of, seems alot more complicated than the old diyce.


A little more complicated, but not much.

I noticed one problem that should have been giving you an error.

Your use of pbuffs and tbuffs is incorrect, pbuffs and tbuffs are tables and as such you must access the entries using square brackets, not parentheses. For example, this:

Source code

1
{ name = "Frost Arrow", use = (not pbuffs("Frost Arrow")) },

should be:

Source code

1
{ name = "Frost Arrow", use = (not pbuffs[highlight][[/highlight]"Frost Arrow"[highlight]][/highlight]) },

Change the rest of the code anywhere you use pbuffs and tbuffs.
2013... The year from hell....

331

Monday, January 9th 2012, 2:21am

I changed the pbuffs with the [] tags still won't work, when I use the macro in-game it selects the nearest target but thats as far as I can go.

How do I see errors in the game I don't see an option near the minimap as described maybe that will help.
Wasko
Server: Osha
Guild: Greed2Sell
Class(s): S/Wd/W 67/50/62

332

Monday, January 9th 2012, 4:04am

OMG.... OCD going nuts! Unformatted code... WITH ERRORS!! And (Gasp!) redundancies! Must... resist... re-writing... /fail

@billswin, here's the correct version.

Macro for PvE:

Source code

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


Macro for PvP:

Source code

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


CustomFunctions.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
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(1) -- # 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/Warden
    if mainClass == "RANGER" and subClass == "WARDEN" then

        --Potions and Buffs
        Skill = {
            { name = "Frost Arrow",                use = (not pbuffs['Frost Arrow']) },
            { name = "Briar Shield",               use = (not pbuffs['Briar Shield']) },
            { name = "Entling Offering",           use = (not pbuffs['Entling Offering']) },
        }
        
        --Combat & PVE
        if enemy and (mode == "PvE") then
            Skill2 = {
                { name = "Snipe",                  use = (pbuffs['Hidden Peril']) },
                { name = "Combo Shot",             use = (true) },
                { name = "Autoshot",               use = (not ASon) },
                { name = "Vampire Arrows",         use = (EnergyBar1 >= 30) },
                { name = "Thorn Arrow",            use = (true) },
                { name = "Hidden Peril",           use = (EnergyBar1 >= 30) },
                { name = "Reflected Shot",         use = (true) }, 
                { name = "Piercing Arrow",         use = (true) }, 
                { name = "Wind Arrows",            use = (EnergyBar1 >= 55) }, 
                { name = "Shoot",                  use = (true) },
            }

        --Combat & PVP
        elseif enemy and (mode == "PvP") then
            Skill2 = {
                { name = "Detection",              use = (not pbuffs['Detection']) },
                { name = "Snipe",                  use = (pbuffs['Hidden Peril']) },
                { name = "Autoshot",               use = (not ASon) },
                { name = "Piercing Arrow",         use = (true) },
                { name = "Reflected Shot",         use = (true) }, 
                { name = "Vampire Arrows",         use = (true) }, 
                { name = "Thorn Arrow",            use = (true) },
                { name = "Hidden Peril",           use = (EnergyBar1 >= 30) },
                { name = "Combo Shot",             use = (true) },
                { name = "Wind Arrows",            use = (EnergyBar1 >= 35) },
            }
        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


Make sure that you have a melee range skill in slot 13 and Autoshot in slot 1. (OR change the slot numbers)

I highly recommend that you read the full original DIYCE thread (yes all 190ish pages) and the new DIYCE thread too. Also, get Notepad++. It helps immensely. BTW, I have not loaded this up in the game yet. If you have any trouble with it, I will.

I'm not going to go over everything that I fixed. Just do a compare and contrast of the two files. I took out a large section that was irrelevant to your class (Priest fairy function), corrected syntax issues, and formatted the code. This CustomFunctions.lua should provide you a good starting point for future code exploration. :)

Good Luck and Happy coding!

EDIT: You'll probably want to add code for potions, foods, deserts, additional skills, more class combos, etc. Just take it slow and keep LOTS of backups.

333

Monday, January 9th 2012, 8:42pm

Hi, i need a little help from you dyice masters :)
My problem is that i can't get it to trigger for some reason. I tried with /run KillSequence() macro.
Also i'm not sure if i wrote correctly: should it be EnergyBar1 and RageBar1 or energy and rage?
Can someone please take a bit of their time and help a noob? :)

Thx in advance

This is my custom lua. Also in my opinion this should be the correct w/r rotation (if i wrote the skill names and stuff correctly ofc).

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
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 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, mode, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--healthpot = # of actionbar slot for health potions
--manapot = # of actionbar slot for mana potions
--foodslot = # of actionbar slot for food (add more args for more foodslots if needed)

    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local EnergyBar1 = UnitMana("player")
    local EnergyBar2 = UnitSkill("player")
    local pctEB1 = PctM("player")
    local pctEB2 = PctS("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    local behind = (not UnitIsUnit("player", "targettarget"))
    local melee = GetActionUsable(13) -- # is your melee range spell slot number
    local 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: WARRIOR/THIEF
            if mainClass == "WARRIOR" and subClass == "THIEF" then
      
            --Combat
            if enemy then
            Skill2 = {
                { name = "Survival Instinct",        use = (phealth <= .30) }, 
                { name = "Enraged",                    use = (EnergyBar1 <= 30) and (boss or elite) },				
                { name = "Splitting Chop",            use = (RageBar1 >= 15) and (tbuffs['Weakened']) },
		{ name = "Blood Dance",                use = (phealth >= .40) },
                { name = "Open Flank",                use = (RageBar1 >= 10) and (tbuffs['Vulnerable']) and CD("Splitting Chop") },
                { name = "Keen Attack",                use = (EnergyBar1 >= 20) and (tbuffs['Vulnerable']) },
                { name = "Probing Attack",            use = (RageBar1 >= 15) },
                { name = "Slash",                    use = (RageBar1 >= 25) },
                { name = "Shadowstab",                use = (EnergyBar1 >= 20) },
                     }
            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

334

Tuesday, January 10th 2012, 1:20pm

Quoted from "mrmisterwaa;499181"

Install notepad++ as Ghostwolf suggested in the OP and try to solve the problem occurring at line 220+.


i do have notepad++. but problem is i dont know what to do with line 220, i have tried jtanner's codes also but it only casts frost arrow and thats it, nothing else.

335

Tuesday, January 10th 2012, 2:13pm

OK, I'll load it up in-game and test it out later on this evening. I could have made a mistake.

336

Wednesday, January 11th 2012, 5:20pm

/run KillSequence("","3")
/run KillSequence("","0")

those are the macros i have made to call the buff sequences i have below. i do not get any error messages when i call the functions, i get nothing at all.

all i want to use this addon for is buffing after death in sw, and buffing quickly before combat in sw. please help, thanks

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
local silenceList = {
        ['Annihilation'] = true,
        ['King Bug Shock'] = true,
        ['Mana Rift'] = true,
        ['Dream of Gold'] = true,
        ['Flame'] = true,
        ['Flame Spell'] = true,
        ['Wave Bomb'] = true,
        ['Silence'] = true,
        ['Recover'] = true,
        ['Restore Life'] = true,
        ['Heal'] = true,
        ['Curing Shot'] = true,
        ['Dark Healing'] = true,
        ['Leaves of Fire'] = true,
        ['Urgent Heal'] = true,
                        }    


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

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

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

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

337

Wednesday, January 11th 2012, 6:08pm

i figured it out. i was using mrmisterwaa's customfunctions.lua but i didnt use his DIYCE.lua.

works great. awesome addon.

338

Wednesday, January 11th 2012, 6:23pm

ok, im sorry to flood this thread with my posts, but here is mycustomfunctions taken from mrmisterwaa. i changed 2 of the sequences to suit my needs, but i cant get unknown choice to fire, and i cant get my hero pot and unicorn pots to fire if i dont have any of the pots listed before them in my inventory. its like the addon sees that it cant use a pot and quits. im not sure if that is actually the case. i will switch my pots around and mess with the code to see what the problem is. i suspect the problem lies with the coding in using pots.

Edit: when trying to fire the buffs (the one with unknown choice) i get this error: call ChatFrameChannelChange's on event line: [string '?']:393: attempt to index global 'g_ChannelChangeConfig' (a nil value)

Edit: I did some more testing by moving the hero pot line to fire right after combat master (since i have those in my inventory) and it still did not fire. (unknown choice still doesnt work, but i cleaned the code up a bit and i dont get the error anymore.). so obviously the problem is in the coding i used to fire potions. can someone tell me why my pots wont fire? also, i still need help with unknown choice. thanks.

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
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 = "Poison",                      use = ((not pbuffs['Poisonous'])) },
               { name = "Combat Master",                      use = ((not pbuffs['Combat Master'])) },
               { name = "Action: 83 (Galloping Gale)",        use = ((not pbuffs['Galloping Gale'])) },
               { name = "Action: 84 (Unbridled Enthusiam)",   use = ((not pbuffs['Unbridled Enthusiasm'])) },
               { name = "Action: 85 (Scarlet Love)",          use = ((not pbuffs['Scarlet Love'])) },
               { name = "Action: 86 (Hero Potion)",              use = ((not pbuffs['Hero Potion'])) },
               { name = "Action: 87 (Touch of the Unicorn)",  use = ((not pbuffs['Touch of the Unicorn'])) },
                     }
            elseif (goat2 == "3") then
            Skill =  {
               { name = "Informer",                            use = ((not pbuffs['Informer'])) },
               { name = "Action: 91 (Unknown Choice)",         use = ((not pbuffs['Unknown Choice'])) },
               { name = "Fervent Attack",                      use = ((not pbuffs['Fervent Attack'])) },
               { name = "Evasion",                             use = ((not pbuffs['Evasion'])) },
               { name = "Assassins Rage",                      use = ((not pbuffs['Assassins Rage'])) },
                     }
            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

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

339

Thursday, January 12th 2012, 12:44am

Quoted from "undefind;500994"

... i cant get unknown choice to fire, and i cant get my hero pot and unicorn pots to fire if i dont have any of the pots listed before them in my inventory.
...
i suspect the problem lies with the coding in using pots.

Sort of, the problem lies with how you are using the Action: DIYCE command.
Taking your "Unknown Choice" line as an example, you currently have this:

Source code

1
{ name = "Action: [highlight]91[/highlight] (Unknown Choice)",         use = ((not pbuffs['Unknown Choice'])) },

The problem is the number you are providing (highlighted in red above). This must be the action bar slot number that contains the buff/spell/whatever you wish to use. Valid values are from 1 to 80, where there are 20 slots per action bar, and a maximum of four bars split as follows:
  • Main action bar (1-20)
  • Upper action bar (21-40)
  • Right action bar (41-60)
  • Left action bar (61-80)

The slots are numbers left to right, top to bottom. Upper bar is the bar immediately above the bottom most (first/main) action bar, the right bar is the vertical action bar that normally shows up on the right side of the screen, the left action bar is the vertical bar that appears immediately to the left of the Right action bar (left and right bars are hidden by default).

Quoted from "undefind;500994"

Edit: when trying to fire the buffs (the one with unknown choice) i get this error: call ChatFrameChannelChange's on event line: [string '?']:393: attempt to index global 'g_ChannelChangeConfig' (a nil value)

Edit: I did some more testing by moving the hero pot line to fire right after combat master (since i have those in my inventory) and it still did not fire. (unknown choice still doesnt work, but i cleaned the code up a bit and i dont get the error anymore.). so obviously the problem is in the coding i used to fire potions. can someone tell me why my pots wont fire? also, i still need help with unknown choice. thanks.

Not sure why you would be getting that error, but it does raise a few interesting questions.
2013... The year from hell....

340

Thursday, January 12th 2012, 1:49am

Quoted from "Peryl;501077"

Sort of, the problem lies with how you are using the Action: DIYCE command.
Taking your "Unknown Choice" line as an example, you currently have this:

Source code

1
{ name = "Action: [highlight]91[/highlight] (Unknown Choice)",         use = ((not pbuffs['Unknown Choice'])) },
The problem is the number you are providing (highlighted in red above). This must be the action bar slot number that contains the buff/spell/whatever you wish to use. Valid values are from 1 to 80, where there are 20 slots per action bar, and a maximum of four bars split as follows:
  • Main action bar (1-20)
  • Upper action bar (21-40)
  • Right action bar (41-60)
  • Left action bar (61-80)

The slots are numbers left to right, top to bottom. Upper bar is the bar immediately above the bottom most (first/main) action bar, the right bar is the vertical action bar that normally shows up on the right side of the screen, the left action bar is the vertical bar that appears immediately to the left of the Right action bar (left and right bars are hidden by default).


Not sure why you would be getting that error, but it does raise a few interesting questions.


awesome, it worked. im such an idiot. when i counted the bars i counted by 20's. when i got to the right action bar, i had reached 80 and started counting up from there (i thought the right action bar was 80-100).

thanks again.

also, im not exactly sure why i got the chat frame error, but i suspect it had something to do with the fact that my code was missing some brackets or i failed to close a function near the end of the script.