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

601

Friday, May 4th 2012, 8:45pm

Just wanted to mention, there is an easier way to comment out a section of code than commenting out each line. Lua has block comments using --[[ and --]]. So you could comment out that same code like this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--Select Next Enemy
--[[
  if (tDead) then
   TargetUnit('')
   return
  end
  if mainClass == 'MAGE' 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 ~= 'MAGE' then     --Let all other classes auto target.
   if (not LockedOn) or (not enemy) then
    TargetNearestEnemy()
    return
   end
  end
--]]

The really neat part of commenting it out like that is you can re-instate the code by merely adding a single dash to the open block comment part (turning --[[ into ---[[).
2013... The year from hell....

602

Saturday, May 5th 2012, 10:59am

Thank you both for the fast replies. Problem solved! :)

603

Saturday, May 5th 2012, 6:46pm

quick question

I've browsed through about 30 pages and I know there's a way to not target pets during sw but I can't seem to find it and looking at all the code, my eyes are going numb. Does anyone know the code to not target pets when in combat?
Reni ~ HolySaints~ ßouncyßallzz -70w/70wd/67s ~ Playing w/wd before the warrior trend started. Bigballzz 61p/50k/40s only because p/s owns all in SW.

604

Sunday, May 6th 2012, 2:15am

Hello, I'm absolutely new to diyce as I picked it up earlier this week. I read through approx half of the posts and I think I got it so far. However, I am stumped as I am getting this when using Killsequence for my S/R:

Source code

1
[String 'KillSequence ('','pve')'']:1: ')' expected near '<eof>'

I cannot figure out what I have done wrong. Here is What I have in my code if it is needed (ignore the s/wd part):

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

function DIYCE_DebugSkills(skillList)
    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."Skill List:")
    
    for i,v in ipairs(skillList) do
        DEFAULT_CHAT_FRAME:AddMessage(SILVER.."  ['..WHITE..i..SILVER..']: "..LTBLUE.."" "..WHITE..v.name..LTBLUE..""  use = "..WHITE..(v.use and "true" or "false"))
    end

    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."----------")
end

function DIYCE_DebugBuffList(buffList)
    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."Buff List:")
    
    for k,v in pairs(buffList) do
        -- We ignore numbered entries because both the ID and name 
        -- are stored in the list. This avoids doubling the output.
        if type(k) ~= "number" then
            DEFAULT_CHAT_FRAME:AddMessage(SILVER.."  ['..WHITE..k..SILVER..']:  "..LTBLUE.."id: "..WHITE..v.id..LTBLUE.."  stack: "..WHITE..v.stack..LTBLUE.."  time: "..WHITE..v.time)
        end
    end
    
    DEFAULT_CHAT_FRAME:AddMessage(GREEN.."----------")    
end

local silenceList = {
        ['Annihilation']     = true,
        ['King Bug Shock']     = true,
        ['Mana Rift']         = true,
        ['Dream of Gold']     = true,
        ['Flame']             = true,
        ['Flame Spell']     = true,
        ['Wave Bomb']         = true,
        ['Silence']         = true,
        ['Recover']         = true,
        ['Restore Life']     = true,
        ['Heal']             = true,
        ['Curing Shot']     = true,
        ['Leaves of Fire']     = true,
        ['Urgent Heal']     = true,
                    }

