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.

Auros

Professional

Posts: 1,360

Mood: Mellow

  • Send private message

641

Sunday, May 27th 2012, 6:07pm

From the lack of comments, maybe I am the only one. But after teh last patch, I could no longer get in the game. Finally figured out the problem and it was DIYCE. By removing the diyce folder from my add-on folder I was able to get back in the game. If I put it back in, I crash out on loading.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
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: WARRIOR/MAGE
if mainClass == "WARRIOR" and subClass == "MAGE" then
local SurpriseAttack = GetActionUsable(14)

--Potions and Buffs
Skill = {
{ name = "Action: "..healthpot, use = (phealth <= .70) },
{ name = "Survival Instinct", use = (phealth <= .30) and combat },
{ name = "Sense of Danger", use = (phealth <= .30) and combat },
{ name = "Action: "..manapot, use = (pctEB2 <= .40) },
{ name = "Action: "..Healslot, use = (phealth < .70) and (not combat) and (not party) },
{ name = "Action: "..HoTslot, use = (phealth < .80) and (not party) },
{ name = "Intensification", use = (pctEB2 >= .05) and (not pbuffs['Intensification']) and boss and enemy },
{ name = "Aggressiveness", use = boss and enemy },
{ name = "Electric Attack", use = (pctEB2 >= .05) and ((not pbuffs['Electric Attack']) or (pbuffs['Electric Attack'].time <= 45)) },
}
--Combat
if enemy then
Skill2 = {
{ name = "Silence", use = (silenceThis) },
{ name = "Surprise Attack", use = SurpriseAttack },
{ name = "Enraged", use = (EnergyBar1 <= 30) and (boss or elite) },
{ name = "Electrical Rage", use = (EnergyBar1 >= 15) and (pctEB2 >=.05) and (not pbuffs['High Voltage III']) },
{ name = "Thunder Sword", use = (pctEB2 >= .05) },
{ name = "Lightning's Touch", use = (pctEB2 >= .05) },
{ name = "Attack", use = (thealth == 1) },
}
end
--Class: Rogue/Priest
elseif mainClass == "THIEF" and subClass == "AUGUR" then

--Potions and Buffs
Skill = {
{ name = "Regenerate", use = (phealth <= .90) and (pctEB2 >= .05) and (not pbuffs['Regenerate']) },
{ name = "Action: "..healthpot, use = (phealth <= .70) },
{ name = "Action: "..manapot, use = (pctEB2 <= .40) },
{ name = "Magic Barrier", use = (pctEB2 >= .05) and ((not pbuffs['Magic Barrier']) or (pbuffs['Magic Barrier'].time <= 45)) },
{ name = "Quickness Aura", use = (pctEB2 >= .05) and ((not pbuffs['Quickness Aura']) or (pbuffs['Quickness Aura'].time <= 45)) },
{ name = "Poison", use = ((not pbuffs['Poisonous']) or (pbuffs['Poisonous'].time <= 45))},
}
--Combat
if enemy then
Skill2 = {
{ name = "Premeditation", use = (not combat) and boss and (EnergyBar1 >= 50) },
{ name = "Slowing Poison", use = boss },
{ name = "Informer", use = boss },
{ name = "Fervent Attack", use = boss },
{ name = "Assassins Rage", use = boss },
{ name = "Kick", use = (pctEB2 >= .05) },
{ name = "Sneak Attack", use = (EnergyBar1 >= 20) and boss and behind and party },
{ name = "Blind Spot Attack", use = (EnergyBar1 >= 20) and boss and behind and party },
{ name = "Shadowstab", use = (EnergyBar1 >= 20) and (not tbuffs[620313]) },
{ name = "Low Blow", use = (EnergyBar1 >= 30) and (tbuffs[620313]) and (not tbuffs[500704]) },
{ name = "Wound Attack", use = (EnergyBar1 >= 35) },
{ name = "Shadowstab", use = (EnergyBar1 >= 20) },
{ name = "Attack", use = (thealth == 1) }, 
}
end

