You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

121

Wednesday, November 9th 2011, 12:15pm

@lordmohg:

Source code

1
2
                { name = "PriestFairySequence()",    use = (not combat) },
                { name = "BuffParty(22)",    use = (true) },

Unfortunately, you can't call functions in that way. Though modification of DIYCE could be done to have it do something like it, some trickery would be needed to get the parameter lists. So not a simple modification I'm afraid (though it may be worth considering).

@Ghostwolf: Mwaahahaha! The eeevil plan is working...<rubs hands together> good, good!
2013... The year from hell....

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

122

Wednesday, November 9th 2011, 3:01pm

@Skodziro,

Skill needs to be changed to Skill2.

You need to read the OP in full to understand why that needs to be done. :\

123

Wednesday, November 9th 2011, 4:26pm

change "skill on skill2" gave no further does not want to use the "snipe" when a buff "Hidden Peril"

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

124

Wednesday, November 9th 2011, 4:32pm

Do you get any errors? o.O

125

Wednesday, November 9th 2011, 4:43pm

not diyce next in the queue uses the "shot"

126

Wednesday, November 9th 2011, 6:09pm

I found that my problem by diyce did not want to work, but now I have another problem because instead of trying to buff the name, enter its ID number.

This work

Source code

1
2
3
4
5
6
7
8
9
10
11
-- Combat
                if enemy then
                Skill2 = {
                
				{ name = "Action: 7 (Hidden Peril)",             use = (true) },
				{ name = "Action: 15 (Snipe)",             use = (ChkBuff("player","Hidden Peril")) },
				{ name = "Action: 20 (Autoshot)",             use = ((boss) and (not ASon)) },
                { name = "Action: 5 (Shot)",              use = (true) },
				{ name = "Combo Shot",                          use = (true) },
    }
    end


but this not work

Source code

1
2
3
4
5
6
7
8
9
10
11
-- Combat
                if enemy then
                Skill2 = {
                
				{ name = "Action: 7 (Hidden Peril)",             use = (true) },
				{ name = "Action: 15 (Snipe)",             use = (ChkBuff("player","504588")) },
				{ name = "Action: 20 (Autoshot)",             use = ((boss) and (not ASon)) },
                { name = "Action: 5 (Shot)",              use = (true) },
				{ name = "Combo Shot",                          use = (true) },
    }
    end

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

127

Wednesday, November 9th 2011, 6:47pm

Quoted from "Skodziro;481902"

I found that my problem by diyce did not want to work, but now I have another problem because instead of trying to buff the name, enter its ID number.

This work

Source code

1
2
3
4
5
6
7
8
9
10
11
-- Combat
                if enemy then
                Skill2 = {
                
				{ name = "Action: 7 (Hidden Peril)",             use = (true) },
				{ name = "Action: 15 (Snipe)",             use = (ChkBuff("player","Hidden Peril")) },
				{ name = "Action: 20 (Autoshot)",             use = ((boss) and (not ASon)) },
                { name = "Action: 5 (Shot)",              use = (true) },
				{ name = "Combo Shot",                          use = (true) },
    }
    end


but this not work

Source code

1
2
3
4
5
6
7
8
9
10
11
-- Combat
                if enemy then
                Skill2 = {
                
				{ name = "Action: 7 (Hidden Peril)",             use = (true) },
				{ name = "Action: 15 (Snipe)",             use = (ChkBuff("player","504588")) },
				{ name = "Action: 20 (Autoshot)",             use = ((boss) and (not ASon)) },
                { name = "Action: 5 (Shot)",              use = (true) },
				{ name = "Combo Shot",                          use = (true) },
    }
    end


I think part of your problem is that you are either mixing DIYCE and DIYCE 2.0 functions, or simply aren't using DIYCE 2.0.

The ChkBuff() function is not defined in DIYCE 2.0 but was a part of DIYCE. Further, ChkBuff doesn't use buff IDs so of course it will not recognize the ID. It would be looking for a buff called 504588. As there is no such buff, it fails.
2013... The year from hell....

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

128

Wednesday, November 9th 2011, 7:27pm

