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.

Damson

Beginner

Posts: 1

Location: Missouri

Occupation: Housewife/RoM Wife

  • Send private message

1,141

Thursday, October 7th 2010, 12:06am

function DruidScout(arg1)
local Skill = {}
local i = 0
local tgt = "player"
local friendly = false
local combat = GetPlayerCombatState()
if not UnitCanAttack("player","target") then
tgt = "target"
friendly = true
end
local health = PctH(tgt)
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local dbuffs = DebuffList("player")
i=i+1; Skill = { ['name'] = "Rock Protection", ['use'] = (PctH("player") <= .30) }
i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection", ['use'] = ((friendly) and (PctH(tgt) <= .30)) }
i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = ((not combat) and (friendly) and (not string.find(tbuffs,"Savage Blessing"))) }
i=i+1; Skill[i] = { ['name'] = "Concentration Prayer", ['use'] = ((not combat) and (not string.find(pbuffs,"Concentration Prayer"))) }
i=i+1; Skill[i] = { ['name'] = "Antidote", ['use'] = (string.find(dbuffs,"Poisoned")) }
i=i+1; Skill[i] = { ['name'] = "Curing Seed", ['use'] = ((not friendly) and (health <= .60) and (not string.find(pbuffs,"Curing Seed"))) }
i=i+1; Skill[i] = { ['name'] = "Curing Seed", ['use'] = ((friendly) and (health <= .60) and(not string.find(tbuffs,"Curing Seed"))) }
i=i+1; Skill[i] = { ['name'] = "Camellia Flower", ['use'] = ((not friendly) and (health <= .70) and (not string.find(pbuffs,"Camellia Flower"))) }
i=i+1; Skill[i] = { ['name'] = "Camellia Flower", ['use'] = ((friendly) and (health <= .70) and (not string.find(tbuffs,"Camellia Flower"))) }
i=i+1; Skill[i] = { ['name'] = "Blossoming Life", ['use'] = ((not friendly) and (health <= .80) and (not string.find(pbuffs,"Blossoming Life"))) }
i=i+1; Skill[i] = { ['name'] = "Blossoming Life", ['use'] = ((friendly) and (health <= .80) and (not string.find(tbuffs,"Blossoming Life"))) }
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = ((((AbsHP("player")) > 2000) and (not string.find(pbuffs,"Life Guide"))) or ((friendly) and ((PctH(tgt)) <= .50) and (not string.find(tbuffs,"Recover")))) }
i=i+1; Skill[i] = { ['name'] = "Restore Life", ['use'] = ((friendly) and ((PctH(tgt)) <= .60)) }
i=i+1; Skill[i] = { ['name'] = "Briar Entwinement", ['use'] = ((not friendly) and (not string.find(tbuffs,"Briar Entwinement"))) }
i=i+1; Skill[i] = { ['name'] = "Earth Arrow", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Camellia Flower", ['use'] = (friendly) }
i=i+1; Skill[i] = { ['name'] = "Weakening Seed", ['use'] = ((not friendly) and (ChkBuff(tgt,"Weakening Seed"))) }
-- i=i+1; Skill[i] = { ['name'] = "Binding Silence", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end

function DebuffList(tgt)
local cnt = 1
local buffcmd = UnitDebuff
local buffstr = "/"
if UnitCanAttack("player",tgt) then
buffcmd = UnitBuff
end
local buff = buffcmd(tgt,cnt)
while buff ~= nil do
buffstr = buffstr..buff.."/"
cnt = cnt + 1
buff = buffcmd(tgt,cnt)
end
return string.gsub(buffstr, "(%()(.*)(%))", "%2")
end

I get the error [string '?']:207: attempt to call global 'AbsHp' (a nil value)
not sure what is wrong any help appreciated.

1,142

Thursday, October 7th 2010, 3:14am

Quoted from "Damson;344165"


I get the error [string '?']:207: attempt to call global 'AbsHp' (a nil value)
not sure what is wrong any help appreciated.


Means that you don't have the function AbsHP defined anywhere. Presumably you got the idea out of this thread somewhere, but don't actually have the function defined anywhere yourself.

and, fwiw

Source code

1
2
3
i=i+1; Skill[i] = { ['name'] = "Earth Arrow", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Camellia Flower", ['use'] = (friendly) }
i=i+1; Skill[i] = { ['name'] = "Weakening Seed", ['use'] = ((not friendly) and (ChkBuff(tgt,"Weakening Seed"))) }


Weakening seed will never be used here, because Earth Arrow has no cooldown. It is *always* castable, unless you're currently already casting something else.

Also, you're using the targets (the foes) health to determine whether to cast healing spells on yourself. Probably not a good move.

I'd recommend using the DIYCE healer stuff, falling back to a simpler "attack only" DIYCE function if no healing is needed.

Damson

Beginner

Posts: 1

Location: Missouri

Occupation: Housewife/RoM Wife

  • Send private message

1,143

Thursday, October 7th 2010, 4:19am

well i wanted to use the engine to help with healing better cause a macro is to much i guess..but was having problems with getting it set up..finally got it but then got the error in game so yeah..i can try and change it around butt not sure on how to do so...casue i copied the code from another druidscout that it worked on for him

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,144

Monday, October 11th 2010, 9:16am

An easier way to do healing than with this engine would be using the addon Healbot2, found on curse.com

1,145

Monday, October 11th 2010, 6:31pm

Assisting in DIYCE

Does anyone know how to assist in DIYCE. I know I can do like Use: Action Number and just have that be a macro that says /run AssistUnit().

However I would like to put AssistUnit right into the DIYCE function I just can't figure out how to.

Thanks.

1,146

Wednesday, October 13th 2010, 12:36am

Thats a bit off topic but i was looking some time now for a way to make combat engine work on other than english langue client version, and with a help of my friend we finaly found it.
http://konfiguracja.c0.pl/klawiatura/plitery-kody.html\
Above site shows codes for polish and german letters. Macro use codes from UTF-8 table.
Exmple how to write it in to macro:
i=i+1; Skill = { name = "Strza&#322;", use = (not friendly) } <-- Thats a "Shot" skill in polish. Now "&#322;" as a special letter cant be used by macro itself so to make it work on non english letters you need to write it in numbers.
i=i+1; Skill[i] = { name = "Strza\197\130", use = (not friendly) } <-- This is how to write it so macro will read special letters and will work correctly.
Hope that will help anyone :)


Now to the topic
I got a problem with scout/warden

i=i+1; Skill[i] = { name = "Snipe", use = ((not friendly) and (focus >= 30) and string.find(pbuffs, "Hidden Peril")) }
i=i+1; Skill[i] = { name = "Hidden Peril", use = ((not friendly) and (focus >= 30) and (not string.find(pbuffs, "Hidden Peril"))) }
This is a part of macro that i got works greate for first strike and for each 2nd rounds of entire macro but ther problem is that snipe got 15 sec cd and hidden peril 10 sec, now buff that hidden peril provide give snipe 1 sec cast time, but this buff last only 5 secounds that leave me 0 sec in secound turn of skill rotation to use snipe :/
Now is ther any way for hidden peril part to wait for snipe cd ?

1,147

Thursday, October 14th 2010, 8:49pm

was wondering if anyone could post the latest working Knight/Warrior macro's or atleast the page number so i dont have to look through 120 pages

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,148

Friday, October 15th 2010, 5:02am

Just do a search of this thread for Warrior/Knight

1,149

Sunday, October 17th 2010, 9:11pm

Quoted from "Damson;344211"

well i wanted to use the engine to help with healing better cause a macro is to much i guess..but was having problems with getting it set up..finally got it but then got the error in game so yeah..i can try and change it around butt not sure on how to do so...casue i copied the code from another druidscout that it worked on for him


Check the link in my sig on Party Healer functions. It's like a healing plugin for DIYCE and will monitor everyone's health and cast the best heal by priority. If you already have the DIYCE installed, it should be fairly easy to follow and add this to it. You'll just need to modify the healing section for your particular heal spells.

1,150

Sunday, October 17th 2010, 9:15pm

Quoted from "mrowka;345791"

Now to the topic
I got a problem with scout/warden

i=i+1; Skill = { name = "Snipe", use = ((not friendly) and (focus >= 30) and string.find(pbuffs, "Hidden Peril")) }
i=i+1; Skill[i] = { name = "Hidden Peril", use = ((not friendly) and (focus >= 30) and (not string.find(pbuffs, "Hidden Peril"))) }
This is a part of macro that i got works greate for first strike and for each 2nd rounds of entire macro but ther problem is that snipe got 15 sec cd and hidden peril 10 sec, now buff that hidden peril provide give snipe 1 sec cast time, but this buff last only 5 secounds that leave me 0 sec in secound turn of skill rotation to use snipe :/
Now is ther any way for hidden peril part to wait for snipe cd ?


Yes you can use CD("Snipe") to tell if Snipe is on cooldown or not. If that returns true, then Snipe is ready to fire. So modify your Hidden Peril line to be:

Source code

1
i=i+1; Skill[i] = { name = "Hidden Peril",  use = ((not friendly) and  (focus >= 30) and CD("Snipe") and (not string.find(pbuffs, "Hidden Peril"))) }

1,151

Monday, October 18th 2010, 5:31am

anything available for a Warden/Druid?
1ed39399-6d75-4778-8d8f-c281095d4514
1.03.01

1,152

Saturday, October 23rd 2010, 2:51am

After searching thread for knight/warrior functions and reading threw all 112 replys , again i want to say this , there is no working k/w macro in this entire thread. If Tigsman or anyone else could post a working k/w "threaten" with working mana return that would be awesome.

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,153

Sunday, October 24th 2010, 3:07am

Quoted from "Durelsh;349094"

After searching thread for knight/warrior functions and reading threw all 112 replys , again i want to say this , there is no working k/w macro in this entire thread. If Tigsman or anyone else could post a working k/w "threaten" with working mana return that would be awesome.


Here ya go. One for while in a party, and one while running solo. The solo one adds in hp potion usage, and no Hatred Strike as well as no Threaten. Since you will be the one killing it, you will have all the aggro. I have threaten in there, incase you choose to have it included in the code, just remove the double dash. Same for Disarmament. I use these very effectively :)

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
function KnightWarrior(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(32)
    local LockedOn = UnitExists("target")
    local _1,potcd
    
    if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
    end
  
    if (PctM("player")<.80) and (CD("Mana Return")) and (potcd == 0) then
      UseAction(potslot)
     return
   end
    
    i=i+1; Skill[i] = { name = "Holy Shield",            use = (PctH("player") <= .25) }
    i=i+1; Skill[i] = { name = "Resolution",            use = (PctH("player") <= .45) }
    i=i+1; Skill[i] = { name = "Berserk",              use = ((not friendly) and (PctH("player") <= .70) and (not string.find(pbuffs,"Defensive Formation")) and (not CD("Defensive Formation"))) }
    i=i+1; Skill[i] = { name = "Defensive Formation", use = ((not friendly) and (PctH("player") <= .70)) }
    i=i+1; Skill[i] = { name = "Enhanced Armor",       use = ((not string.find(pbuffs,"Enhanced Armor")) and (rage >= 120)) }
    i=i+1; Skill[i] = { name = "Holy Seal",            use = ((not string.find(pbuffs,"Holy Seal")) and (rage >= 30)) }
    i=i+1; Skill[i] = { name = "Shock",                     use = ((not friendly) and (rage >= 30) and (not melee) and (not CD("Charge"))) }
    i=i+1; Skill[i] = { name = "Charge",               use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Hatred Strike",          use = ((not friendly) and (rage >= 320) and (melee)) }
    i=i+1; Skill[i] = { name = "Disarmament",         use = ((not friendly) and (rage >= 150) and (melee) and (not string.find(tbuffs,"Disarmament IV"))) }
    i=i+1; Skill[i] = { name = "Whirlwind Shield",    use = ((not friendly) and (melee) and (rage >= 150)) }
    i=i+1; Skill[i] = { name = "Shield of Atonement", use = ((not friendly) and (melee) and (rage >= 30)) }
    i=i+1; Skill[i] = { name = "Holy Strike",         use = ((not friendly) and (rage >= 110) and (not string.find(tbuffs,"Light Seal III"))) }
    i=i+1; Skill[i] = { name = "Threaten",               use = ((not friendly) and (rage >= 200) and (string.find(tbuffs,"Holy Seals 3")) and (not string.find(pbuffs,"Threaten"))) }
    i=i+1; Skill[i] = { name = "Mana Return",         use = ((not friendly) and (string.find(tbuffs,"Holy Seals 3")) and (PctM("player")<.90)) }
    i=i+1; Skill[i] = { name = "Enraged",             use = (energy < 50) }
    i=i+1; Skill[i] = { name = "Whirlwind",           use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Slash",               use = ((not friendly) and (energy >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
    i=i+1; Skill[i] = { name = "Attack",               use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Slash",               use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Attack",              use = (tDead or (not combat and not enemy)) }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end    
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
    
    if LockedOn and (not enemy) then
        TargetNearestEnemy()
    end
end

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

   if (PctH("player")<.70) and (potcd == 0) then
      UseAction(potslot)
      return
   end
   
       if potslot2 ~= nil then
        _1,potcd=GetActionCooldown(potslot2)
    end
  
    if (PctM("player")<.80) and (CD("Mana Return")) and (potcd == 0) then
      UseAction(potslot2)
     return
   end
   
    i=i+1; Skill[i] = { name = "Holy Shield",            use = (PctH("player") <= .25) }
    i=i+1; Skill[i] = { name = "Resolution",            use = ((PctH("player") <= .45) and (rage >= 120)) }
    i=i+1; Skill[i] = { name = "Berserk",              use = ((not friendly) and (PctH("player") <= .70) and (not string.find(pbuffs,"Defensive Formation")) and (not CD("Defensive Formation"))) }
    i=i+1; Skill[i] = { name = "Defensive Formation", use = ((not friendly) and (PctH("player") <= .70)) }
    i=i+1; Skill[i] = { name = "Enhanced Armor",       use = ((not string.find(pbuffs,"Enhanced Armor")) and (rage >= 120)) }
    i=i+1; Skill[i] = { name = "Holy Seal",            use = ((not string.find(pbuffs,"Holy Seal")) and (rage >= 30)) }
    i=i+1; Skill[i] = { name = "Shock",                     use = ((not friendly) and (rage >= 30) and (not melee) and (not CD("Charge"))) }
    i=i+1; Skill[i] = { name = "Charge",               use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Whirlwind Shield",    use = ((not friendly) and (melee) and (rage >= 150)) }
    i=i+1; Skill[i] = { name = "Shield of Atonement", use = ((not friendly) and (melee) and (rage >= 30)) }
    i=i+1; Skill[i] = { name = "Holy Strike",         use = ((not friendly) and (rage >= 110) and (not string.find(tbuffs,"Light Seal III"))) }
    i=i+1; Skill[i] = { name = "Mana Return",         use = ((not friendly) and (string.find(tbuffs,"Holy Seals 3")) and (PctM("player")<.80)) }
    i=i+1; Skill[i] = { name = "Punishment",               use = ((not friendly) and (rage >= 110) and (string.find(tbuffs,"Light Seal III"))) }
    i=i+1; Skill[i] = { name = "Enraged",             use = (energy < 50) }
    i=i+1; Skill[i] = { name = "Whirlwind",           use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Slash",               use = ((not friendly) and (energy >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
    i=i+1; Skill[i] = { name = "Attack",               use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Slash",               use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Attack",              use = (tDead or (not combat and not enemy)) }
        
        MyCombat(Skill,arg1)
    
    if tDead then
        TargetNearestEnemy()
    end    
    
    if (not LockedOn) then
        TargetNearestEnemy()
    end
    
    if LockedOn and (not enemy) then
        TargetNearestEnemy()
    end
end
There are other code posts for K/W, I had to search for a place to start with mine. Anyways, there are posts in here somewhere for a different way to go about threaten and mana return to alternate between the two, but I chose to not go that route.

1,154

Sunday, October 24th 2010, 7:20am

Quoted from "ghostwolf82;342832"

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

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function WarriorRogue(arg1, potslot)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local friendly = (not UnitCanAttack("player", "target"))
    local enemy = (UnitCanAttack("player","target")) 
    local rage = UnitMana("player")
    local energy = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    [B]local melee = GetActionUsable(32)[/B]
    local LockedOn = UnitExists("target")
    local _1,potcd

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

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

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

1,155

Monday, October 25th 2010, 3:56am

ghostwolf you rock dude , seriously thx for taking the time out of your day to do that , its much appreciated!!!

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,156

Tuesday, October 26th 2010, 7:12am

@ Durelsh - No probs, glad to have helped someone. One of my earlier posts contains a lot of different class combos, have a look and see if it helps you out.

@ mephis2412 - I use whatever the best skill to use there is. When I have a rogue as either primary or secondary, I use Shadow Stab. On my P/W I use Explosion of Fighting Spirit. On my K/W I use Holy Strike. I find the best available melee range skill (Range: 50) attack, and put it there. Don't use Slash, because to be available this skill will need rage available, and therefore, if you have no rage, you are not melee range, however you may be standing right on the target.

I am updating my code as well to include the use of a mana, and a health potion, to be used within one function. However this could easily be changed to use two diff health pots, one with a 15 sec cooldown, and one with a minute cooldown.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if potslot ~= nil then
        _1,potcd=GetActionCooldown(potslot)
    end
  
   if (PctM("player")<.50) and (potcd == 0) then
      UseAction(potslot)
     return
   end

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

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


Also, my K/W is now lvl 52 after 10 days of working on him, and I realized upon hitting SL that I do NO damage in that zone...So I dropped 40 lvls worth of TP into Punishment to help increase my DPS. It kind of eats at the mana, and for the first time I see why a LOT of Knights do not make it past this area if this is your primary class. Here is how a rotation with Punishment would work:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
i=i+1; Skill[i] = { name = "Holy Shield",            use = (PctH("player") <= .25) }
    i=i+1; Skill[i] = { name = "Resolution",            use = (PctH("player") <= .45) }
    i=i+1; Skill[i] = { name = "Berserk",              use = ((not friendly) and (PctH("player") <= .70) and (not string.find(pbuffs,"Defensive Formation")) and (not CD("Defensive Formation"))) }
    i=i+1; Skill[i] = { name = "Defensive Formation", use = ((not friendly) and (PctH("player") <= .70)) }
    i=i+1; Skill[i] = { name = "Enhanced Armor",       use = (not string.find(pbuffs,"Enhanced Armor")) }
    i=i+1; Skill[i] = { name = "Holy Seal",            use = (not string.find(pbuffs,"Holy Seal")) }
    i=i+1; Skill[i] = { name = "Shock",                     use = ((not friendly) and (not melee) and (not CD("Charge"))) }
    i=i+1; Skill[i] = { name = "Charge",               use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Whirlwind Shield",    use = ((not friendly) and (melee)) }
    i=i+1; Skill[i] = { name = "Shield of Atonement", use = ((not friendly) and (melee)) }
    i=i+1; Skill[i] = { name = "Holy Strike",         use = ((not friendly) and (not string.find(tbuffs,"Light Seal III"))) }
    i=i+1; Skill[i] = { name = "Mana Return",         use = ((not friendly) and (string.find(tbuffs,"Holy Seals 3")) and (PctM("player")<.80)) }
    i=i+1; Skill[i] = { name = "Punishment",               use = ((not friendly) and (string.find(tbuffs,"Light Seal III"))) }
    i=i+1; Skill[i] = { name = "Enraged",             use = (rage < 50) }
    i=i+1; Skill[i] = { name = "Whirlwind",           use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Slash",               use = ((not friendly) and (energy >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
    i=i+1; Skill[i] = { name = "Attack",               use = ((not friendly) and (PctH("target") == 1)) }
    i=i+1; Skill[i] = { name = "Slash",               use = ((not friendly) and (energy >= 40)) }
    i=i+1; Skill[i] = { name = "Attack",              use = (tDead or (not combat and not enemy)) }


Just watch the mana, which is why my Mana Return is above punishment, this way I get mana back before taking a 6% chunk out of it again.

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,157

Wednesday, October 27th 2010, 9:05am

OK folks, I updated the code in post 1153 to reflect the changes I have also made, and am currently using. Now mana consumption is handled much better as this code allows for the usage of a health potion should you fall below a predetermined percentage, and for the usage of a mana potion should you fall below a predetermined amount AND your Mana Return skill is on cool-down. When running out of mana previously, I was getting errors that would let me know as such. Now it just skips those skills if you don't have the mana available. (EDIT: Just looking for that code that would use Threaten one time, and then Mana Return the next time. Then read someones post, and realized that the Seals on the target are not used with Threaten, they are only used with Mana return. So the way I have it set up works perfectly well, and will use threaten BEFORE Mana Return each time you have three seals on the target. Thus, you will always use Threaten and Mana Return in order, so long as the Threaten buff/debuff is not currently on you.)

Also fixed an error in the code I had previously not noticed, Enraged will now work properly. I had it listed as (rage < 50), it now reads (energy < 50). Secondary skills are always regarded to as "energy", doesnt matter what the class is, and primary class is always regarded to as "rage", also regardless of the class. (This applies to how the code is read only.)

Just reiterating this for those that choose to only read the last page or two and have not been following this thread from early on. I am finally going through and updating all my old code. Worked for so long, didn't feel a need to update it, but alas, there is always a reason coming up that makes us hardheaded people eventually join the "new & now". It wasn't broke, but it works better now anyways lol.

My functions I use for various class combination's can be found in post 1135. I will keep posting new functions as I create them.

1,158

Wednesday, October 27th 2010, 4:52pm

Hi & Gz to @ll who are working on this "addon"

I would like to mix in the same lua file :

Blueman0x76's function for R/W with daguer/axe swap :

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
g_skill = {}
 
function Msg(outstr,a1,a2,a3)
   DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end
 
function ReadSkills()
   g_skill = {}
   local skillname,slot
 
   Msg("- Reading Class Skills")
   for page = 2,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
ReadSkills() -- Read skills into g_skill table at login
 
function PctH(tgt)
   return (UnitHealth(tgt)/UnitMaxHealth(tgt))
end
 
function ChkBuff(tgt,buffname)
   local cnt = 1
   local buffcmd = UnitBuff
 
   if UnitCanAttack("player",tgt) then
      buffcmd = UnitDebuff
   end
   local buff = buffcmd(tgt,cnt)
 
   while buff ~= nil do
      if string.gsub(buff, "(%()(.)(%))", "%2") == buffname then
         return true
      end
      cnt = cnt + 1
      buff = buffcmd(tgt,cnt)
   end
   return false
end
 
function BuffList(tgt)
   local cnt = 1
   local buffcmd = UnitBuff
   local buffstr = "/"
 
   if UnitCanAttack("player",tgt) then
      buffcmd = UnitDebuff
   end
   local buff, icon, count, ID = buffcmd(tgt,cnt)
 
   while buff ~= nil do
      buffstr = buffstr..buff.."/"..ID.."/"
      cnt = cnt + 1
      buff, icon, count, ID  = buffcmd(tgt,cnt)
   end
 
   return string.gsub(buffstr, "(%()(.)(%))", "%2")
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
   else
      Msg("Skill not available: "..skillname)
      return false
   end
end
 
function MyCombat(Skill,arg1)
   local spell_name = UnitCastingTime("player")
   local talktome = false
 
   if (arg1 == "v1") or (arg1 == "v2") then
      talktome = true
   end
 
   if spell_name ~= nil then
      if (arg1 == "v2") then Msg("- ['..spell_name..']",0,1,1) end
      return false
   end
 
   for x,tbl in ipairs(Skill) do
      if CD(Skill[x].name) and Skill[x].use then
         if talktome then Msg("- "..Skill[x].name) end
         CastSpellByName(Skill[x].name)
         return true
      end
   end
   if (arg1 == "v2") then Msg("- IDLE") end
 
   return false
end
 
function MyCombatRW(Skill,arg1)
   local spell_name = UnitCastingTime("player")
   local talktome = false
   local _,_,mainhandname = GetInventoryItemDurable("player", 15)
 
   if (arg1 == "v1") or (arg1 == "v2") then
      talktome = true
   end
 
   if spell_name ~= nil then
      if (arg1 == "v2") then Msg("- ['..spell_name..']",0,1,1) end
      return false
   end
 
    --Msg("MH: ".. mainhandname);
    --Msg("Axe: ".. axename);
 
    for x,tbl in ipairs(Skill) do
        if CD(Skill[x].name) and Skill[x].use then
            if ((Skill[x].name == "Shadowstab") and (mainhandname == axename)) then
                PickupEquipmentItem(16) PickupEquipmentItem(15)
                if (arg1 == "v2") then Msg("- Swap to Dagger") end
                return
            elseif (Skill[x].name == "Shadowstab") then
                CastSpellByName(Skill[x].name)
                if talktome then Msg("- "..Skill[x].name) end
                return true
            end
 
            if (mainhandname ~= axename) then
                PickupEquipmentItem(16) PickupEquipmentItem(15)
                if (arg1 == "v2") then Msg("- Swap to Axe") end
                return
            else
                CastSpellByName(Skill[x].name)
                if talktome then Msg("- "..Skill[x].name) end
                return true
            end
        end
    end
    if (arg1 == "v2") then Msg("- IDLE") end
 
    return false
end
 
 
function RogueWar(arg1,arg2)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local energy = UnitMana("player")
    local rage = UnitSkill("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pbuffs = BuffList("player")
    local tbuffs = BuffList("target")
    local Shadowstab_Bleed = "500654" -- Slash/Shadowstab bleeds share the same exact name
 
    --Msg(tbuffs);
    i=i+1; Skill[i] = { ['name'] = "Poison",   ['use'] = ((not string.find(pbuffs, "Poisonous") and (not combat))) }
    i=i+1; Skill[i] = { ['name'] = "Premeditation",   ['use'] = ((not string.find(pbuffs,"Premeditation")) and (not combat))}
    --i=i+1; Skill[i] = { ['name'] = "Blind Stab",   ['use'] = ((not friendly) and (not string.find(tbuffs,"Blind")) and (energy >=75) and (string.find(tbuffs,Shadowstab_Bleed)))}
    --i=i+1; Skill[i] = { ['name'] = "Enraged",   ['use'] = ((rage < 50) and (string.find(tbuffs,Shadowstab_Bleed))) }
    i=i+1; Skill[i] = { ['name'] = "Death's Touch",   ['use'] = ((not friendly) and (not string.find(pbuffs,"Grim Reaper's Blessing")) and (string.find(tbuffs,Shadowstab_Bleed))) }
    i=i+1; Skill[i] = { ['name'] = "Wound Attack",   ['use'] = ((not friendly) and (energy >=35) and (string.find(tbuffs,Shadowstab_Bleed) and (string.find(tbuffs,"Grievous Wound")))) }
    i=i+1; Skill[i] = { ['name'] = "Low Blow",       ['use'] = ((not friendly) and (energy >=30) and (string.find(tbuffs,Shadowstab_Bleed))) }
    i=i+1; Skill[i] = { ['name'] = "Poisonous Infection",     ['use'] = ((not friendly) and (rage >=20) and string.find(pbuffs,"Poisonous") and string.find(tbuffs,"Bleed") and (not string.find(tbuffs,"Poisonous Infection"))) }
    i=i+1; Skill[i] = { ['name'] = "Shadowstab",     ['use'] = ((not friendly) and (energy >=75)) }
    i=i+1; Skill[i] = { ['name'] = "Slash",     ['use'] = ((not friendly) and (rage >=25)) }
 
    MyCombatRW(Skill,arg1)
end
And ghostwolf82's functions for W/R :

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

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

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

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

Thx :)

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,159

Thursday, October 28th 2010, 3:00am

I'm not sure exactly what you are asking here... Can you be a little more clear in exactly what it is you wish to do?

1,160

Thursday, October 28th 2010, 2:48pm

Soz for my poor english talking :

I would like to have the same lua file that integer R/W & W/R function : an all-in-one lua file.

is it clear ? :confused: