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.

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,121

Tuesday, September 28th 2010, 11:10am

Quoted from "spamely;339029"

well, yes, thats THE way to do it. without a macro. you press TAB.


Thanks for the information which I obviously already knew.

As a warrior/rogue, if i have hp pots, or a healer with me, I do not need to stop while I regain mana, or health. If I can just "run and gun" so to speak, things would be a lot easier. Is there a way to implement into the DIYCE the ability to select the next target in front of you that has life? If it has life, start attacking, if not keep searching for the next live target.

I've been working with the DIYCE almost as long as Sixpax has had it posted, and referred several of my guildies to this thread, and to use it. I've tweaked it for each of my toons to suit those needs, and it works beautifully each time. If this ability could be implemented then the DIYCE it would make my life so much easier when I am grinding out the hunt for dailies.

1,122

Tuesday, September 28th 2010, 3:26pm

Quoted from "ghostwolf82;341673"

Thanks for the information which I obviously already knew..


you are welcome. like i said you pretty much already have it. this is what i have on my r/k farming macro.

Source code

1
2
3
4
5
6
7
8
9
   if enemy then
		if tWound then
			TargetNearestEnemy()
			i=i+1; Skill[i] = { name = "Attack",                 use = true }
		end--    i=i+1; Skill[i] = { name = "Wound Attack",  use = ((energy >= 35) and tBleed and tWound) }
        i=i+1; Skill[i] = { name = "Low Blow",      use = ((energy >= 30) and tBleed) }
        i=i+1; Skill[i] = { name = "Shadowstab",    use = ((energy >= 43) and (not (string.find(tbuffs,"Blind Spot Bleed") or tBleed))) }
		i=i+1; Skill[i] = { name = "Disarmament",   use = ((not tDisarmed) or (BuffTimeLeft("target","Disarmament") <= 3)) }
	end


as you can see it is a simle if statement. so assuming you declare a variable for dead (which you may use for looting)

Source code

1
local tDead = UnitIsDeadOrGhost()


then you have

Source code

1
2
3
4
if tDead then
	     TargetNearestEnemy()
		i=i+1; Skill[i] = { name = "Attack",                 use = true }
		end

1,123

Tuesday, September 28th 2010, 3:31pm

Quoted from "Cajule;341530"

Anyway, I do have another question, and I havent gotten a chance to test this yet.

Source code

1
2
3
4
local solo = true
   if GetNumPartyMembers() > 1 then
      solo = false
   end
Found your post on the party check function.

The only thing I see wrong with that check is GetNumPartyMembers() returns the number of party members, not counting yourself. It would leave solo as true if you had one friend partying with you. Change the comparison value to "> 0" or to ">= 1" and it'll be fine. The only other change I'd put in is to make this a simple one line:

Source code

1
local party = (GetNumPartyMembers() > 0)

Quoted from "Cajule;341530"


Source code

1
2
   i=i+1; Skill[i] = { ['name'] = "Combat Master",    ['use'] = ((solo) and (not string.find(pbuffs,"Combat Master"))) }
   i=i+1; Skill[i] = { ['name'] = "Informer",        ['use'] = ((solo) and (not string.find(pbuffs,"Informer"))) }


What I want to accomplish here, is cast Informer if in a group, but the CD for it is 5 minutes and duration of only 60 seconds. While Combat Master is a 15 minute self buff, with no CD. So if in a party cast Informer, but if it is gone and it is on CD, then pop Combat Master. Regardless, I would still want Informer going off every 5 minutes, boss fight or not. So in between, for 4 minutes a rogue would still have that crit buff.

Not sure how to even word my thoughts here, I may need to eat lol. I could try something like the psudo range check with a (melee)/(not melee) check as was done with Shadowstab. If it was on CD it just wont cast, but it would still need to cast Combat Master.

Im not sure if Informer will cancel for party members if say, you cast it then drop it to get CM which more than likely has more TP put into it.

Edit: After thinking about this, if you where in a party the solo check would always return as false, so it would never cast CM. I'll have to work this one out in game, but most of you guys on here are a bit more savvy than I, and probably already know how to work it out. :)


I don't know about whether dropping Informer on you will drop it for the rest of the group either. However, I do understand your requirements for when these two buffs will go off. What you're looking for is something like this:

Source code