As skill list and buff name/id problems appear to be the main cause of headaches when creating a DIYCE sequence, here are a couple of functions to help in debugging these problems. Add the following to DIYCE:

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


To use, in KillSequence() add this right before the calls to MyCombat():

Source code

1
2
    DIYCE_DebugSkills(Skill)
    DIYCE_DebugSkills(Skill2)

This will display the skill list that KillSequence() is trying to use and the true/false value for each entry.

To see if the buff/debuff lists are what you expect, add these lines as well:

Source code

1
2
    DIYCE_DebugBuffList(pbuffs)
    DIYCE_DebugBuffList(tbuffs)

This will display the buffs/debuffs on yourself and your target, the IDs of the buff/debuff, time remaining, and stack size.

@Ghostwolf:
May want to add these to the base code.
2013... The year from hell....

129

Wednesday, November 9th 2011, 9:21pm

@ghostwolf small issue with PriestFairySequence. You have it as checking local combat but didn't have local combat set. I took it a step further than just setting a local and adding in if your in combat to cast last prayer for 1s cast pet. My changes are in bold. Play tested and works just fine

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function PriestFairySequence(arg1)
    local Skill = {}
    local Skill2 = {}
    local i = 0
    local FairyExists = UnitExists("playerpet")
    local FairyBuffs = BuffList("playerpet")
[B]    local combat = GetPlayerCombatState()[/B]
    
    --Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )

    --Summon Fairy
    if (not FairyExists) then
        if mainClass == "AUGUR" then
[B]            if combat then
                CastSpellByName("Last Prayer")
                    if (arg1 == "v1") then
                        Msg("- Quick Casting Pet", 0, 1, 1)
                    end
            end[/B]
            if subClass == "THIEF" then
@peryl thanks for the input. i decided to go in another direction and use a long macro.

Source code

1
 /run if (not PriestFairySequence()) then if (not BuffParty(14)) then KillSequence("",11,12) end end 

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

130

Wednesday, November 9th 2011, 11:16pm

@Peryl - I'll get to work on adding that into the .zip, thanks for writing that up. I really hope that helps people get through the problems they are having. (However, if they would just read the thread's first three pages in their entirety there would also be fewer errors.)

@lordmohg - Thanks, ill fix that as well!

As for using "Last Prayer", that is only able to be used by a P/K, and could be added to that section by any P/K who wishes to do so. (The spell is on a 2min CD, and some people would not want to waste that on calling their fairy. Thus without being able to turn it on/off, I don't want to force someone to use a 2min CD.)

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

131

Thursday, November 10th 2011, 1:05am

Version 2.2 uploaded, and main posts edited to match.

@Peryl - Your post is missing a "do". I added that code, with the ability to call the debug modes via arg1.

@Skodziro - Here is what my S/Wd code looks like. Take from it what you need, and edit to suit yourself. (Hadn't played mine in about 8 months, and forgot how awesome the combo can be!)

Add these lines to your global declarations section in CustomFunctions.lua

Source code

1
2
3
arrowTime = 0
SlotRWB = 16 --Action Bar Slot # for Rune War Bow
SlotMNB = 17 --Action Bar Slot # for your Main Bow
Then add this to your KillSequence function in the variables section

Source code

1
2
3
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(14)  -- # is your Autoshot slot number
    local _,_,_,_,RWB,_ = GetActionInfo( SlotRWB )
    local _,_,_,_,MNB,_ = GetActionInfo( SlotMNB )
This goes in the class combo section

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
            elseif mainClass == "RANGER" and subClass == "WARDEN" then
            
            --Ammo Check and Equip
                if GetCountInBagByName("Runic Thorn") > 0 then
                    UseItemByName("Runic Thorn")
                    return true
                end
                if GetInventoryItemDurable("player", 9) == 0 
                    and GetTime() - arrowTime > 2 then
                        if (not RWB) then
                            UseAction(SlotRWB)
                            return
                        end
                    UseEquipmentItem(10)
                    arrowTime = GetTime()
                    return true
                end
                if (not MNB) then
                    UseAction(SlotMNB)
                    return
                end
                
            --Potions and Buffs
            Skill = {
                { name = "Action: "..healthpot,            use = (phealth <= .70) },
                { 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)) },
                { name = "Blood Arrow",                    use = ((not combat or (phealth <= .45)) and (pbuffs['Blood Arrow'])) },
                { name = "Target Area",                    use = (tdead and (pbuffs['Target Area'])) },
                    }
            
            --Combat
                if enemy then
                Skill2 = {
                        { name = "Throat Attack",            use = melee and (silenceThis) },
                        { name = "Blood Arrow",                use = (phealth >= .95) and (not pbuffs['Blood Arrow']) and boss },
                        { name = "Target Area",                use = (EnergyBar1 >= 40) and (not pbuffs['Target Area']) and boss },
                        { name = "Concentration",            use = (not pbuffs['Concentration']) and boss },
                        { name = "Savage Power",            use = (pctEB2 >= .04) and boss },
                        { name = "Arrow of Essence",        use = (not pbuffs['Arrow of Essence']) and boss },
                        { name = "Snipe",                    use = (pbuffs['Hidden Peril']) },
                        { name = "Hidden Peril",            use = (EnergyBar1 >= 30) and (CD ("Snipe"))},
                        { name = "Autoshot",                use = (not ASon) },
                        { name = "Thorn Arrow",                use = (pctEB2 >= .12) },
                        { name = "Vampire Arrows",            use = true },
                        { name = "Combo Shot",                use = true },
                        { name = "Shoot",                    use = true },
                            }
                end

