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.

821

Wednesday, July 7th 2010, 1:27pm

Quoted from "baritonejohn;300789"

Hi,im getting an error message with my macro.this error message is the same as with my rogue macro i tried to make which makes we wonder.i copied macro from page 1 of this thread. The error message is ...
[string] "?"]: 188 '}' expected near ')' .


That error usually means you have too many closing parentheses on the same line.

Try this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function ScoutRogue(arg1)
    local Skill = {}
    local i=0
    local focus = UnitMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(2)

    i=i+1; Skill[i] = { name = "Autoshot",       use = ((not friendly) and (not ASon)) }
    i=i+1; Skill[i] = { name = "Combo Shot",     use = (not friendly) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >=30)) }
    i=i+1; Skill[i] = { name = "Shot",           use = (not friendly) }
    i=i+1; Skill[i] = { name = "Piercing Arrow", use = (not friendly) }
    i=i+1; Skill[i] = { name = "Wind Arrows",    use = ((not friendly) and (focus >=15)) }

    MyCombat(Skill,arg1)
end

822

Wednesday, July 7th 2010, 1:37pm

Quoted from "jgill33;300293"

Thanks for the suggestions, but I usually don't carry spare arrows with me and I still want to use the function if I don't have ammo and can't use Shot. However, I like the idea of equipping them if I have them, so how's this for an ammo check:


The only problem I can see with this is quivers have the word "Arrow" in them. So what you might try is putting a dollar sign at the end indicating the name ends with "Arrow". Like so:

Source code

1
if (string.find(name," Arrow$")) then

823

Wednesday, July 7th 2010, 2:05pm

Quoted from "blurterblurter;301562"

RE: Attempting to get a position relative to target.

This does seem to be testing the condition, any help appreciated


So as best I can tell, you're trying to code it so that if you are the target's target, then assume you're in front, otherwise assume you're in back... is that correct?

If so, I think it would be cleaner to establish that condition in a variable and then check that rather than trying to create a separate table and insert that into the Skill table.

Also, you need to add energy checks for all of the Rogue skills.

Lastly, your designations for Blind Stab and Blind Spot seem to be backwards. You listed "Action:54" as BStab but you're checking to see if the target has a Bleed, not Blind.

Try this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function RogueScout(arg1)
    local Skill = {}
    local i = 0
    local energy = UnitMana("player")
    local tbuffs = BuffList("target")
    local front = UnitIsUnit("player", "targettarget")
    local bleed = BuffTimeLeft("target","Bleed")
    local wound = BuffTimeLeft("target","Grievous Wound")
    
    if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then
        i=i+1;Skill[i]={name="Action:25(Shot)",  use=true}
        i=i+1;Skill[i]={name="Action:23(WA)",    use=((energy >= 35) and (wound > 1) and (bleed > 1))}
        i=i+1;Skill[i]={name="Action:22(LB)",    use=((energy >= 35) and (wound < 1) and (bleed > 1))}
        i=i+1;Skill[i]={name="Action:54(BStab)", use=(front and (energy >= 50) and (BuffTimeLeft("target","Blind") < 1))}
        i=i+1;Skill[i]={name="Action:29(BSpot)", use=((not front) and (energy >= 25) and (bleed < 1))}
        i=i+1;Skill[i]={name="Action:21(SS)",    use=((energy >= 35) and (bleed < 3))}
        i=i+1;Skill[i]={name="Action:26(Vamp)",  use=(BuffTimeLeft("target","Vampire Arrows") < 1)}
        i=i+1;Skill[i]={name="Action:30(Atk)",   use=true}
    end
    
    MyCombat(Skill,arg1)
end
Since you're checking the BuffTimeLeft on Bleed and Grievous Wound multiple times, I had it assign those values to variables instead of making it go through the target's debuffs that many additional times.

jgill33

Beginner

Posts: 0

Location: Falls Church, VA

  • Send private message

824

Wednesday, July 7th 2010, 2:18pm