function KillSequence(arg1, mode)
--arg1 = "v1" or "v2" for debugging
--mode = "pve" or "pvp"
    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local EnergyBar1 = UnitMana("player")
    local EnergyBar2 = UnitSkill("player")
    local pctEB1 = PctM("player")
    local pctEB2 = PctS("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    local behind = (not UnitIsUnit("player", "targettarget"))
    local melee = GetActionUsable(13) -- # is your melee range spell slot number
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(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:Scout/Rogue
             if mainClass == "RANGER" and subClass == "THIEF" then

             --Potions and Buffs
             Skill = {
                 { name = "Archer's Glory",         use = (not pbuffs['Archer's Glory']) and (EnergyBar1 >=60) and boss },
                 { name = "Target Area",            use = (not pbuffs['Target Area']) and (EnergyBar1 >=90) and combat and boss },
                 { name = "Arrow of Essence",       use = (not pbuffs['Arrow of Essence']) and (not pbuffs['Archer's Glory']) and boss },
                     }

             --Combat
                  if enemy and (Mode == "pve") then
             Skill2 = {
                 { name = "Snipe",                  use = (CD['Snipe']) and boss },
                 { name = "Sapping Arrow",          use = (CD['Sapping Arrow']) and boss and elite },
                 { name = "Autoshot",               use = (not ASon) and boss and elite },
                 { name = "Vampire Arrows",         use = (CD['Vampire Arrows']) and (EnergyBar1 >=20) },
                 { name = "Piercing Arrow",         use = (CD['Piercing Arrow']) },
                 { name = "Combo Shot",             use = (CD['Combo Shot']) },
                 { name = "Shot",                   use = (CD['Shot']) },
                 { name = "Weak Spot",              use = (CD['Weak Spot']) and (EnergyBar1 >=30) },
                 { name = "Deadly Poison Bite",     use = (CD['Deadly Poison Bite']) and (EnergyBar1 >=30) and boss },
                 { name = "Reflected Shot",         use = (CD['Reflected Shot']) },
                      }
             --Combat
                 elseif enemy and (Mode == "pvp") then
             Skill2 = {
                 { name = "Neck Strike",            use = melee and (silenceThis) },
                 { name = "Throat Attack",          use = melee and (silenceThis) },
                 { name = "Detection",              use = (not pbuffs['Detection']) },
                 { name = "Piercing Arrow",         use = (CD['Piercing Arrow']) },
                 { name = "Vampire Arrow",          use = (CD['Vampire Arrow']) and (EnergyBar1 >=30) },
                 { name = "Shot",                   use = (CD['Shot']) },
                 { name = "Combo Shot",             use = (CD['Combo Shot']) },
                 { name = "Reflected Shot",         use = (CD['Reflected Shot']) },
                      }
             end

            --Class: Scout/Warden
            elseif mainClass == "RANGER" and subClass == "WARDEN" then
      
             --Potions and Buffs
            Skill = {
                { name = "Briar Shield",               use = (not pbuffs("Briar Shield")) },
                { name = "Entling Offering",           use = (not pbuffs("Entling Offering")) },
                { name = "Target Area",                use = (not pbuffs("Target Area")) and combat and boss and (EnergyBar1 >=90) },
                { name = "Archer's Glory",             use = (not pbuffs("Archer's Glory")) and (EnergyBar >=50) and boss },
                    }
            --Combat & PVE
                 if enemy and (mode == "pve") then
            Skill2 = {
                { name = "Snipe",                      use = (pbuffs("Hidden Peril")) },
                { name = "Autoshot",                   use = (not ASon) },
                { name = "Combo Shot",                 use = (CD("Combo Shot")) },
                { name = "Vampire Arrows",             use = (CD("Vampire Arrows")) and (EnergyBar1 >= 30) },
                { name = "Thorn Arrow",                use = (CD("Torn Arrow")) },
                { name = "Hidden Peril",               use = (CD("Hidden Peril") and (EnergyBar1 >= 30)) },
                { name = "Piercing Arrow",             use = (CD("Piercing Arrow")) },  
                { name = "Reflected Shot",             use = (CD("Reflected Shot")) }, 
                { name = "Shoot",                      use = (CD("Shoot")) },
                    }
            --Combat & PVP
            elseif enemy and (mode == "pvp") then
            Skill2 = {
                { name = "Neck Strike",                use = melee and (silenceThis) },
                { name = "Throat Stab",                use = melee and (silenceThis) },
                { name = "Detection",                  use = (not pbuffs("Detection")) },
                { name = "Snipe",                      use = (pbuffs("Hidden Peril")) },
                { name = "Piercing Arrow",             use = (CD("Piercing Arrow")) },
                { name = "Hidden Perril",              use = (CD("Hidden Perril") and (EnergyBar1 >=30)) },
                { name = "Vampire Arrows",             use = (CD("Vampire Arrows")) },
                { name = "Shot",                       use = (CD("Shot")) },
                { name = "Thorn Arrow",                use = (CD("Torn Arrow")) },
                { name = "Combo Shot",                 use = (CD("Combo Shot")) },
                { name = "Reflected Shot",             use = (CD("Reflected Shot")) },
                     }
            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


I greatly appreciate any help with this

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

605

Sunday, May 6th 2012, 5:13am

Quoted from "myfree090;528936"

Hello, I'm absolutely new to diyce as I picked it up earlier this week. I read through approx half of the posts and I think I got it so far. However, I am stumped as I am getting this when using Killsequence for my S/R:

Source code

1
[String 'KillSequence ('','pve')'']:1: ')' expected near '<eof>'


Based on this error message, I believe the problem is with the macro you use to run DIYCE in the first place. It looks like you have extraneous quotes at the end of the macro and/or missing a closing parenthesis. The macro should be something like this:

Source code

1
/run KillSequence("","pve")
2013... The year from hell....

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

606

Sunday, May 6th 2012, 5:28am

Quoted from "blitzclub06;528862"

quick question

I've browsed through about 30 pages and I know there's a way to not target pets during sw but I can't seem to find it and looking at all the code, my eyes are going numb. Does anyone know the code to not target pets when in combat?

Hehe... yeah it can do that.

I think there was something about that around page 59 or so, but you can also check out the macro I made for this, currently listed in the Useful Macros thread (look for the Targeting Macros section at the end of first post).

You'll need to re-work the indentation and remove the /run parts since it is in macro form, but the code itself would be effectively the same.
2013... The year from hell....

607

Sunday, May 6th 2012, 5:37am

Quoted from "Peryl;528725"

Just wanted to mention, there is an easier way to comment out a section of code than commenting out each line. Lua has block comments using --[[ and --]]. So you could comment out that same code like this:

The really neat part of commenting it out like that is you can re-instate the code by merely adding a single dash to the open block comment part (turning --[[ into ---[[).


What he said ^
Round here when that guy speaks, we listen ;)
-- Stagger - Osha - Eyeofthetempest --

M/R/W 72/52/51
Formerly M/D/S, M/R/D (The search for decent DPS in a post GCD RoM continues)

608

Sunday, May 6th 2012, 6:18am

Quoted from "Peryl;528960"

Hehe... yeah it can do that.

I think there was something about that around page 59 or so, but you can also check out the macro I made for this, currently listed in the Useful Macros thread (look for the Targeting Macros section at the end of first post).

You'll need to re-work the indentation and remove the /run parts since it is in macro form, but the code itself would be effectively the same.


TYVM, I will look into the macro for it. :)

609

Tuesday, May 8th 2012, 4:00am

For some reason I'm getting the message:
[string 'KillSequence()']=1:attempt to call global 'KillSequence' (a nil value)

with the only other message:
call ChatFrameChange's OnEvent, line: [string '?']:130: attempt to index global 'g_GFC_Page6' (a nil value)

which doesnt seems to have any relationship with DIYCE. can you guys help me?
also i tested it on another computer and there it works fine. whats up with that?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

610

Tuesday, May 8th 2012, 11:47am

Quoted from "bilalab;529250"

For some reason I'm getting the message:
[string 'KillSequence()']=1:attempt to call global 'KillSequence' (a nil value)

This is caused by the function not existing as far as Lua is concerned. Either you modified DIYCE incorrectly, or some other add-on recently added is causing trouble.

There is likely another error message, but sometimes the error message frame will not show it, or will skip the first error message. There used to be an add-on called A Bug Catcher that would allow you to see all the errors, but I don't think it is available on Curse or CurseForge anymore. Anyway, without an error message it is rather difficult to say what the problem might be.

Quoted from "bilalab;529250"


with the only other message:
call ChatFrameChange's OnEvent, line: [string '?']:130: attempt to index global 'g_GFC_Page6' (a nil value)

That error comes up from time to time. It is caused by a bug in the default chat frame, but doesn't appear to actually affect anything. You can ignore it.
2013... The year from hell....

611

Tuesday, May 8th 2012, 3:34pm

DIYCE is working correctly in one computer and the same code is giving that error message in the other computer. I also tried working DIYCE by removing all Addons except it but I still get the same message.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

612

Tuesday, May 8th 2012, 5:41pm

And once again, that message is saying that it (the game) doesn't know what the function KillSequence is. KillSequence is the start point for DIYCE. In short, the game is not loading the add-on.

Therefore, either DIYCE is not installed correctly, has been modified incorrectly, or something is interfering. This last seems unlikely if it is the only add-on so we are left with the first two possibilities.

The only other possible cause of this is if the macro itself is incorrect.
2013... The year from hell....

613

Tuesday, May 8th 2012, 6:57pm

so if im reading it correctly from the post about not targeting pets, the code in customfunctions.lua should look like this correct?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
 --Select Next Enemy    
   if (tDead) then
        TargetUnit("")
        return
    end
    if UnitIsPlayer("target") then 
        break 
    end 
    if not UnitIsPlayer("target") then 
        TargetUnit("") 
        return
    end
Reni ~ HolySaints~ ßouncyßallzz -70w/70wd/67s ~ Playing w/wd before the warrior trend started. Bigballzz 61p/50k/40s only because p/s owns all in SW.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

614

Tuesday, May 8th 2012, 8:55pm

Quoted from "blitzclub06;529378"

so if im reading it correctly from the post about not targeting pets, the code in customfunctions.lua should look like this correct?

Sort of. You want to actually select the next enemy, and since there is the possibility of getting a non-player, you want to do multiple attempts. So you'd end up with:

Source code

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

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


The if (tDead) then part is just clearing your target if it is dead. The for loop looks for a player enemy (tries 10 times) and exits the loop early if it found one. The last if statement is needed in case the loop couldn't find a player target after ten tries, whatever the current target is (if anything) isn't a player, so we clear it. The whole thing is wrapped in an if to ensure that we need a new target.
2013... The year from hell....

615

Wednesday, May 9th 2012, 3:10am

pets actually have no race. so I had modified the part where it checks for lvl 1 mobs and my current code looks like:

Source code

1
2
3
4
5
--Check for level 1 mobs and pets, if it is, drop target and acquire a new one.
    if (LockedOn and (UnitLevel("target") < 2) or (UnitRace("target") == nil)) then
        TargetNearestEnemy()
        return
    end


it seems to pass over pets before attacking an attackable person.
quick question is our debuffs also included in the pbuffs list already inbuilt in DIYCE?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

616

Wednesday, May 9th 2012, 3:33am

Quoted from "bilalab;529479"

quick question is our debuffs also included in the pbuffs list already inbuilt in DIYCE?

No they aren't. The function, though modified, is a holdover from Sixpax original DIYCE code and actually checks to see if if is getting a buff list for the target or the player. If it is the player, it retrieves the buffs only, if it is the target it retrieves debuffs only.

You could create a second function based on the first that retrieves both, or just the debuffs (see the BuffList function in DIYCE.lua).
2013... The year from hell....

617

Wednesday, May 9th 2012, 4:00pm

Quoted from "Peryl;529405"


Source code

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

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



Isn't modifying to search only for attackable players a bad thing? I mean wouldn't DIYCE stop working against mobs and flame towers with that piece of code attached to the targetting system?

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

618

Wednesday, May 9th 2012, 4:06pm

Quoted from "bilalab;529583"

Isn't modifying to search only for attackable players a bad thing? I mean wouldn't DIYCE stop working against mobs and flame towers with that piece of code attached to the targetting system?

That is in response to blitzclub06, which is what he wants. Doesn't mean you need to add it to your code.
2013... The year from hell....

619

Wednesday, May 9th 2012, 4:17pm

lol ur response time is awesome on this thread ;).
I'm just learning the various functions and just wanted to confirm the functions actually do what I think they do. UnitIsPlayer seems to target only players, but since you guys modified the targetting system globally using UnitIsPlayer I thought it might actually do something extra too :)

620

Wednesday, May 9th 2012, 6:20pm

Quoted from "bilalab;529583"

Isn't modifying to search only for attackable players a bad thing? I mean wouldn't DIYCE stop working against mobs and flame towers with that piece of code attached to the targetting system?


That is what happened. I incorporated that line into my diyce and it broke. It was quite funny actually, we were running rt diamond. I charged in and did 660k damage and nothing else and almost got the party wiped. I guess it was my fault because i didn't test it prior to running an instance.

So I guess my main question is, can I incorporate both targeting mobs and players only into my diyce or do I have to actually set up a macro for the player target only? This is the code that I have written into my diyce and when I wrote it in the diyce would no longer target mobs.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  --Select Next Enemy	if (tDead) then
		TargetUnit("")
		return
	end
	-- Try up to ten times to find an enemy player
    for i = 1,10 do
        TargetNearestEnemy()
        if UnitIsPlayer("target") then 
            break 
        end
    end 
    if not UnitIsPlayer("target") then 
        TargetUnit("") 
        return
    end
Reni ~ HolySaints~ ßouncyßallzz -70w/70wd/67s ~ Playing w/wd before the warrior trend started. Bigballzz 61p/50k/40s only because p/s owns all in SW.