Place your Rune War Bow, and your Main Bow, on action bar slots, and change the numbers in the code to correspond to match where you place them. This code will swap to the RWB, make arrows, swap back to your main bow, and then continue down the skills lists.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

132

Thursday, November 10th 2011, 1:33am

Quoted from "ghostwolf82;482003"

@Peryl - Your post is missing a "do". I added that code, with the ability to call the debug modes via arg1.

D'oh! That's what I get for not actually testing the code in-game!

Bad Peryl! 50 lashings by rat-flail for you...

(for those who didn't get this last bit, it's a reference to a web comic. Specifically this one [animated version here] and is where my avatar comes from.
Warning to GM Hathore: Don't be a Krug! :D)
2013... The year from hell....

133

Thursday, November 10th 2011, 8:13am

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
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(20)  -- # 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
                
				 elseif mainClass == "RANGER" and subClass == "WARDEN" then
            
            --Ammo Check and Equip
                if GetCountInBagByName("Runic Thorn") > 0 then
                    UseItemByName("Runic Thorn")
                    return true
                end
                if GetInventoryItemDurable("player", 9) == 0 
                    and GetTime() - arrowTime > 2 then
                        if (not RWB) then
                            UseAction(SlotRWB)
                            return
                        end
                    UseEquipmentItem(10)
                    arrowTime = GetTime()
                    return true
                end
                if (not MNB) then
                    UseAction(SlotMNB)
                    return
                end
                
            --Potions and Buffs
            Skill = {
                { name = "Action: "..healthpot,            use = (phealth <= .70) },
                { 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)) },
                { name = "Blood Arrow",                    use = ((not combat or (phealth <= .45)) and (pbuffs['Blood Arrow'])) },
                { name = "Target Area",                    use = (tdead and (pbuffs['Target Area'])) },
                    }
            
            --Combat
                if enemy then
                Skill2 = {
                        { name = "Throat Attack",            use = melee and (silenceThis) },
                        { name = "Blood Arrow",                use = (phealth >= .95) and (not pbuffs['Blood Arrow']) and boss },
                        { name = "Target Area",                use = (EnergyBar1 >= 40) and (not pbuffs['Target Area']) and boss },
                        { name = "Concentration",            use = (not pbuffs['Concentration']) and boss },
                        { name = "Savage Power",            use = (pctEB2 >= .04) and boss },
                        { name = "Arrow of Essence",        use = (not pbuffs['Arrow of Essence']) and boss },
                        { name = "Snipe",                    use = (pbuffs['Hidden Peril']) },
                        { name = "Hidden Peril",            use = (EnergyBar1 >= 30) and (CD ("Snipe"))},
                        { name = "Autoshot",                use = (not ASon) },
                        { name = "Thorn Arrow",                use = (pctEB2 >= .12) },
                        { name = "Vampire Arrows",            use = true },
                        { name = "Combo Shot",                use = true },
                        { name = "Shoot",                    use = true },
                            }
                end
				
            --ADD MORE CLASS COMBOS HERE. 
            --USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS.
            --THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS.
            --DO NOT POST BELOW THE FOLLOWING "END" STATEMENT!
            end
    --End Player Skill Sequences
    
	if (arg1=="debugskills") then		--Used for printing the skill table, and true/false usability
		DIYCE_DebugSkills(Skill)
		DIYCE_DebugSkills(Skill2)
	elseif (arg1=="debugpbuffs") then	--Used for printing your buff names, and buffID
		DIYCE_DebugBuffList(pbuffs)
	elseif (arg1=="debugtbuffs") then	--Used for printing target buff names, and buffID
		DIYCE_DebugBuffList(tbuffs)
	elseif (arg1=="debugall") then		--Used for printing all of the above at the same time
		DIYCE_DebugSkills(Skill)
		DIYCE_DebugSkills(Skill2)
		DIYCE_DebugBuffList(pbuffs)
		DIYCE_DebugBuffList(tbuffs)
	end
	
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
        
    --Select Next Enemy
	if (tDead) then
		TargetUnit("")
		return
	end
	if mainClass == "RANGER" and (not party) then		--To keep scouts from pulling mobs without meaning to.
		if (not LockedOn) or (not enemy) then
			TargetNearestEnemy()
			return
		end
	elseif mainClass ~= "RANGER" then					--Let all other classes auto target.
		if (not LockedOn) or (not enemy) then
			TargetNearestEnemy()
			return
		end
	end