1
2
   i=i+1; Skill[i] = { ['name'] = "Informer",        ['use'] = ((party) and (not string.find(pbuffs,"Informer"))) }
   i=i+1; Skill[i] = { ['name'] = "Combat Master",    ['use'] = ((not string.find(pbuffs,"Informer")) and (not string.find(pbuffs,"Combat Master"))) }
This is using the definition of party above. Informer will go off every time it's available, but only in a group. Combat Master will go off if Informer buff isn't on or Combat Master buff isn't on. (And if you're solo, Informer will never be on.)

1,124

Tuesday, September 28th 2010, 5:33pm

Quoted from "Cajule;341530"

Anyway, I do have another question, and I havent gotten a chance to test this yet.

Source code

1
2
3
4
local solo = true
   if GetNumPartyMembers() > 1 then
      solo = false
   end
Found your post on the party check function.

Source code

1
2
   i=i+1; Skill[i] = { ['name'] = "Combat Master",    ['use'] = ((solo) and (not string.find(pbuffs,"Combat Master"))) }
   i=i+1; Skill[i] = { ['name'] = "Informer",        ['use'] = ((solo) and (not string.find(pbuffs,"Informer"))) }
What I want to accomplish here, is cast Informer if in a group, but the CD for it is 5 minutes and duration of only 60 seconds. While Combat Master is a 15 minute self buff, with no CD. So if in a party cast Informer, but if it is gone and it is on CD, then pop Combat Master. Regardless, I would still want Informer going off every 5 minutes, boss fight or not. So in between, for 4 minutes a rogue would still have that crit buff.


You can simplify the solo declaration/check like so:

Source code

1
local solo = (GetNumPartyMembers() < 2)
I'm not sure if it returns 1 or zero when not in a party, but I do know that it does count yourself when you are in a party, thus the < 2 check.

What I think you're looking for as far as the buffs is to cast Informer whenever you're in a party and it's available, otherwise cast CM.

So here's how I'd code that:

Source code