-- Class: Knight/Priest
elseif mainClass == "KNIGHT" and subClass == "AUGUR" then
--Potions and Buffs
Skill = {
{ name = "Action: "..healthpot, use = (phealth <= .40) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .40)) }, -- only mana pot if decent health
{ name = "Magic Barrier", use = (pctEB1 >= .05 and (not pbuffs['Magic Barrier'])) },
{ name = "Holy Seal", use = (pctEB1 >= .05 and (not pbuffs['Holy Seal'])) },
{ name = "Enhanced Armor", use = (pctEB1 >= .05 and (not pbuffs['Enhanced Armor'])) },
{ name = "Blessed Spring Water", use = (pctEB1 >= .05 and (not pbuffs['Blessed Spring Water'])) },
-- Heals
{ name = "Holy Shield", use = (phealth <= .20) },
{ name = "Holy Illumination", use = (combat and (phealth <= .75) and (not pbuffs['Holy Illumination'])) },
{ name = "Holy Aura", use = (phealth <= .30) },
{ name = "Resolution", use = (combat and (phealth <= .65)) },
{ name = "Urgent Heal", use = (phealth <= .65) },
{ name = "Regenerate", use = ((phealth <= .90) and (not pbuffs['Regenerate'])) },
}
-- Combat
if enemy then
Skill2 = {
{ name = "Shield of Valor", use = ((phealth <= .8) and shield) },
{ name = "Shield of Discipline", use = (silenceThis and shield) },
{ name = "Shield of Atonement", use = (combat and shield and (not tbuffs['Restrained'])) },
{ name = "Rising Tide", use = (not melee and (thealth >= .99)) }, -- To Pull with
{ name = "Mana Return", use = (tbuffs['Holy Seals 3']) and (pctEB1 <= .70) },
{ name = "Threaten", use = (tbuffs['Holy Seals 3']) and (not tbuffs['Threaten']) },
{ name = "Hatred Strike", use = (combat and party) },-- Agro Multiplier if in party only
{ name = "Disarmament", use = ((UnitLevel("target") >= (UnitLevel("player") - 10)) and (boss or elite) and ((not tbuffs['Disarmament IV']) or (tbuffs['Disarmament IV'].time <= 3))) }, -- stack to 4
{ name = "Whirlwind Shield", use = (shield and pctEB1 >= .2 ) },
{ name = "Charge", use = (combat and (tspell ~= nil)) or (not melee and not tbuffs['Charge']) }, -- charge spellcasters
{ name = "Holy Light's Fury", use = (pctEB1 >= .2 ) and not tbuffs['Holy Light's Fury'] }, -- Knight/Priest 15 Elite
{ name = "Holy Smite", use = (pctEB1 >= .2 ) and tbuffs['Holy Light's Fury'] }, -- Knight/Priest 20 Elite
{ name = "Holy Strike", use = (pctEB1 >= .2 ) and not tbuffs['Light Seal III'] },
{ name = "Punishment", use = (tbuffs['Light Seal III']) },
}
end

-- Class: Druid/Mage
elseif mainClass == "DRUID" and subClass == "MAGE" then
-- Silence
Skill = {
{ name = "Silence", use = (silenceThis) },
-- Potions
{ name = "Action: "..healthpot, use = (phealth <= .40) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .40)) }, -- only mana pot if decent health
-- Heals
{ name = "Mother Earth's Protection", use = (phealth <= .30) },
{ name = "Recover", use = (phealth <= .40) },
{ name = "Curing Seed", use = (phealth <= .50) },
{ name = "Restore Life", use = ((phealth <= .60) and (pbuffs['Nature's Power'].stack <=2))}, -- use this ahead of Recover if low on Natures Power
{ name = "Recover", use = ((phealth <= .60) and (not pbuffs['Recover'])) },
{ name = "Antidote", use = (pbuffs['Poisoned']) },
{ name = "Purify", use = (pbuffs['Curse']) },
{ name = "Blossoming Life", use = ((phealth <= .80) and (not pbuffs['Blossoming Life'])) },
{ name = "Blossoming Life", use = ((phealth <= .90) and not combat) },
-- Buffs
{ name = "Savage Blessing", use = (not pbuffs['Savage Blessing']) },
{ name = "Concentration Prayer", use = (not pbuffs['Concentration Prayer']) },
{ name = "Fire Ward", use = (not pbuffs['Fire Ward']) },
{ name = "Intensification", use = (enemy and not pbuffs['Intensification']) },
}
-- Ranged Attack
if enemy then
Skill2 = {
{ name = "Binding Silence", use = (tspell ~= nil and ttime >= 1 and (ttime - telapsed) > 0.5 and pctEB1 >= .05) },
{ name = "Mother Nature's Wrath", use = (true) },
{ name = "Fireball", use = (combat) },
{ name = "Earth Pulse", use = (combat) },
{ name = "Weakening Seed", use = ((boss or elite) and (not tbuffs['Weakening Seed']) and (pbuffs['Nature's Power'].stack >= 3)) },
{ name = "Lightning", use = (not tbuffs['Lightning']) },
{ name = "Rockslide", use = (true) },
{ name = "Earth Arrow", use = (true) },
{ name = "Briar Entwinement", use = (not tbuffs['Briar Entwinement'] or BuffTimeLeft("target", "Briar Entwinement") <=2) },
}
end

--Class: Rogue/Mage

elseif mainClass == "THIEF" and subClass == "MAGE" then

-- Silence
Skill = {
{ name = "Silence", use = (silenceThis) },
-- Potions
{ name = "Action: "..healthpot, use = (phealth <= .50) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .50)) }, -- only mana pot if decent health 
-- Buffs
{ name = "Poison", use = ((not pbuffs['Poisonous']) or (pbuffs['Poisonous'].time <= 45))},
{ name = "Intensification", use = ((boss or elite) and not pbuffs['Intensification']) },
{ name = "Evasion", use = ((boss or elite) and not pbuffs['Evasion']) },
{ name = "Create Opportunity", use = ((boss or elite) and not pbuffs['Create Opportunity']) },
}
--Combat
if enemy then
Skill2 = {
{ name = "Premeditation", use = (not combat) and boss and (EnergyBar1 >= 50) },
{ name = "Vanish", use = combat and (phealth <= .20) },
{ name = "Informer", use = boss },
{ name = "Fervent Attack", use = boss },
{ name = "Assassins Rage", use = boss },
{ name = "Shadow Step", use = (not combat) and (EnergyBar1 >= 50) },
{ name = "Sneak Attack", use = (not combat) and (boss or elite) and (EnergyBar1 >= 20) and behind },
--{ name = "Sneak Attack", use = (EnergyBar1 >= 20) and boss and behind and party },
{ name = "Blind Spot", use = (EnergyBar1 >= 20) and behind },
{ name = "Magic Breaker", use = (boss or elite) }, 
{ name = "Fireball", use = (true) },
{ name = "Lightning", use = (not tbuffs['Lightning']) }, 
{ name = "Poison Flame", use = (not tbuffs['Poison Flame']) }, 
{ name = "Paralyzing Trap", use = (true) },
{ name = "Shadowstab", use = (EnergyBar1 >= 20) and (not tbuffs[620313]) },
{ name = "Low Blow", use = (EnergyBar1 >= 30) and (tbuffs[620313]) and (not tbuffs[500704]) },
{ name = "Wound Attack", use = (EnergyBar1 >= 35) },
--{ name = "Combo Throw", use = (true) },
--{ name = "Throw", use = (true) },
{ name = "Shadowstab", use = (EnergyBar1 >= 20) },
{ name = "Attack", use = (thealth == 1) },
}
end
-- Class: Mage/Rogue
elseif mainClass == "MAGE" and subClass == "THIEF" then
-- Silence
Skill = {
{ name = "Silence", use = (silenceThis) },
-- Potions
{ name = "Action: 48", use = (phealth <= .50) },
{ name = "Action: 49", use = ((pctEB1 <= .50) and (phealth >= .50)) }, -- only mana pot if decent health
-- Buffs
{ name = "Fang Ritual", use = (not pbuffs['Fang Ritual']) },
{ name = "Action: 47", use = (not pbuffs['Unbridled Enthusiasm']) and not (pbuffs['Thunder Force']) },
{ name = "Action: 54", use = (boss and not pbuffs['Ancient Spirit Water']) }, 
{ name = "Shadow Protection", use = ((not pbuffs['Ancient Spirit Water']) and not (pbuffs['Shadow Protection'])) }, 
--{ name = "Fire Ward", use = (not pbuffs['Fire Ward']) },
{ name = "Energy Influx", use = (not pbuffs['Energy Influx']) },
{ name = "Electrostatic Charge", use = (not pbuffs['Electrostatic Charge']) },
{ name = "Distract", use = ((phealth <= .35) and not pbuffs['Electrostatic Charge']) },
{ name = "Energy Well", use = (not pbuffs['Energy Well']) }, 
{ name = "Elemental Catalysis", use = (boss and not tbuffs['Elemental Catalysis']) },
{ name = "Intensification", use = (boss and not tbuffs['Intensification']) },
}
-- Ranged Attack
if enemy then
Skill2 = {
--{ name = "Electric Bolt", use = (boss and not tbuffs['Electric Flow']) },
{ name = "Elemental Weakness", use = (boss and not tbuffs['Elemental Weakness']) },
{ name = "Flame", use = ((pbuffs['Elemental Catalysis']) or (pbuffs['Ancient Spirit Water'])) },
{ name = "Fireball", use = (true) },
{ name = "Demoralize", use = (not tbuffs['Demoralize']) },
{ name = "Lightning", use = (not tbuffs['Lightning']) },
{ name = "Kiss of the Vampire", use = (not tbuffs['Kiss of the Vampire']) },
{ name = "Cursed Fangs", use = (EnergyBar2 >= 30) },
{ name = "Flame", use = (boss or tbuffs['Elemental Weakness']) },
{ name = "Phoenix", use = (combat and melee) },
{ name = "Discharge", use = (combat and melee) },
{ name = "Meteor Shower", use = (true) },
{ name = "Plasma Arrow", use = (not pbuffs['Charged']) },
}
end 

-- Class: Mage/Druid
elseif mainClass == "MAGE" and subClass == "DRUID" then
-- Silence
Skill = {
{ name = "Silence", use = (silenceThis) },
-- Potions
{ name = "Action: "..healthpot, use = (phealth <= .50) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .50)) }, -- only mana pot if decent health
-- Heals
{ name = "Recover", use = ((phealth <= .60) and not pbuffs['Recover']) },
{ name = "Recover", use = (phealth <= .30) },
{ name = "Recover", use = ((phealth <= .90) and not combat) }, -- top off before fight
-- Buffs
{ name = "Perception", use = (not pbuffs['Perception']) }, -- Mage/Druid Elite 15
--{ name = "Magic Target", use = (not combat and not pbuffs['Magic Target']) }, -- Mage/Druid Elite 20
{ name = "Savage Blessing", use = (not pbuffs['Savage Blessing']) },
--{ name = "Fire Ward", use = (not pbuffs['Fire Ward']) },
{ name = "Electrostatic Charge", use = (not pbuffs['Electrostatic Charge']) },
-- In case Electrostatic Charge is still on cooldown and you're getting hit hard
{ name = "Mother Earth's Protection", use = ((phealth <= .30) and not pbuffs['Electrostatic Charge']) }, 
{ name = "Elemental Catalysis", use = (boss and not tbuffs['Elemental Catalysis']) },
{ name = "Intensification", use = (boss and not tbuffs['Intensification']) },
}
-- Ranged Attack
if enemy then
Skill2 = {
--{ name = "Electric Bolt", use = (boss and not tbuffs['Electric Flow']) },
{ name = "Elemental Weakness", use = (boss and not tbuffs['Elemental Weakness']) },
{ name = "Magma Blade", use = (true) },
{ name = "Fireball", use = (true) },
{ name = "Lightning", use = (melee and not tbuffs['Lightning']) },
{ name = "Flame", use = (boss or tbuffs['Elemental Weakness']) },
{ name = "Phoenix", use = (combat and melee) },
{ name = "Discharge", use = (combat and melee) },
{ name = "Meteor Shower", use = (true) },
{ name = "Earth Pulse", use = (combat and melee) },
{ name = "Plasma Arrow", use = (not pbuffs['Charged']) },
}
end

-- Class: Priest/Warrior
elseif mainClass == "AUGUR" and subClass == "WARRIOR" then
--Potions and Buffs
Skill = {
{ name = "Magic Barrier", use = ((pctEB1 >= .05) and (not pbuffs['Magic Barrier'])) },
{ name = "Blessed Spring Water", use = ((pctEB1 >= .05) and (not pbuffs['Blessed Spring Water'])) },
{ name = "Grace of Life", use = (not pbuffs['Grace of Life']) },
{ name = "Amplified Attack", use = (not pbuffs['Amplified Attack']) },
{ name = "Battle Monk Stance", use = (not pbuffs['Battle Monk Stance']) },
{ name = "Power Build-Up", use = (not pbuffs['Power Build-Up']) },
-- Self Heals
{ name = "Regenerate", use = ((phealth <= .85) and (not pbuffs['Regenerate'])) },
{ name = "Urgent Heal", use = (phealth <= .55) },
{ name = "Heal", use = (phealth <= .40) },
{ name = "Holy Aura", use = (phealth <= .30) },
{ name = "Soul Source", use = (phealth <= .25) },
-- Target Heals
{ name = "Regenerate", use = (friendly and (thealth <= .80) and (not tbuffs['Regenerate'])) },
{ name = "Urgent Heal", use = (friendly and (thealth <= .55)) },
}
-- Combat
if enemy then
Skill2 = {
{ name = "Ascending Dragon Strike", use = (EnergyBar2 >= 30) },
{ name = "Slash", use = (EnergyBar2 >= 26), timer = "SSBleed" },
{ name = "Explosion of Fighting Spirit", use = ((not friendly) and (combat)) },
{ name = "Attack", use = (thealth == 1) },
}
end

-- Class Warrior/Warden
elseif mainClass == "WARRIOR" and subClass == "WARDEN" then
Skill = {
{ name = "Briar Shield", use = (pctEB2 >= .15) and ((not pbuffs['Briar Shield']) or (pbuffs['Briar Shield'].time <= 45)) },
{ name = "Battle Creed", use = (pctEB2 >= .15) and ((not pbuffs['Battle Creed']) or (pbuffs['Battle Creed'].time <= 45)) },
}
--Combat
if enemy then
Skill = {
{ name = "Survival Instinct", use = (phealth <= .49) },
{ name = "Elven Amulet", use = (EnergyBar2 >= 150) and (phealth <= .4) },
{ name = "Defensive Formation", use = (EnergyBar1 >= 25) and (phealth <= .30) }, 
{ name = "Savage Whirlwind", use = (EnergyBar2 >= 240) },
{ name = "Attack Weakener", use = (EnergyBar2 >= 280) and (tbuffs['Vulnerable']) },
{ name = "Action: 8", use = (EnergyBar1 >= 25) and (tbuffs['Vulnerable']) },
{ name = "Open Flank", use = (EnergyBar1 >= 10) and (tbuffs['Vulnerable']) },
{ name = "Probing Attack", use = (EnergyBar1 >= 15) },
{ name = "Tactical Attack", use = (EnergyBar1 >= 15) and (tbuffs[500081]) },
{ name = "Slash", use = (EnergyBar1 >= 25) },
{ name = "Power of the Wood Spirit", use = (EnergyBar2 >= 114) },
}
end
-- Class Scout/Druid
elseif mainClass == "RANGER" and subClass == "DRUID" then
Skill = {
{ name = "Savage Blessing", use = (pctEB1 >= .05) and ((not pbuffs['Savage Blessing']) or (pbuffs['Savage Blessing'].time <= 45)) },
}
--Combat
if enemy then
Skill = {
{ name = "Vampire Arrows", use = true },
{ name = "Autoshot", use = (not ASon) },
{ name = "Combo Shot", use = true },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Wind Arrows", use = (CD("Wind Arrows")) and (EnergyBar1 >= 35) },
{ name = "Shoot", use = true },
}
end
-- Class Scout/Warrior
elseif mainClass == "RANGER" and subClass == "WARRIOR" then
--Combat
if enemy then
Skill = {
{ name = "Defensive Formation", use = (phealth <= .30) },
{ name = "Vampire Arrows", use = true },
{ name = "Autoshot", use = (not ASon) },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Slash", use = (EnergyBar1 >= 25) },
{ name = "Combo Shot", use = true },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Wind Arrows", use = (CD("Wind Arrows")) and (EnergyBar1 >= 35) },
{ name = "Shoot", use = true },
}
end

-- Class Scout/Warden
elseif mainClass == "RANGER" and subClass == "WARDEN" then
Skill = {
{ name = "Frost Arrow", use = (not combat) and (EnergyBar1 >= 20) and ((not pbuffs['Frost Arrow']) or (pbuffs['Frost Arrow'].time <= 45)) },
{ name = "Entling Offering", use = (pctEB2 >= .15) and ((not pbuffs['Entling Offering']) or (pbuffs['Entling Offering'].time <= 45)) },
{ name = "Briar Shield", use = (pctEB2 >= .15) and ((not pbuffs['Briar Shield']) or (pbuffs['Briar Shield'].time <= 45)) },
}
--Combat
if enemy then
Skill = {
{ name = "Snipe", use = (pbuffs['Hidden Peril']) },
{ name = "Hidden Peril", use = (EnergyBar1 >= 30) and (CD("Snipe")) },
{ name = "Vampire Arrows", use = (CD("Vampire Arrows")) and (EnergyBar1 >= 20) },
{ name = "Autoshot", use = (not ASon) },
{ name = "Thorn Arrow", use = (CD("Thorn Arrow")) and (EnergyBar2 >= 180) },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Combo Shot", use = (CD("Combo Shot")) },
{ name = "Power of the Wood Spirit", use = (EnergyBar2 >= 114) },
{ name = "Wind Arrows", use = (EnergyBar1 >= 15) and (CD("Snipe")) },
{ name = "Shoot", use = (CD("Shoot")) },
}
end
-- Class Warrior/Knight
elseif mainClass == "WARRIOR" and subClass == "KNIGHT" then
Skill = {
{ name = "Blocking Stance", use = (EnergyBar2 >= 20) and ((not pbuffs['Blocking Stance']) or (pbuffs['Blocking Stance'].time <= 45)) },
{ name = "Enhanced Armor", use = (EnergyBar2 >= 20) and ((not pbuffs['Enhanced Armor']) or (pbuffs['Enhanced Armor'].time <= 45)) },
}
--Combat
if enemy then
Skill = {
{ name = "Survival Instinct", use = (phealth <= .49) },
{ name = "Defensive Formation", use = (EnergyBar1 >= 25) and (phealth <= .30) }, 
{ name = "Open Flank", use = (EnergyBar1 >= 10) and (tbuffs['Vulnerable']) },
{ name = "Probing Attack", use = (EnergyBar1 >= 15) },
{ name = "Tactical Attack", use = (EnergyBar1 >= 15) and (tbuffs[500654]) },
{ name = "Slash", use = (EnergyBar1 >= 25) },
{ name = "Holy Strike", use = (EnergyBar2 >= 15) },
}
end 



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

trav42073

Professional

Posts: 806

Location: Arizona

Occupation: welder/fabricator/antagonist

  • Send private message

642

Monday, June 4th 2012, 12:40am

is there a way to make this for dummies? maybe code is just intimidating to me but i cant figure out how all this works even after perusing through this thread and the original diyce thread a multitude of times. i have the diyce folder installed in my interface/addons folder but thats as far as i understand it. troll away i guess. just sounds like a fun idea to have a code figure out my next moves for me. maybe thats why i failz at siege. up against a diyce player is like racing an automatic equipped car with a manual.
95r/62m/63s/ Soultwist.
Ryaderr wrd/s/w erobos

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

643

Monday, June 4th 2012, 1:05am

Quoted from "trav42073;534363"

is there a way to make this for dummies? maybe code is just intimidating to me but i cant figure out how all this works even after perusing through this thread and the original diyce thread a multitude of times.

Many moons ago I had suggested a method to make a GUI front-end for DIYCE. Unfortunately, no-one took up the challenge. I myself am out of the add-on business apart from a few quicky things I write up mainly as example code for others.

These days, I suggest a complete re-write instead of just a front-end since DIYCE has become rather unwieldy. But as I don't even have the game installed on my machine anymore, I'm not the one to write it (though I could help out a bit if an enterprising person decided to give it a shot).

Quoted from "trav42073;534363"

i have the diyce folder installed in my interface/addons folder but thats as far as i understand it. troll away i guess. just sounds like a fun idea to have a code figure out my next moves for me. maybe thats why i failz at siege. up against a diyce player is like racing an automatic equipped car with a manual.

I might, however, be convinced to write something up about using DIYCE 2.0.

Some people have said that using DIYCE in siege/PvP doesn't give any advantages, some swear by it, while yet others claim it is a disadvantage. I'll let you decide what to believe, I have no real opinion on the matter though I'd hazard a guess that how you setup your skill list is of vital importance.
2013... The year from hell....

trav42073

Professional

Posts: 806

Location: Arizona

Occupation: welder/fabricator/antagonist

  • Send private message

644

Monday, June 4th 2012, 3:45am

a gui for diyce 2.0 would be spectacular. i use many of ur addons peryl and am a fan of your work. love ur action bars addon and i make myself a nuisance in guild chat using ur piratey chat addon.

as far as how much of an advantage it gives people in siege, i think it is huge. i am pretty quick on the keys but some people i face just target me from sooooo far away and instantly have a bead on me, it has to be something other than tracking me with their mouse from across the field and knowing when i am in range for whatever skill they use to one shot me.

setting up my skill list, or mycustomfunction is the part where i get lost. any books you would recomend to get me on the right path? im a sponge in that respect its the pieces and parts of code that someone else put together that confuse me.
95r/62m/63s/ Soultwist.
Ryaderr wrd/s/w erobos

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

645

Monday, June 4th 2012, 5:10am

Quoted from "trav42073;534389"

a gui for diyce 2.0 would be spectacular. i use many of ur addons peryl and am a fan of your work. love ur action bars addon and i make myself a nuisance in guild chat using ur piratey chat addon.


Thanks. (Yarrrr!)


Quoted from "trav42073;534389"

as far as how much of an advantage it gives people in siege, i think it is huge. i am pretty quick on the keys but some people i face just target me from sooooo far away and instantly have a bead on me, it has to be something other than tracking me with their mouse from across the field and knowing when i am in range for whatever skill they use to one shot me.


Well I don't know how they do the targeting, but it likely isn't DIYCE. It effectively only targets/re-targets in the same way the Tab key works. Though it might re-target faster and hence where it might seem like they target you easily.


Quoted from "trav42073;534389"

setting up my skill list, or mycustomfunction is the part where i get lost. any books you would recomend to get me on the right path? im a sponge in that respect its the pieces and parts of code that someone else put together that confuse me.


Well apart from the Programming in Lua book (online version here), and maybe my Lua Logic Operator tutorial (posted here). There isn't all that much that would help with setting up the skill list or the custom function since it is an add-on. Guess I'll have to come up with some kind of guide/tutorial on how DIYCE works and how to use it.
2013... The year from hell....

trav42073

Professional

Posts: 806

Location: Arizona

Occupation: welder/fabricator/antagonist

  • Send private message

646

Monday, June 4th 2012, 5:28am

ahhh, that will keep me busy for a while. guess google would have got me there as well but, thanks Peryl.
95r/62m/63s/ Soultwist.
Ryaderr wrd/s/w erobos

trav42073

Professional

Posts: 806

Location: Arizona

Occupation: welder/fabricator/antagonist

  • Send private message

647

Thursday, June 7th 2012, 12:22am

ok, how bout some error message help please,
string "WardenWarrior()"]: attempt to call global "WardenWarrior" a nil value

scratch that, new error
"=" expected near "<eof>"
95r/62m/63s/ Soultwist.
Ryaderr wrd/s/w erobos

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

648

Thursday, June 7th 2012, 1:13am

Quoted from "trav42073;534953"

scratch that, new error
"=" expected near "<eof>"

Lua is confused by your code. Somewhere it is expecting an assignment and actually reached the end of the file before it saw it.

Likely you have a word/variable somewhere in the code all on its lonesome. Possibly caused by a commented out block of code, or a missing brace somewhere.
2013... The year from hell....

krssrb

Beginner

Posts: 20

Location: Serbia

  • Send private message

649

Wednesday, June 13th 2012, 9:00am

I have a suggestion,

Chapter V has arrived, so you should insert Champion and Warlock to DIYCE.
this thread is geting to long, so maybe to move it to new DIYCE 3.0 thread :)
Warrior80/Mage80/Warlock80

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

650

Wednesday, June 13th 2012, 2:24pm

Quoted from "krssrb;537171"

I have a suggestion,

Chapter V has arrived, so you should insert Champion and Warlock to DIYCE.


Not really anything to do here as people should be checking the class combos in their code. Just need to get the class names as returned by UnitClassToken() which can be found out with the following little macro:

Source code

1
2
/run pclass,sclass = UnitClassToken("player")
/run DEFAULT_CHAT_FRAME:AddMessage("Primary: "..(pclass or "nil").."  Secondary: "..(sclass or "nil"))


Quoted from "krssrb;537171"

this thread is geting to long, so maybe to move it to new DIYCE 3.0 thread :)

As there isn't a version 3 of DIYCE, I wouldn't use that as the name. With regard to the thread length, well this one isn't even half the length of the original DIYCE thread :P
2013... The year from hell....

651

Wednesday, June 13th 2012, 6:25pm

Quoted from "Peryl;537207"

Not really anything to do here as people should be checking the class combos in their code. Just need to get the class names as returned by UnitClassToken() which can be found out with the following little macro:

Source code

1
2
/run pclass,sclass = UnitClassToken("player")
/run DEFAULT_CHAT_FRAME:AddMessage("Primary: "..(pclass or "nil").."  Secondary: "..(sclass or "nil"))




Champion = PSYRON
Warlock = HARPSYN

652

Tuesday, June 19th 2012, 8:12pm

While I was looking though the playerframe.lua I found the reference to a value called "PlayerSoulBar". I have figured out that this is the name for the PSI bar on the Warlock.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    local point, status = GetSoulPoint();
    if ( point >= 0 ) then
        PlayerSoulBar:Show();
        PlayerSoulBar:SetValue(point);
        if ( status == nil or status == 0 ) then
            PlayerSoulBar:SetBarColor(0, 1, 0);
        elseif ( status == 1 ) then
            PlayerSoulBar:SetBarColor(0.6, 0, 1);
        elseif ( status == 2 ) then
            PlayerSoulBar:SetBarColor(0, 0, 1);
        end
    else
        PlayerSoulBar:Hide();        
    end


I also found that the min value is 0 and the max is 6 in playerframe.xml.

Source code

1
<StatusBar name="PlayerSoulBar" hidden="true" minValue="0" maxValue="6" defaultValue="0">


The question I have is, what is the proper way to add this to DIYCE? I am still learning Lua and I can read it much better than I can write it. The best I can figure is:

Source code

1
{ name = "SKILL",   use = (PlayerSoulBar >= 4) },

Auros

Professional

Posts: 1,360

Mood: Mellow

  • Send private message

653

Tuesday, June 19th 2012, 8:23pm

Oh, and in case it hasn't been said recently; Many thanks to Peryl for continuing support to DIYCE even though he doesn't play the game anymore.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

654

Tuesday, June 19th 2012, 9:12pm

Quoted from "Auros;539415"

Oh, and in case it hasn't been said recently; Many thanks to Peryl for continuing support to DIYCE even though he doesn't play the game anymore.

Thanks. Here's hoping a few other folks decide to get more involved in add-ons.


Quoted from "Alterios;539411"

While I was looking though the playerframe.lua I found the reference to a value called "PlayerSoulBar". I have figured out that this is the name for the PSI bar on the Warlock.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    local point, status = GetSoulPoint();
    if ( point >= 0 ) then
        PlayerSoulBar:Show();
        PlayerSoulBar:SetValue(point);
        if ( status == nil or status == 0 ) then
            PlayerSoulBar:SetBarColor(0, 1, 0);
        elseif ( status == 1 ) then
            PlayerSoulBar:SetBarColor(0.6, 0, 1);
        elseif ( status == 2 ) then
            PlayerSoulBar:SetBarColor(0, 0, 1);
        end
    else
        PlayerSoulBar:Hide();        
    end

Nice find! Been curious about the PSI bar and this answers much of it.

Quoted from "Alterios;539411"

I also found that the min value is 0 and the max is 6 in playerframe.xml.

Source code

1
<StatusBar name="PlayerSoulBar" hidden="true" minValue="0" maxValue="6" defaultValue="0">

Yup, found that out by PM with suprra. But always good to get confirmation.

Quoted from "Alterios;539411"

The question I have is, what is the proper way to add this to DIYCE? I am still learning Lua and I can read it much better than I can write it. The best I can figure is:

Source code

1
{ name = "SKILL",   use = (PlayerSoulBar >= 4) },

The answer to your question lies in the piece of code from the game interface you posted above. Note the call to GetSoulPoint(). Based on that one line of code, this function returns the number of points you have and some status. The points will be a number from 0 to 6 and the status is a number from 0 to 2 or nil. The status is use to set the color of the PSI bar, while the points are used to set the bar itself as well as showing/hiding the bar itself (The bar is shown if you have points, hidden if there are no points at all).

So to answer your question, you would want to first retrieve the amount of points you have (and may as well get the status too). So at the start of KillSequence(), where we have all the local variable definitions, you would add the following line:

Source code

1
    local PsiPoints, PsiStatus = GetSoulPoint()

(Note that I don't yet know what the behavior of this line will be when run on a non-warlock character, though I suspect it will merely return 0 for the points and possibly nil for the status).

Now your skill line would become (using your example)

Source code

1
    { name = "SKILL",   use = (PsiPoints >= 4) },
2013... The year from hell....

655

Tuesday, June 19th 2012, 10:48pm

Quoted from "Auros;539415"

Oh, and in case it hasn't been said recently; Many thanks to Peryl for continuing support to DIYCE even though he doesn't play the game anymore.

I second that!!

Quoted from "Peryl;539429"

Thanks. Here's hoping a few other folks decide to get more involved in add-ons.

I can't write them but I'm trying to edit the heck out ones that exist to learn.

Thanks for the fast response, especially since it is coming from you Peryl. :D

I was asking the question in general so that it is documented for everyone that plays a Warlock and uses DIYCE. I actually play a Champion. I am about to try it out on my Champ and I will let you know what the outcome is.

EDIT: Adding that local variable did not seem to have any effects on my Champ/Priest. It did not throw any in game errors either. I buffed outside of battle and killed several enemies.

656

Wednesday, June 20th 2012, 12:28am

My son plays a Warlock and we tested this and it works great. The code we used to test it is below.

Source code

1
2
3
4
5
6
7
elseif enemy and (mode == "test") then
Skill2 = {
{ name = "Willpower Blade",         use = (PsiPoints == 6) },
{ name = "Ruthless Judgement",   use = ((pbuffs ['Willpower Blade']) and (PsiPoints >= 2)) },
{ name = "Psychic Arrows",         use = (PsiPoints <= 6) },
   }
end

657

Sunday, June 24th 2012, 7:00am

Quoted from "Peryl;529405"



Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    --Select Next Enemy    
    if (tDead) then
        TargetUnit("")
        return
    end

    if  not LockedOn or not enemy or tDead then
        -- Try up to ten times to find an enemy player
        for i = 1,10 do
            TargetNearestEnemy()
             if UnitIsPlayer("target") then 
                 break 
             end
        end 
        if not UnitIsPlayer("target") then 
            TargetUnit("") 
        end
    end




I know this was posted a while back but I wanted to bug anyone that is still reading this thread about a modification to this bit of code. I want to make this work only in siege. As far as I can tell it would look something like the code below.

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
  --Select Next Enemy    
    if (tDead) then
        TargetUnit("")
        return
    end

    if  not LockedOn or not enemy or tDead and GetCurrentWorldMapID()==GS_ID then
          for i = 1,10 do
            TargetNearestEnemy()
             if UnitIsPlayer("target") then 
                 break 
             end
        end 
        if not UnitIsPlayer("target") then 
            TargetUnit("") 
    elseif mainClass == "RANGER" and (not party) and GetCurrentWorldMapID()~=GS_ID then
        if (not LockedOn) or (not enemy) then
            TargetNearestEnemy()
            return
        end
    elseif mainClass ~= "RANGER" and GetCurrentWorldMapID()~=GS_ID then 
        if (not LockedOn) or (not enemy) then
            TargetNearestEnemy()
            return
        end
      end
    end

Have I butchered this code or is this close to right? The concept is that the player only targeting will only work in siege and the normal targeting will work outside of siege.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

658

Sunday, June 24th 2012, 11:46am

See this post by frafall. Specifically how he defines the local variables pvp and zoneid.
2013... The year from hell....

659

Sunday, June 24th 2012, 5:19pm

I guess I failed at using the search button, I should have read the last 20 pages, not the first 35.

BTW, the variable GetCurrentWorldMapID()==GS_ID comes from an addon I use called GuildSiegeQuickTrade that only shows up in siege.

660

Sunday, June 24th 2012, 9:23pm

OK, OK, I know too many questions but I was wondering if I could get an expert eye to look at this before siege. Using the example from Frafall I created a targeting bit that is supposed to auto target everything outside of siege and only players in siege. It auto-targets outside of siege; the question is will it work in siege? I do have a backup of the original file just in case though

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
    --Select Next Enemy (mine)
    local zoneid = (GetZoneID() % 1000)
    local pvp = (zoneid == 402)
    if (tDead) then
        TargetUnit("")
        return
    end
    if mainClass == "RANGER" and (not party) and ( not pvp) 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) and (not pvp) then
            TargetNearestEnemy()
            return
        end
    -- Only target players in pvp, no pets
    elseif  pvp then
        for i=1,10 do
            if UnitIsPlayer("target") then
                break
            end
                TargetNearestEnemy()
                    end
            end

Again, I apologize for being thick headed about it, I'm still fumbling my way through stuff that isn't simple variables. I have read the first 45 pages of the post and everything after Frafall's post so if I'm missing something in the middle there just send me a smack and tell me to look it up ;)