Quoted from "Sixpax;301571"

The only problem I can see with this is quivers have the word "Arrow" in them.


I didn't realize that. Thanks for the fix!

825

Wednesday, July 7th 2010, 8:04pm

thanks Sixpax, working like a charm mate:

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
function RogueScout(arg1)
	local i = 0
	local Skill = {}
	local tbuffs = BuffList("target")
	local focus = UnitSkill("player")
	local energy = UnitMana("player")
	local blind = BuffTimeLeft("target","Blind")
	local bleed = BuffTimeLeft("target","Bleed")
	local front = UnitIsUnit("player","targettarget")
	local vamp = BuffTimeLeft("target","Vampire Arrows")
	local wound = BuffTimeLeft("target","Grievous Wound")
	if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then
		i=i+1;Skill[i]={name="Action:25(Shot)",  use=true}
		i=i+1;Skill[i]={name="Action:23(WA)",    use=((energy > 35) and (wound > 1) and (bleed > 1))}
		i=i+1;Skill[i]={name="Action:22(LB)",    use=((energy > 35) and (wound < 3) and (bleed > 2))}
		i=i+1;Skill[i]={name="Action:29(BSp)",   use=((energy > 35) and (bleed < 3) and (front))}
		i=i+1;Skill[i]={name="Action:54(BSt)",   use=((energy > 35) and (blind < 3) and (not front))}
		i=i+1;Skill[i]={name="Action:21(SS)",    use=((energy > 35) and (bleed < 3))}
		i=i+1;Skill[i]={name="Action:26(VA)",    use=((focus > 35) and (vamp < 3))}
		i=i+1;Skill[i]={name="Action:30(Atk)",   use=true}
	end
	MyCombat(Skill,arg1)
end

826

Thursday, July 8th 2010, 10:04am

this is the macro i first tried many times

Quoted from "Sixpax;301566"

That error usually means you have too many closing parentheses on the same line.

Try this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function ScoutRogue(arg1)
    local Skill = {}
    local i=0
    local focus = UnitMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(2)
 
    i=i+1; Skill[i] = { name = "Autoshot",       use = ((not friendly) and (not ASon)) }
    i=i+1; Skill[i] = { name = "Combo Shot",     use = (not friendly) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >=30)) }
    i=i+1; Skill[i] = { name = "Shot",           use = (not friendly) }
    i=i+1; Skill[i] = { name = "Piercing Arrow", use = (not friendly) }
    i=i+1; Skill[i] = { name = "Wind Arrows",    use = ((not friendly) and (focus >=15)) }
 
    MyCombat(Skill,arg1)
end

this is what i tried the first few times before adding all those parenthesis and whatnot as what i posted here. ..so let me make sure, i went to romcurse downloaded using there zip thingy then i just went into the lua and went to bottom and started writing code..sounds simple just wanna make sure. any other suggestions...thanks for your time!!

827

Thursday, July 8th 2010, 3:52pm

Quoted from "baritonejohn;302119"

this is what i tried the first few times before adding all those parenthesis and whatnot as what i posted here. ..so let me make sure, i went to romcurse downloaded using there zip thingy then i just went into the lua and went to bottom and started writing code..sounds simple just wanna make sure. any other suggestions...thanks for your time!!


That will work, just be aware that if I post an update to the code on curse.com and you install it, your added code will get erased. So keep a backup of your code somewhere safe.

The better option (although a bit harder to setup) is to keep your code in a separate folder from the DIYCE one. To do this, make a new folder in "Runes of Magic\Interface\Addons". Most people call it "MyFunctions". Copy the DIYCE.toc and DIYCE.lua (with your code) files into that new folder. Change the names to MyFunctions.toc and MyFunctions.lua. Use a text editor (like Notepad) to edit the MyFunctions.toc file and change the line inside to MyFunctions.lua, then edit the MyFunctions.lua file and delete everything except for your code. Finally, remove your code from the DIYCE.lua file (in the DIYCE folder).

828