1
2
    i=i+1; Skill[i] = { name = "Informer",       use = ((not solo) and combat) }
    i=i+1; Skill[i] = { name = "Combat Master",  use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
Make sure you have the combat variable defined.

So this casts Informer any time you're not solo and you're in combat. It casts CM whether you're in a party or not as long as you have neither buff on you.

1,125

Tuesday, September 28th 2010, 5:43pm

Quoted from "spamely;341705"

so assuming you declare a variable for dead (which you may use for looting)

Source code

1
local tDead = UnitIsDeadOrGhost()


For that function to work, you have to pass it a unitID. So it would be:

Source code

1
local tDead = UnitIsDeadOrGhost("target")
However, what I don't know is if that returns true if you have no target. If it returns false or :nil: with no target, then that check won't work for this purpose.

1,126

Wednesday, September 29th 2010, 12:27am

Quoted from "spamely;341705"

Source code

1
local tDead = UnitIsDeadOrGhost("target")


then you have

Source code

1
2
3
4
if tDead then
    TargetNearestEnemy()
    i=i+1; Skill[i] = { name = "Attack",                 use = true }
end
BE CAREFUL! This will not loot the body as it is right now. Consider the fact that when UnitIsDeadOrGhost("target") is true, UnitCanAttack("player", "target") is false. And since the UnitCanAttack check is used by 99% of the scripts to determine friendly/enemy status, any DIYCE script lines with enemy status in them will be false as well. Meaning the only line that is guaranteed to run when MyCombat is called is the Attack line. Which will then attack the freshly targetted, full health enemy instead of looting the body. Fine if you're a warrior or a knight, not so fine if you're a mage or a priest. But there are ways around this. First you can set up the macro to look like this:

Source code

1
/run if UnitIsDeadOrGhost("target") then CastSpellByName("Attack"); TargetNearestEnemy(); end; WarriorRogue()


Or alternatively, you set up the end of your script like this:

Source code

1
2
3
4
5
6
    i=i+1; Skill[i] = { name = "Attack",        use = tDead }
    MyCombat(Skill,arg1)
    if tDead then
        TargetNearestEnemy()
    end
end

By placing the TargetNearestEnemy() after the MyCombat call, you ensure that whatever target was used for your variable declarations is the one that the MyCombat call will affect. (Yeah, I need to rewrite this to explain better.)

1,127

Wednesday, September 29th 2010, 2:28am

Quoted from "Silandro;341889"

BE CAREFUL! This will not loot the body as it is right now.


Source code

1
2
3
   local tDead = UnitIsDeadOrGhost()

   i=i+1; Skill[i] = { ['name'] = "Attack",		  ['use'] = (tDead or (not combat and not enemy)) }

This works, "if" you are close enough to the dead mob. That is what is in mine, which I got from this thread somewhere. I know this is about a "macro", dunno if this helps or not.

1,128

Wednesday, September 29th 2010, 11:53pm

Quoted from "Sixpax;341726"

You can simplify the solo declaration/check like so:

Source code

1
local solo = (GetNumPartyMembers() < 2)
I'm not sure if it returns 1 or zero when not in a party, but I do know that it does count yourself when you are in a party, thus the < 2 check.

What I think you're looking for as far as the buffs is to cast Informer whenever you're in a party and it's available, otherwise cast CM.

So here's how I'd code that:

Source code

1
2
    i=i+1; Skill[i] = { name = "Informer",       use = ((not solo) and combat) }
    i=i+1; Skill[i] = { name = "Combat Master",  use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
Make sure you have the combat variable defined.

So this casts Informer any time you're not solo and you're in combat. It casts CM whether you're in a party or not as long as you have neither buff on you.


Thanks Six and Silandro. Made the changes you guys mentioned, but wasnt able to test in a group setting until today, and it worked as described.

1,129

Thursday, September 30th 2010, 12:33am

Need to get some clairification on this. I think it looks right, but I dont see enough bosses yet to test it out.

Source code

1
2
3
4
5
6
-- Boss/Cast check
   local isboss = (UnitSex("target") >= 2)
   local tspell,ttime,telapsed = UnitCastingTime("target")

-- From post #396
   local interrupt_list = "/Crimson Whirl/Counter/" -- "/Fireball/Thunderstorm/Spell of Doom/" interrupt skill

I presume you would need to know what spells the Boss casts, and put them in this interrupt_list.

Source code

1
2
3
4
   i=i+1; Skill[i] = { ['name'] = "Silence",	['use'] = ((isboss) and (tspell ~= nil) and string.find(interrupt_list,tspell)) }

-- uses no checks for boss or specific spells being cast.  Just checks if a spell is being cast by the mob, and cast silence, or whichever interupt you have for your class.
   i=i+1; Skill[i] = { ['name'] = "Silence",	['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (energy >= 15)) }

Even if the mob isnt a "Boss" but is an Elite, isboss would apply to it. Should that be (not isboss) instead of (not friendly)? But then how would you address regular trash mobs, which they would fall under (not friendly), some of them cast aswell?

I don't want to over complicate it, but to me it seems the second one would be more efficient, because it is all-inclusive to any mob that casts. Thoughts?

1,130

Thursday, September 30th 2010, 5:03am

Quoted from "Cajule;341930"

Source code

1
2
3
   local tDead = UnitIsDeadOrGhost("target")
 
   i=i+1; Skill[i] = { ['name'] = "Attack",          ['use'] = (tDead or (not combat and not enemy)) }

This works, "if" you are close enough to the dead mob. That is what is in mine, which I got from this thread somewhere. I know this is about a "macro", dunno if this helps or not.

It was not the inability of DIYCE syntax to loot corpses that I was warning about. It was the logic error of changing targets before calling MyCombat() that was my warning. That's why I gave the examples showing how to modify either the calling macro or the DIYCE function to TargetNearestEnemy() after MyCombat().
Whether or not you want to have the auto-interact line in your DIYCE code is a personal choice, but, if you do decide to, the line above is probably the best way to do it. (Just remember to put "target" in the tDead declaration line.)

P.S. You're welcome for the "party" check function help, but when I looked at Sixpax's code I'd find myself using his lines instead. But he's the DIYCE guru and I'm just a DIYCE geek. ;)

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,131

Thursday, September 30th 2010, 10:44am

Thanks guys. When I get up tomorrow I shall be trying out variations of these ideas you have given me. I shall report my findings.

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,132

Thursday, September 30th 2010, 10:48pm

Ok, been testing things, and one last piece of information is needed. How do I determine if the target is nil? If I have no target.

1,133

Friday, October 1st 2010, 3:17am

Source code

1
    local LockedOn = UnitExists("target")
Doesn't care what your target is, just that it exists. Not sure why this is a problem, usually DIYCE is run when there's a target. :)

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,134

Friday, October 1st 2010, 9:45pm

Seems to be working perfectly! THANK YOU!!!!!

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,135

Friday, October 1st 2010, 10:06pm

Ok, so as I said, I have been working with this code for quite some time now, and here is the list of functions that I have created, and found to be the best way for each one to maximize the DPS output. Hope this helps someone out if they are making one of these class combos.

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
function WarriorRogue(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(32)
    local LockedOn = UnitExists("target")
    local _1,potcd

    if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
   end

   if (PctH("player")<.70) and (potcd == 0) then
      UseAction(potslot)
      return
   end

    i=i+1; Skill[i] = { name = "Survival Instinct",  use = (PctH("player") < .33) }
    i=i+1; Skill[i] = { name = "Throw",                 use = ((not friendly) and (not melee) and (not CD("Shadow Step")) and (not CD("Surprise Attack"))) }
    i=i+1; Skill[i] = { name = "Shadow Step",        use = ((not friendly) and (not melee) and not CD("Surprise Attack")) }
    i=i+1; Skill[i] = { name = "Surprise Attack",    use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Blind Stab",         use = (front and (not friendly) and (not string.find(tbuffs,"Blind"))) }
    i=i+1; Skill[i] = { name = "Shadowstab",         use = ((not friendly) and (not string.find(tbuffs,"Excessive Bleeding"))and (not CD("Probing Attack"))) }
    i=i+1; Skill[i] = { name = "Enraged",            use = (rage < 50) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (rage >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
    i=i+1; Skill[i] = { name = "Splitting Chop",     use = ((not friendly) and (rage >= 15) and (string.find(tbuffs,"Weakened"))) }
    i=i+1; Skill[i] = { name = "Thunder",              use = ((not friendly) and (rage >= 15) and (string.find(tbuffs,"Weakened"))) }
    i=i+1; Skill[i] = { name = "Open Flank",         use = ((not friendly) and (rage >= 10) and (string.find(tbuffs,"Vulnerable"))) }
    i=i+1; Skill[i] = { name = "Keen Attack",        use = ((not friendly) and (energy >= 20) and (string.find(tbuffs,"Vulnerable"))) }
    i=i+1; Skill[i] = { name = "Probing Attack",     use = ((not friendly) and (rage >= 20)) }
    i=i+1; Skill[i] = { name = "Blood Dance",        use = ((not friendly) and (PctH("player") >= 0.8)) }
    i=i+1; Skill[i] = { name = "Attack",              use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (rage >= 40)) }
    i=i+1; Skill[i] = { name = "Shadowstab",         use = (not friendly) }
    i=i+1; Skill[i] = { name = "Attack",             use = tDead }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
end

function RogueWarrior(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(32)
    local LockedOn = UnitExists("target")
    local _1,potcd

    if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
   end

   if (PctH("player")<.70) and (potcd == 0) then
      UseAction(potslot)
      return
   end

    i=i+1; Skill[i] = { name = "Poison",               use = ((not string.find(pbuffs, "Poisonous") and (not combat))) }
      i=i+1; Skill[i] = { name = "Premeditation",      use = ((not friendly) and (not string.find(pbuffs,"Premeditation") and (not combat))) }
    i=i+1; Skill[i] = { name = "Assassins Rage",     use = (not friendly) }
    i=i+1; Skill[i] = { name = "Throw",                 use = ((not friendly) and (not melee) and (not CD("Shadow Step"))) }
    i=i+1; Skill[i] = { name = "Shadow Step",        use = ((not front) and (not friendly) and (not melee)) }
--    i=i+1; Skill[i] = { name = "Blind Spot",         use = ((not front) and (not friendly) and (rage >=30)) }
    i=i+1; Skill[i] = { name = "Blind Stab",         use = (front and (not friendly) and (not string.find(tbuffs,"Blind"))) }
    i=i+1; Skill[i] = { name = "Poisonous Infection",use = ((not friendly) and (string.find(pbuffs, "Poisonous")) and (energy >= 20)) }
    i=i+1; Skill[i] = { name = "Poison Spray",       use = ((not friendly) and (string.find(tbuffs, "Poison")) and (energy >= 15)) }
    i=i+1; Skill[i] = { name = "Enraged",            use = (energy < 50) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Wound Attack",        use = ((not friendly) and (rage >=35) and string.find(tbuffs,"Bleed") and string.find(tbuffs,"Grievous Wound")) }
    i=i+1; Skill[i] = { name = "Low Blow",           use = ((not friendly) and (rage >=35) and string.find(tbuffs,"Bleed")) }
    i=i+1; Skill[i] = { name = "Shadowstab",         use = ((not friendly) and (rage >=35)) }
    i=i+1; Skill[i] = { name = "Enraged",            use = (energy < 50) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (energy >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
    i=i+1; Skill[i] = { name = "Whirlwind",          use = ((not friendly) and (energy >= 50)) }
    i=i+1; Skill[i] = { name = "Attack",              use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Shadowstab",         use = (not friendly) }
    i=i+1; Skill[i] = { name = "Attack",             use = tDead }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
end

function WarriorMage(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(32)
    local LockedOn = UnitExists("target")
    local _1,potcd

    if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
   end

   if (PctH("player")<.70) and (potcd == 0) then
      UseAction(potslot)
      return
   end

    i=i+1; Skill[i] = { name = "Surprise Attack",    use = ((not friendly) and (melee)) }
    i=i+1; Skill[i] = { name = "Enraged",            use = (rage < 50) }
    i=i+1; Skill[i] = { name = "Electrical Rage",    use = ((not friendly) and (rage >= 20) and (not string.find(pbuffs,"High Voltage III"))) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (rage >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
    i=i+1; Skill[i] = { name = "Thunder",              use = ((not friendly) and (rage >= 15) and (string.find(tbuffs,"Weakened"))) }
    i=i+1; Skill[i] = { name = "Open Flank",         use = ((not friendly) and (rage >= 10) and (string.find(tbuffs,"Vulnerable"))) }
    i=i+1; Skill[i] = { name = "Probing Attack",     use = ((not friendly) and (rage >= 20)) }
    i=i+1; Skill[i] = { name = "Lightning's Touch",  use = (not friendly) }
    i=i+1; Skill[i] = { name = "Attack",              use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (rage >= 40)) }
    i=i+1; Skill[i] = { name = "Attack",             use = tDead }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
end

function PriestKnight(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(32)
    local LockedOn = UnitExists("target")
    local _1,potcd

    if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
   end

   if (PctH("player")<.70) and (potcd == 0) then
      UseAction(potslot)
      return
   end
    
    i=i+1; Skill[i] = { name = "Heal",               use = (PctH("player") < .50) }
    i=i+1; Skill[i] = { name = "Urgent Heal",        use = (PctH("player") < .70) }
    i=i+1; Skill[i] = { name = "Regenerate",         use = ((PctH("player") < .80)and (not string.find(pbuffs, "Regenerate"))) }
    i=i+1; Skill[i] = { name = "Wave Armor",         use = (not string.find(pbuffs,"Wave Armor")) }
    i=i+1; Skill[i] = { name = "Bone Chill",         use = ((not friendly) and (not string.find(tbuffs, "Bone Chill"))) }
    i=i+1; Skill[i] = { name = "Chain of Light",         use = ((not friendly) and (string.find(pbuffs,"Wave Armor"))) }
    i=i+1; Skill[i] = { name = "Rising Tide",        use = (not friendly) }
    i=i+1; Skill[i] = { name = "Attack",             use = tDead }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
end

function PriestWarrior(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(32)
    local LockedOn = UnitExists("target")
    local _1,potcd

    if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
  end

   if (PctM("player")<.50) and (potcd == 0) then
      UseAction(potslot)
     return
   end
    
    i=i+1; Skill[i] = { name = "Holy Aura",           use = (PctH("player") <= .20) }
    i=i+1; Skill[i] = { name = "Soul Source",           use = (PctH("player") <= .25) }
    i=i+1; Skill[i] = { name = "Defensive Formation",use = ((not friendly) and (PctH("player") <= .55) and (not string.find(pbuffs,"Defensive Formation"))) }
    i=i+1; Skill[i] = { name = "Berserk",               use = ((not friendly) and (PctH("player") <= .60) and (not string.find(pbuffs,"Berserk"))) }
    i=i+1; Skill[i] = { name = "Heal",               use = (PctH("player") < .50) }
    i=i+1; Skill[i] = { name = "Urgent Heal",        use = (PctH("player") < .70) }
    i=i+1; Skill[i] = { name = "Regenerate",         use = ((PctH("player") < .80) and (not string.find(pbuffs, "Regenerate"))) }
    i=i+1; Skill[i] = { name = "Wave Armor",         use = ((combat) and (not string.find(pbuffs,"Wave Armor")) and (rage >= 200)) }
    i=i+1; Skill[i] = { name = "Battle Monk Stance", use = ((combat) and (not string.find(pbuffs,"Battle Monk Stance"))) }
--    i=i+1; Skill[i] = { name = "Ice Fog",               use = ((not friendly) and (not string.find(tbuffs, "Ice Fog I")) and (not melee)) }
    i=i+1; Skill[i] = { name = "Bone Chill",         use = ((not friendly) and (not string.find(tbuffs, "Bone Chill")) and (rage >= 100) and (PctH("target") > .50)) }
    i=i+1; Skill[i] = { name = "Enraged",            use = (energy < 50) }
--    i=i+1; Skill[i] = { name = "Chain of Light",     use = ((not friendly) and (string.find(pbuffs,"Wave Armor"))) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (energy >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
    i=i+1; Skill[i] = { name = "Whirlwind",          use = ((not friendly) and (energy >= 50)) }
    i=i+1; Skill[i] = { name = "Slash",              use = ((not friendly) and (energy >= 25)) }
--    i=i+1; Skill[i] = { name = "Rising Tide",        use = ((not friendly) and (rage >= 40) and (not melee))}
    i=i+1; Skill[i] = { name = "Fighting Spirit Combination",      use = ((not friendly) and (combat)) }
    i=i+1; Skill[i] = { name = "Explosion of Fighting Spirit",      use = ((not friendly) and (combat)) }
    i=i+1; Skill[i] = { name = "Attack",              use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Attack",             use = tDead }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
end

function RogueScout(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(32)
    local LockedOn = UnitExists("target")
    local _1,potcd

    if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
   end

   if (PctH("player")<.70) and (potcd == 0) then
      UseAction(potslot)
      return
   end
        
    i=i+1; Skill[i] = { name = "Poison",               use = ((not string.find(pbuffs, "Poisonous") and (not combat))) }
      i=i+1; Skill[i] = { name = "Premeditation",      use = ((not friendly) and (not string.find(pbuffs,"Premeditation") and (not combat))) }
    i=i+1; Skill[i] = { name = "Assassins Rage",     use = (not friendly) }
    i=i+1; Skill[i] = { name = "Shot",                 use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Vampire Arrows",     use = ((not friendly) and (not string.find(tbuffs,"Vampire Arrows")) and (not melee)) }
--    i=i+1; Skill[i] = { name = "Shadow Step",        use = ((not front) and (not friendly) and (not melee)) }
--    i=i+1; Skill[i] = { name = "Blind Spot",         use = ((not front) and (not friendly) and (rage >=30)) }
    i=i+1; Skill[i] = { name = "Wrist Attack",       use = ((not friendly) and (not string.find(tbuffs,"Wrist Attack"))) }
    i=i+1; Skill[i] = { name = "Blind Stab",         use = (front and (not friendly) and (not string.find(tbuffs,"Blind"))) }
    i=i+1; Skill[i] = { name = "Joint Blow",         use = ((not friendly) and (not string.find(tbuffs,"Slow"))) }
    i=i+1; Skill[i] = { name = "Vampire Arrows",     use = ((not friendly) and (not string.find(tbuffs,"Vampire Arrows"))) }
    i=i+1; Skill[i] = { name = "Wound Attack",        use = ((not friendly) and (rage >=35) and string.find(tbuffs,"Bleed") and string.find(tbuffs,"Grievous Wound")) }
    i=i+1; Skill[i] = { name = "Low Blow",           use = ((not friendly) and (rage >=35) and string.find(tbuffs,"Bleed")) }
    i=i+1; Skill[i] = { name = "Shadowstab",         use = ((not friendly) and (rage >=35)) }
    i=i+1; Skill[i] = { name = "Shot",                 use = (not friendly) }
    i=i+1; Skill[i] = { name = "Attack",              use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Shadowstab",         use = (not friendly) }
    i=i+1; Skill[i] = { name = "Attack",             use = tDead }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end    
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
end

1,136

Sunday, October 3rd 2010, 2:03am

Lucky Chance and DIYCE. I haven't even tried yet, but will DIYCE even recognize the cool down of the Lucky Chance spells? Cause I am thinking that calling ExtraAction 1will just spam that button. Or will I have to use a timer. Anyone know?

1,137

Tuesday, October 5th 2010, 1:43am

need help please

I'm having a problem getting my diyce to work. I have diyce in its own file, I have my file that I will paste in at the bottom and I have the toc with all in same directory. my pots are in slot 7 for both chars and my mana pots are in slot 8. When I hit the button nothing happens, nothing happens any time i hit the button even if I'm damaged, during battle, out of battle etc. please help

my macro:

Quoted

/run MageDruid("v2","")

but I've also tried /run MageDruid(),/run MageDruid("v2")

my toc file looks like this:

Quoted

DIYCE.lua
MageDruid.lua
my MageDruid.lua looks like this:


Quoted

function MageDruid(arg1, arg2)
local Skill = {}
local i = 0
local health = PctH("player")
local mana = PctM("player")
local friendly = (not UnitCanAttack("player", "target"))
local combat = GetPlayerCombatState()
local interrupt_list = "/Fireball/Thunderstorm/Spell of Doom/Poison/"
local tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local isboss = (UnitSex("target") >= 2) -- tests to see if enemy is an elite or better
local LockedOn = UnitExists("target")
-- Heals
i=i+1; Skill = { ['name'] = "Action: 7", ['use'] = (health <= .50) } -- Health Potion in Slot 2
i=i+1; Skill[i] = { ['name'] = "Action: 8", ['use'] = (mana <= .50) } -- Mana Potion in Slot 3
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = ((health <= .70) and (not string.find(pbuffs,"Recover")))
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = (health <= .35) }
-- Buffs
i=i+1; Skill[i] = { ['name'] = "Perception", ['use'] = (not string.find(pbuffs,"Perception")) } -- Mage/Druid Elite 15
i=i+1; Skill[i] = { ['name'] = "Magic Target", ['use'] = (not combat and not string.find(pbuffs,"Magic Target")) } -- Mage/Druid Elite 20
i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = (not combat and not string.find(pbuffs,"Savage Blessing")) } -- May want to take this out since physical accuracy is mostly useless for you
i=i+1; Skill[i] = { ['name'] = "Fire Ward", ['use'] = (not string.find(pbuffs,"Fire Ward")) }
i=i+1; Skill[i] = { ['name'] = "Electrostatic Charge", ['use'] = (not string.find(pbuffs,"Electrostatic Charge")) }
i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection", ['use'] = ((health <= .40) and (not string.find(pbuffs,"Electrostatic Charge"))) } -- In case Electrostatic Charge is still on cooldown and you're getting hit hard
i=i+1; Skill[i] = { ['name'] = "Elemental Catalysis", ['use'] = (not string.find(pbuffs,"Elemental Catalysis")) }
i=i+1; Skill[i] = { ['name'] = "Intensification", ['use'] = (not string.find(pbuffs,"Intensification")) }
-- Ranged Attack
i=i+1; Skill[i] = { ['name'] = "Silence", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (mana >= .05)) }
i=i+1; Skill[i] = { ['name'] = "Flame", ['use'] = ((not friendly) and (PctH("target") >= .20)) }
i=i+1; Skill[i] = { ['name'] = "Lightning", ['use'] = (not string.find(tbuffs,"Lightning")) }
i=i+1; Skill[i] = { ['name'] = "Plasma Arrow", ['use'] = (not string.find(pbuffs,"Charged")) }
i=i+1; Skill[i] = { ['name'] = "Meteor Shower", ['use'] = (combat and string.find(tbuffs,"Lightning")) }
i=i+1; Skill[i] = { ['name'] = "Fireball", ['use'] = ((not friendly) and (PctH("target") <= .20)) }
-- Loot or interact with NPC
i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (tDead or (not combat and not enemy)) }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end

if (not LockedOn) then
TargetNearestEnemy()
end
end
function DebuffList(tgt)
local cnt = 1
local buffstr = "/"
local buff = UnitDebuff(tgt,cnt)
while buff ~= nil do
buffstr = buffstr..buff.."/"
cnt = cnt + 1
buff = UnitDebuff(tgt,cnt)
end
return string.gsub(buffstr, "(%()(.)(%))", "%2")
end
function NaturesBuff()
local cnt = 1
local buff, icon, power = UnitBuffInfo("player",cnt)
while buff ~= nil do
if buff == "Nature's Power" then
return power
end
cnt = cnt + 1
buff, icon, power = UnitBuffInfo("player",cnt)
end
return 0
end
function DruidMage(arg1,arg2)
local Skill = {}
local i = 0
local health = PctH("player")
local mana = PctM("player")
local friendly = (not UnitCanAttack("player", "target"))
local combat = GetPlayerCombatState()
local interrupt_list = "/Fireball/Thunderstorm/Spell of Doom/Poison/"
local tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local dbuffs = DebuffList("player")
local tbuffs = BuffList("target")
local isboss = (UnitSex("target") >= 2) -- tests to see if enemy is an elite or better
local npower = NaturesBuff()
local LockedOn = UnitExists("target")
-- Heals & Mana
i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection", ['use'] = (health <= .30) }
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = (health <= .40) }
i=i+1; Skill[i] = { ['name'] = "Curing Seed", ['use'] = (health <= .50) }
i=i+1; Skill[i] = { ['name'] = "Restore Life", ['use'] = ((health <= .60) and (npower <=2))} -- use this ahead of Recover if low on Natures Power
i=i+1; Skill[i] = { ['name'] = "Action: 7", ['use'] = (health <= .50) } -- Health Potion in Slot 2
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = ((health <= .60) and (not string.find(pbuffs,"Recover"))) }
i=i+1; Skill[i] = { ['name'] = "Action: 8", ['use'] = (mana <= .50) } -- Mana Potion in Slot 3
i=i+1; Skill[i] = { ['name'] = "Antidote", ['use'] = (string.find(dbuffs,"Poison")) }
i=i+1; Skill[i] = { ['name'] = "Purify", ['use'] = (string.find(dbuffs,"Curse")) }
i=i+1; Skill[i] = { ['name'] = "Blossoming Life", ['use'] = ((health <= .80) and (not string.find(pbuffs,"Blossoming Life"))) }
-- Buffs
i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = (not combat and not string.find(pbuffs,"Savage Blessing")) }
i=i+1; Skill[i] = { ['name'] = "Concentration Prayer", ['use'] = (not combat and not string.find(pbuffs,"Concentration Prayer")) }
i=i+1; Skill[i] = { ['name'] = "Fire Ward", ['use'] = (not string.find(pbuffs,"Fire Ward")) }
i=i+1; Skill[i] = { ['name'] = "Intensification", ['use'] = (not string.find(pbuffs,"Intensification")) }
-- Ranged Attack
i=i+1; Skill[i] = { ['name'] = "Binding Silence", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (mana >= .05)) }
i=i+1; Skill[i] = { ['name'] = "Silence", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (mana >= .05)) }
i=i+1; Skill[i] = { ['name'] = "Briar Entwinement", ['use'] = (not string.find(tbuffs,"Briar Entwinement")) }
i=i+1; Skill[i] = { ['name'] = "Weakening Seed", ['use'] = ((not string.find(tbuffs,"Weakening Seed")) and (npower >= 3)) }
i=i+1; Skill[i] = { ['name'] = "Lightning", ['use'] = (not string.find(tbuffs,"Lightning")) }
i=i+1; Skill[i] = { ['name'] = "Fireball", ['use'] = ((not friendly) and (PctH("target") <= .20)) }
i=i+1; Skill[i] = { ['name'] = "Rockslide", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Earth Arrow", ['use'] = (not friendly) }
--Loot or interact with NPC
i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (tDead or (not combat and not enemy)) }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end

if (not LockedOn) then
TargetNearestEnemy()
end
end

1,138

Tuesday, October 5th 2010, 5:04am

Are you receiving any error messages? I would guess something like "MageDruid:38:attempt to compare value with nil"... simply you're missing this line in both your functions

Source code

1
local tDead = UnitIsDeadOrGhost("target")
Now, there may be a deeper problem underlying here, but that's all I could see in my brief review.

P.S. For neatness sake, if you use [[CODE]] tags instead of [

Quoted

] tags, then the leading spaces don't get removed.

Quoted


1,139

Tuesday, October 5th 2010, 10:54pm

Finding the class of an opponent

I did some searching but was unable to find a function that would return the class of your target. Is there a function to do this? I was thinking of making the DIYCE do certain actions based on the class of an opponent. Silence mages, blind warriors etc.

Thanks in advance for any help with this.