end


in my diyce are two mistakenly blocking performance of the functions and checking ID buff:

ABugCather displays such information:
[string'?']:19: bad argument#1 to 'pairs' (table expected, got nil),
[string'?']:169: attempt to call global 'PctM' (a nil value).

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

134

Thursday, November 10th 2011, 12:25pm

Quoted from "Skodziro;482052"

in my diyce are two mistakenly blocking performance of the functions and checking ID buff:

ABugCather displays such information:
[string'?']:19: bad argument#1 to 'pairs' (table expected, got nil),
[string'?']:169: attempt to call global 'PctM' (a nil value).



for the first, in the function DIYCE_DebugBuffList() change the for loop to this (it should be your line 19):

Source code

1
    for k,v in pairs( (buffList or {}) ) do

that should properly fix the first problem.

As for the second, I'm not sure since PctM should be defined by the base DIYCE code (it's in diyce.lua). Check to make sure that you didn't accidentally change the name of that function.
2013... The year from hell....

135

Thursday, November 10th 2011, 1:27pm

hey i have some problems my rogue/scout function ist not working.

i just want a simple bleed rotation.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
-Class: Rogue/Scout
            elseif mainClass == "THIEF" and subClass == "RANGER" then

 		--Combat
                if enemy then
		Skill2 = {
                { name = "Wound Attack",                       use = ((EnergyBar1 >= 35) and ((tbuffs[500654]) and (tbuffs[500704]))) },
                { 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']))) },
                
                
                }		
                end


i just added this to CustomFunctions.lua but nothing happen if i try to call the function with the macro

Source code

1
/run KillSequence()



maybe someone can help me :)

mrmisterwaa

Professional

Posts: 670

Location: Kuwait

  • Send private message

136

Thursday, November 10th 2011, 2:59pm

Source code