Friday, July 9th 2010, 8:37am

I'm having some issues.I made some macros read this thread, and yday they worked fine.Now when I logged ingame I get no error when I run the maccro but nothing will happen.

This is my code.Worked fine yday.All I get is a : Skill not available : concentration message.But nothing else.I'm only lvl 27 and miss some skills but yday i just erased the msg saying I dont have the skill for less spam and it worked just fine.Now it tell me i dont have concentration only, not mentioning the other skills I lack :s
The weird part is that I have --ed the part with the Skill not available and i still get the Skill not available : concentration message
I also get the Reading class skill msgs at the begining.

EDIT: seems to be working now.Didnt do anything thou.Just restarted the game like 10 times -.-

829

Sunday, July 11th 2010, 4:04pm

i switched over from w/s to w/r. so i had to re-do my macro. i copied one from here. the problem im having, is im only level 35 on the rogue side, so im missing splitting chop. so i deleted out of the macro because i was getting yellow text spammed in my chat about it being missing. after deleting it, that seems ok. but the problem im having now is Keen Attack is being spammed in my chat now, about it being missing or not ready. i never got anything in my chat before when i was playing the w/s. how do i get rid of those warnings in my chat. its making it hard to see any chat from the group, when its being filled up with the warning as fast as i spam the macro. i could use a good macro from a end game raider if possible.

830

Monday, July 12th 2010, 1:48pm

Quoted from "venomous42;303813"

i switched over from w/s to w/r. so i had to re-do my macro. i copied one from here. the problem im having, is im only level 35 on the rogue side, so im missing splitting chop. so i deleted out of the macro because i was getting yellow text spammed in my chat about it being missing. after deleting it, that seems ok. but the problem im having now is Keen Attack is being spammed in my chat now, about it being missing or not ready. i never got anything in my chat before when i was playing the w/s. how do i get rid of those warnings in my chat. its making it hard to see any chat from the group, when its being filled up with the warning as fast as i spam the macro. i could use a good macro from a end game raider if possible.


The engine only generates the "Skill not available" message when it tries to actually use the skill, so you probably weren't seeing it before because some other skill that you do have was firing.

My advise is go through the function that you're using and comment out any attacks that you don't have. Just up a double dash in front of the line. That way once you do acquire the skill, you can just uncomment the line.

831

Monday, July 12th 2010, 3:01pm

question about this ...

First off... GREAT LITTLE ADD-ON!

I installed 1.4 and seem to be having problems with the following that I found on here:

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
function mage(arg1,arg2)
    local Skill = {}
    local i = 0
    local mana = UnitMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pbuffs = BuffList("player")
    local tgt = "player"

    if friendly then
        tgt = "target"
    end
    local health = PctH(tgt)

    i=i+1; Skill[i] = { ['name'] = "Intensification",            ['use'] = (not string.find(pbuffs,"Intensification")) }
    i=i+1; Skill[i] = { ['name'] = "Recover",                    ['use'] = (health <= .75) }
    i=i+1; Skill[i] = { ['name'] = "Electrostatic Charge",        ['use'] = (PctH("player") <= .60) }
    i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection",    ['use'] = (PctH("player") <= .50) }
    i=i+1; Skill[i] = { ['name'] = "Flame",                        ['use'] = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { ['name'] = "Fireball",                    ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Flame",                        ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Earth Pulse",                ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Purgatory Fire",            ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Lightning",                    ['use'] = (not friendly) }


    MyCombat(Skill,arg1)
end


what happens is the following:

- Intensification - will cast...
- Recover - is skipped because variable not met
- Electrostatic Charge - does not cast im guessing it is b/c of something with "local Health" not really sure what that is
- Mother Earth Protection - skipped (because I dont have it yet)
- Flame - Casts
- Fireball - Doesn't Cast
- Flame - Casts
- Earth Pulse - Doesnt Cast
- Purgatory Fire - Doesn't cast but it says on the screen I dont have that spell
- Lightning - Doesnt Cast

What I am trying to figure out is why Fireball, Earth Pulse and Lightning doesnt cast. just seems looks like it loops Flame and I'm clueless at this point

832

Monday, July 12th 2010, 3:41pm

Quoted

What I am trying to figure out is why Fireball, Earth Pulse and Lightning doesnt cast. just seems looks like it loops Flame and I'm clueless at this point


the way the addon works is this: every time you push the button it casts the first availible skill on the list, given the appropriate conditions. so every time your macro scans the skill list it says "oh flame is availible" and casts it. it doesnt just go and cast the spells in order
----------------------------
Artemis - Vexxx [60/50] S/Wd
----------------------------

833

Monday, July 12th 2010, 4:02pm

Made code for my daughter since she is playing a mage and found the same thing happens. Flame seems to be the only thing cast. What I found out is that the cool down time is faster than it takes for the spell to hit the target. So you can start casting the second spell before the first one hits the target.
How I fixed it was to go in this order, fireball, lightning, and flame and then have it skip the first two if the health of the mob is 100%.

She says it is better!.

Quoted from "zubris1205;304518"

First off... GREAT LITTLE ADD-ON!

What I am trying to figure out is why Fireball, Earth Pulse and Lightning doesnt cast. just seems looks like it loops Flame and I'm clueless at this point

834

Monday, July 12th 2010, 4:05pm

Quoted from "zubris1205;304518"

What I am trying to figure out is why Fireball, Earth Pulse and Lightning doesnt cast. just seems looks like it loops Flame and I'm clueless at this point


In addition to what redcrux posted, because the first Flame line is checking to see if the target's health is full, you have to wait for the initial Flame to land before running it again. Then it will skip that line (since the target took damage) and skip to Fireball. Nothing past the 2nd Flame line will run because Flame will always be ready to cast.

Give this one a try and see if it works better:

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
function mage(arg1,arg2)
    local Skill = {}
    local i = 0
    local mana = UnitMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pbuffs = BuffList("player")
    local phealth = PctH("player")
    local thealth = PctH("target")
    local health

    if friendly then
        health = thealth
    else
        health = phealth
    end

    i=i+1; Skill[i] = { name = "Intensification",           use = (not string.find(pbuffs,"Intensification")) }
    i=i+1; Skill[i] = { name = "Electrostatic Charge",      use = (phealth <= .60) }
    i=i+1; Skill[i] = { name = "Mother Earth's Protection", use = (health <= .50) }
    i=i+1; Skill[i] = { name = "Recover",                   use = (health <= .75) }
    i=i+1; Skill[i] = { name = "Flame",                     use = ((not friendly) and (thealth == 1)) }
    i=i+1; Skill[i] = { name = "Fireball",                  use = (not friendly) }
    i=i+1; Skill[i] = { name = "Earth Pulse",               use = (not friendly) }
    i=i+1; Skill[i] = { name = "Purgatory Fire",            use = (not friendly) }
    i=i+1; Skill[i] = { name = "Lightning",                 use = (not friendly) }
    i=i+1; Skill[i] = { name = "Flame",                     use = (not friendly) }

    MyCombat(Skill,arg1)
end

835

Monday, July 12th 2010, 4:59pm

Quoted from "Sixpax;304552"

In addition to what redcrux posted, because the first Flame line is checking to see if the target's health is full, you have to wait for the initial Flame to land before running it again. Then it will skip that line (since the target took damage) and skip to Fireball. Nothing past the 2nd Flame line will run because Flame will always be ready to cast.

Give this one a try and see if it works better:

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
function mage(arg1,arg2)
    local Skill = {}
    local i = 0
    local mana = UnitMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pbuffs = BuffList("player")
    local phealth = PctH("player")
    local thealth = PctH("target")
    local health

    if friendly then
        health = thealth
    else
        health = phealth
    end

    i=i+1; Skill[i] = { name = "Intensification",           use = (not string.find(pbuffs,"Intensification")) }
    i=i+1; Skill[i] = { name = "Electrostatic Charge",      use = (phealth <= .60) }
    i=i+1; Skill[i] = { name = "Mother Earth's Protection", use = (health <= .50) }
    i=i+1; Skill[i] = { name = "Recover",                   use = (health <= .75) }
    i=i+1; Skill[i] = { name = "Flame",                     use = ((not friendly) and (thealth == 1)) }
    i=i+1; Skill[i] = { name = "Fireball",                  use = (not friendly) }
    i=i+1; Skill[i] = { name = "Earth Pulse",               use = (not friendly) }
    i=i+1; Skill[i] = { name = "Purgatory Fire",            use = (not friendly) }
    i=i+1; Skill[i] = { name = "Lightning",                 use = (not friendly) }
    i=i+1; Skill[i] = { name = "Flame",                     use = (not friendly) }

    MyCombat(Skill,arg1)
end


Thank you... I see what you are talking about...

836

Monday, July 12th 2010, 9:08pm

Quoted from "Sixpax;304497"

The engine only generates the "Skill not available" message when it tries to actually use the skill, so you probably weren't seeing it before because some other skill that you do have was firing.

My advise is go through the function that you're using and comment out any attacks that you don't have. Just up a double dash in front of the line. That way once you do acquire the skill, you can just uncomment the line.


but the skill is not even in the macro i copied. thats what is messed up

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

837

Monday, July 12th 2010, 10:26pm

Quoted from "venomous42;304769"

but the skill is not even in the macro i copied. thats what is messed up


Check all the skills in your function, be sure that (1) you have that skill available on the class that is using the function and (2) that skill name is spelled/typed properly.

838

Monday, July 12th 2010, 10:55pm

Hi, this is awesome and I've been using it and really appreciate all the work done.

I was hoping I could get some help for a few things I was trying to do for my own custom prefs.

First of all I'm a rogue scout and I am using this:

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
function RogueScout(arg1, arg2)
    local Skill = {}
    local i = 0
    local energy = UnitMana("player")
    local focus = UnitSkill("player")
    local friendly = (not UnitCanAttack("player", "target"))
    local combat = GetPlayerCombatState()
    local tspell,ttime,telapsed = UnitCastingTime("target")
    local pbuffs = BuffList("player")
    local tbuffs = BuffList("target")

    i=i+1; Skill[i] = { name = "Throat Attack",  use = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (focus >= 15)) }
    i=i+1; Skill[i] = { name = "Combat Master",  use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
    i=i+1; Skill[i] = { name = "Sneak Attack",   use = ((not friendly) and (energy >= 30) and (arg2 == "behind") and (not combat)) }
    i=i+1; Skill[i] = { name = "Shot",           use = (not friendly) }
    i=i+1; Skill[i] = { name = "Wound Attack",   use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Bleed") and string.find(tbuffs, "Grievous Wound")) }
    i=i+1; Skill[i] = { name = "Low Blow",       use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Bleed")) }
    i=i+1; Skill[i] = { name = "Blind Spot",     use = ((not friendly) and (energy >= 25) and (arg2 == "behind")) }
    i=i+1; Skill[i] = { name = "Shadowstab",     use = ((not friendly) and (energy >= 35)) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) }

    MyCombat(Skill,arg1)
end


What I would like to do is add a function to it which in the first part, right after throat attack, it will check my range to the target and if it's greater than like 49 then it will cast Vampire Arrows and then Shot if VA is on CD, and I would also still like to leave VA and Shot at the bottom without the check so it will also use it in my DPS rotation while I'm closer than 49.

Second thing I would like to do: Is it possible to check if your target is an attackable Player and NOT and NPC (for a pvp server) and if so, make it only cast a spell if that's the case? For example, I'd like to add Shadow Prison in right after my Sneak Attack / Blind Spot, maybe even another line after that which will use Energy Theif if my energy goes below a certain amount + I'm in combat + I'm within 49 of my target.

If anyone can help me get this working, I'd very much appreciate it.

lokanu

Beginner

Posts: 14

Location: Classified.

  • Send private message

839

Monday, July 12th 2010, 11:32pm

Quoted from "shawnis;304858"

What I would like to do is add a function to it which in the first part, right after throat attack, it will check my range to the target and if it's greater than like 49 then it will cast Vampire Arrows and then Shot if VA is on CD, and I would also still like to leave VA and Shot at the bottom without the check so it will also use it in my DPS rotation while I'm closer than 49.


Range is too difficult to test accurately; you're better off not attempting it. The only method is to put a dummy skill on your hotbar and check if it's available or not (Icon is red or not). However, the icon can be red for other reasons then simply being out of range, thus not a good method.

Quoted from "shawnis;304858"

Second thing I would like to do: Is it possible to check if your target is an attackable Player and NOT and NPC (for a pvp server) and if so, make it only cast a spell if that's the case? For example, I'd like to add Shadow Prison in right after my Sneak Attack / Blind Spot, maybe even another line after that which will use Energy Theif if my energy goes below a certain amount + I'm in combat + I'm within 49 of my target.

If anyone can help me get this working, I'd very much appreciate it.

This condition should do the trick:

Source code

1
(UnitIsPlayer("target") and UnitCanAttack("player","target"))

That will evaluate to true if your target is an attackable player.

lokanu

Beginner

Posts: 14

Location: Classified.

  • Send private message

840

Monday, July 12th 2010, 11:46pm

Quoted from "Sixpax;304552"

In addition to what redcrux posted, because the first Flame line is checking to see if the target's health is full, you have to wait for the initial Flame to land before running it again. Then it will skip that line (since the target took damage) and skip to Fireball. Nothing past the 2nd Flame line will run because Flame will always be ready to cast.

Give this one a try and see if it works better:

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
function mage(arg1,arg2)
    local Skill = {}
    local i = 0
    local mana = UnitMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pbuffs = BuffList("player")
    local phealth = PctH("player")
    local thealth = PctH("target")
    local health

    if friendly then
        health = thealth
    else
        health = phealth
    end

    i=i+1; Skill[i] = { name = "Intensification",           use = (not string.find(pbuffs,"Intensification")) }
    i=i+1; Skill[i] = { name = "Electrostatic Charge",      use = (phealth <= .60) }
    i=i+1; Skill[i] = { name = "Mother Earth's Protection", use = (health <= .50) }
    i=i+1; Skill[i] = { name = "Recover",                   use = (health <= .75) }
    i=i+1; Skill[i] = { name = "Flame",                     use = ((not friendly) and (thealth == 1)) }
    i=i+1; Skill[i] = { name = "Fireball",                  use = (not friendly) }
    i=i+1; Skill[i] = { name = "Earth Pulse",               use = (not friendly) }
    i=i+1; Skill[i] = { name = "Purgatory Fire",            use = (not friendly) }
    i=i+1; Skill[i] = { name = "Lightning",                 use = (not friendly) }
    i=i+1; Skill[i] = { name = "Flame",                     use = (not friendly) }

    MyCombat(Skill,arg1)
end


Purgatory doesn't have a CD, so it shouldn't ever cast Lightning or Flame below the call because it's always available outside the GCD.

Also, be wary of putting AoE's into your rotation as you get into the habit of using this as a 1-button-spamall and you might draw unwanted attention from the AoE damage. I would stick with Flame(first hit), Fireball, Lightning, Flame and put Earth Pulse and Purgatory Fire on 2 other hotkeys. Earth Pulse also lowers your overall DpS output as a Mage (Better off spamming Flame) so best not to put in your normal rotation. Also don't discount Electric Bolt; it's outstanding dmg for a 1-second cast even if not leveled a lot.

Source code

1
i=i+1; Skill[i] = { ['name'] = "Electric Bolt",            ['use'] = ((not friendly) and (not string.find(tbuffs, "Electric Bolt"))) }


If you're interested in using it.