1
2
3
4
5
6
7
            if ((enemy) then
            Skill2 = {
                { name = "Wound Attack",                       use = ((EnergyBar1 >= 35) and ((tbuffs[500654]) and (tbuffs[500704]))) },
                { 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']))) },
                     }
            end


That looks like mine *cough*.

Please post your entire CustomFunctions.lua please.

137

Thursday, November 10th 2011, 4:06pm

Quoted from "mrmisterwaa;482082"

Source code

1
2
3
4
5
6
7
            if ((enemy) then
            Skill2 = {
                { name = "Wound Attack",                       use = ((EnergyBar1 >= 35) and ((tbuffs[500654]) and (tbuffs[500704]))) },
                { 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']))) },
                     }
            end


That looks like mine *cough*.

Please post your entire CustomFunctions.lua please.



yup ^^ thats urs :P
but i dont need all the other stuff, i prefer do use all buffs and stuff like that by my own.

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

 		--Combat
                if enemy then
		Skill2 = {
                { name = "Wound Attack",                       use = ((EnergyBar1 >= 35) and ((tbuffs[500654]) and (tbuffs[500704]))) },
                { 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']))) },
                
                
                }		
                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


thats the lua-file.


thx for help ^^

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

138

Thursday, November 10th 2011, 4:22pm

Change skill2 to skill for the r/s combo, see if that helps.

Also, to everyone: if you ate having problems getting something to work, just simply saying "my diyce isn't working" is not enough information for us to help you. Please look at what the error message is in game and try to fix it first, and if you can't then post what the error message says here (found next to the minimap, red button with a flashing green outer edge). If you have no error message, state that too. Be as specific with your problem as you possibly can be, as it will only help us to help you quicker.

139

Thursday, November 10th 2011, 4:23pm

Still have some problems with my s/wd dyce

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
 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, 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 phealth = PctH("player")
    local thealth = PctH("target")
    local LockedOn = UnitExists("target")
    local boss = UnitSex("target") > 2
    local elite = UnitSex("target") == 2
    local party = GetNumPartyMembers() >= 2
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(4)  -- # is your Autoshot slot number
  
  --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
        
    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: Scout/Warden
            if mainClass == "RANGER" and subClass == "WARDEN" then

-- Self Bufffs
            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
                Skill2 = {
                        { name = "Throat Attack",            use = melee and (silenceThis) },
                        { name = "Snipe",                    use = (pbuffs['Hidden Peril']) },
                        { name = "Hidden Peril",            use = (EnergyBar1 >= 30) and (CD ("Snipe"))},
                        { name = "Autoshot",                use = (not ASon) },
                        { name = "Thorn Arrow",                use = (pctEB2 >= .12) },
                        { name = "Vampire Arrows",            use = true },
                        { name = "Combo Shot",                use = true },
                        { name = "Shoot",                    use = true },
    }
    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
                
            --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 (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
        
    --Select Next Enemy
    if (tDead) then
        TargetUnit("")
        TargetNearestEnemy()
        return
    elseif (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
        return
    end
    
end 


When i pushing button with macro i only get Frost Arrow keep repeating cast. Please help. What im doing wrong? :mad:

140

Thursday, November 10th 2011, 8:02pm

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

local g_skill  = {}
local g_lastaction = ""

function Msg(outstr,a1,a2,a3)
	DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end

function ReadSkills()
	g_skill = {}
	local skillname,slot

	for page = 1,4 do
		slot = 1
		skillname = GetSkillDetail(page,slot)
		repeat
			local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot)
			if skillusable then
				g_skill[skillname] = { ['page'] = page, ['slot'] = slot }
			end
			slot = slot + 1
			skillname = GetSkillDetail(page,slot)
		until skillname == nil
	end
end

-- Read Skills on Log-In/Class Change/Level-Up
		local DIYCE_EventFrame = CreateUIComponent("Frame","DIYCE_EventFrame","UIParent")
			DIYCE_EventFrame:SetScripts("OnEvent", [=[ 
					if event == 'PLAYER_SKILLED_CHANGED' then
						ReadSkills()
						end
					]=] )
			DIYCE_EventFrame:RegisterEvent("PLAYER_SKILLED_CHANGED")

function PctH(tgt)
	return (UnitHealth(tgt)/UnitMaxHealth(tgt))
end

function PctM(tgt)
	return (UnitMana(tgt)/UnitMaxMana(tgt))
end

function PctS(tgt)
	return (UnitSkill(tgt)/UnitMaxSkill(tgt))
end

function CancelBuff(buffname)
	local i = 1
	local buff = UnitBuff("player",i)

	while buff ~= nil do
		if buff == buffname then
			CancelPlayerBuff(i)
			return true
		end

		i = i + 1
		buff = UnitBuff("player",i)
	end
	return false
end

function BuffList(tgt)
    local list = {}
    local buffcmd = UnitBuff
    local infocmd = UnitBuffLeftTime

    if UnitCanAttack("player",tgt) then
        buffcmd = UnitDebuff
        infocmd = UnitDebuffLeftTime
    end

    -- There is a max of 100 buffs/debuffs per unit apparently
    for i = 1,100 do
        local buff, _, stackSize, ID = buffcmd(tgt, i)
        local timeRemaining = infocmd(tgt,i)
        if buff then
            -- Ad to list by name
            list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining, id = ID }
            -- We also list by ID in case two different buffs/debuffs have the same name.
            list[ID] = {stack = stackSize, time = timeRemaining, name = buff:gsub("(%()(.)(%))", "%2") }
        else
            break
        end
    end

    return list
end

function CD(skillname)
	local firstskill = GetSkillDetail(2,1)
	if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then
		ReadSkills()
	end

	if g_skill[skillname] ~= nil then
		local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)
		return cd <= 0.4
	elseif skillname == nil then
		return false
	else
		Msg("Skill not available: "..skillname)		--Comment this line out if you do not wish to recieve this error message.
        return
	end
end

function MyCombat(Skill, arg1)
	local spell_name = UnitCastingTime("player")
	local talktome = ((arg1 == "v1") or (arg1 == "v2"))
	local action,actioncd,actiondef,actioncnt
	
	if spell_name ~= nil then
		if (arg1 == "v2") then Msg("- ['..spell_name..']", 0, 1, 1) end
		return true
	end

	for x,tbl in ipairs(Skill) do
		
	local useit = type(Skill[x].use) ~= "function" and Skill[x].use or (type(Skill[x].use) == "function" and Skill[x].use() or false)
		if useit then
			if string.find(Skill[x].name, "Action:") then
				action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(%d+)(.*)", "%3")))
				_1,actioncd = GetActionCooldown(action)
				actiondef,_1,actioncnt = GetActionInfo(action)
				if GetActionUsable(action) and (actioncd == 0) and (actiondef ~= nil) and (actioncnt > 0) then
					if talktome then Msg("- "..Skill[x].name) end
					UseAction(action)
					return true
				end
			elseif string.find(Skill[x].name, "Custom:") then
				action = string.gsub(Skill[x].name, "(Custom:)( *)(.*)", "%3")
				if CustomAction(action) then
					return true
				end
			elseif string.find(Skill[x].name, "Item:") then
				action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3")
				if talktome then Msg("- "..Skill[x].name) end
				UseItemByName(action)
				return true
			elseif CD(Skill[x].name) then
				if talktome then Msg("- "..Skill[x].name) end
				CastSpellByName(Skill[x].name)
				return true
			elseif string.find(Skill[x].name, "Pet Skill:") then
				action = string.gsub(Skill[x].name, "(Pet Skill:)( *)(%d+)(.*)", "%3")
					UsePetAction(action)
				if (arg1 == "v2") then Msg(Skill[x].name.." has been fully processed") end
				return true
			end
		end
	end
	if (arg1 == "v2") then Msg("- [IDLE]", 0, 1, 1) end
	
	return false
end

function CustomAction(action)
    if CD(action) then
        if IsShiftKeyDown() then Msg("- "..action) end
        g_lastaction = action
        CastSpellByName(action)
        return true
    else
        return false
    end
end

function BuffTimeLeft(tgt, buffname)
    local cnt = 1
	local buff = UnitBuff(tgt,cnt)

	while buff ~= nil do
		if string.find(buff,buffname) then
			return UnitBuffLeftTime(tgt,cnt)
		end
		cnt = cnt + 1
		buff = UnitBuff(tgt,cnt)
	end

	return 0
end

-function BuffParty(arg1,arg2)
--    arg1 = Quickbar slot # for targetable, instant-cast buff without a cooldown (eg. Amp Attack) for range checking.
--    arg2 = buff expiration time cutoff (in seconds) for refreshing buffs, default is 45 seconds.

    local selfbuffs = { "Soul Bond", "Enhanced Armor", "Holy Seal" }
    local groupbuffs = { "Grace of Life", "Amplified Attack", "Angel's Blessing", "Essence of Magic", "Magic Barrier", "Blessed Spring Water", "Fire Ward", "Savage Blessing", "Concentration Prayer", "Shadow Fury"  }

    local buffrefresh = arg2 or 45           -- Refresh buff time (seconds)
    local spell = UnitCastingTime("player")  -- Spell being cast?
    local vocal = IsShiftKeyDown()           -- Generate feedback if Shift key held

    if (spell ~= nil) then
        return
    end

    if vocal then Msg("- Checking self buffs on "..UnitName("player")) end
    for i,buff in ipairs(selfbuffs) do
        if (g_skill[buff] ~= nil) and CD(buff) and (BuffTimeLeft("player",buff) <= buffrefresh) then
            if vocal then Msg("- Casting "..buff.." on "..UnitName("player")) end
            TargetUnit("player")
            CastSpellByName(buff)
            return
        end
    end

    if vocal then Msg("- Checking group buffs on "..UnitName("player")) end
    for i,buff in ipairs(groupbuffs) do
        if (g_skill[buff] ~= nil) and CD(buff) and (BuffTimeLeft("player",buff) <= buffrefresh) then
            if vocal then Msg("- Casting "..buff.." on "..UnitName("player")) end
            TargetUnit("player")
            CastSpellByName(buff)
            return
        end
    end

    for num=1,GetNumPartyMembers()-1 do
        TargetUnit("party"..num)
        if GetActionUsable(arg1) and (UnitHealth("party"..num) > 0) then
            if vocal then Msg("- Checking group buffs on "..UnitName("party"..num)) end
            for i,buff in ipairs(groupbuffs) do
                if (g_skill[buff] ~= nil) and CD(buff) and (BuffTimeLeft("target",buff) <= buffrefresh) then
                    if UnitIsUnit("target","party"..num) then
                        if vocal then Msg("- Casting "..buff.." on "..UnitName("target")) end
                        CastSpellByName(buff)
                        return
                    else
                        if vocal then Msg("- Error: "..UnitName("target").." != "..UnitName("party"..num)) end
                    end
                end
            end
        else
            if vocal then Msg("- Player "..UnitName("party"..num).." out of range or dead.") end
        end
    end

    if vocal then Msg("- Nothing to do.") end
end


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
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 or {}) ) 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 or {}) ) do
        -- We ignore numbered entries because both the ID and name 
        -- are stored in the list. This avoids doubling the output.
        if type(k) ~= "number" then
            DEFAULT_CHAT_FRAME:AddMessage(SILVER.."  ['..WHITE..k..SILVER..']:  "..LTBLUE.."id: "..WHITE..v.id..LTBLUE.."  stack: "..WHITE..v.stack..LTBLUE.."  time: "..WHITE..v.time)
        end
    end
    
    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."----------")    
end

		
					

function 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(20)  -- # 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
                
            
                    
            --Combat
                if enemy then
                Skill2 = {
                { name = "Action: 7 (Hidden Peril)",             use = (true) },
				{ name = "Action: 15 (Snipe)",             use = (pbuffs['Hidden Peril']) },
				{ name = "Action: 20 (Autoshot)",             use = ((boss) and (not ASon)) },
                { name = "Action: 5 (Shot)",              use = (true) },
				{ name = "Combo 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" 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


ABugCather displays such information:
[string'?']:169: attempt to call global 'PctM' (a nil value).

but if I delete this line of diyce error occurs in the next line and concerns ("local PCTs pctEB2 = (" player ")") but again when I delete this line passes to the next error command.