You are not logged in.

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


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

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,441

Wednesday, March 16th 2011, 10:39am

Works wonderfully now, ty Xemnosyst. So when I move on from the RWB I will just have to add in hot swapping my bow into place before using to create arrows, then back to the first bow to kill with.

1,442

Saturday, March 19th 2011, 11:46am

Wow, its been awhile since I've been on here, anyway I was a bit nostalgic tonight and came around to see what's been going on around the place. I noticed Sixpax was still around and creating some very useful tools, so naturally i had to check it out, heh. :)

Anyway, I noticed the way your all creating these Skill tables and how much extra work your doing by incrementing your table indexes with "i=i+1". I figured if your going to type the extra 5 characters, why not just use Lua's length operator (#) to get the current index of your Skills table and just increment based on that. Example(s):
[Current]

Source code

1
i=i+1; Skill[i] = { ['name'] = "Neck Strike",  ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (focus >= 15)) }
[Modified]

Source code

1
Skill[#Skill+1] = { ['name'] = "Neck Strike",  ['use'] = ((not friendly) and  (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5)  and (focus >= 15)) }
Taking it a step further, you could encase the entire thing in a function call that does the same thing, basically, but just cleans up the code; makes it look less messy and allows for some error trapping (sorta). By adding a new local function to your scripts, or add it to the DIYCE library, examples below.

The function:

Source code

1
2
3
4
5
6
7
local function addSkill(tbl, tbl_entries)
    assert( (type(tbl) == "table" and type(tbl_entries) == "table"), "function addSkill arguments error: arg1 = "..type(tbl)..", arg2 = "..type(tbl_entries) );

    tbl[#tbl+1] = tbl_entries;

    return;
end
Usage:

Source code

1
2
addSkill(Skill, { name = "Enhanced Armor", use = (not string.find(pbuffs, "Enhanced Armor") and (mana >= 120))} );
addSkill(Skill, { name = "Tactical Attack", use = ((not friendly) and (rage >=15) and string.find(tbuffs, SlashBleed))} );
I'm not going to get into the nitty gritty of it all, it is fairly self explanotory I suppose. Function calls are expensive so if you're on an uber fast machine and want your code to look cleaner them by all means do the function, otherwise use the length operator, or just leave it all be. :)

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

1,443

Saturday, March 19th 2011, 1:07pm

Quoted from "Maroot;400310"

why not just use Lua's length operator (#) to get the current index of your Skills table and just increment based on that. Example(s):
Current

Source code

1
i=i+1; Skill[i] = { ['name'] = "Neck Strike",  ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (focus >= 15)) }
Modified

Source code

1
Skill[#Skill+1] = { ['name'] = "Neck Strike",  ['use'] = ((not friendly) and  (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5)  and (focus >= 15)) }


Why bother with incrementing an index or using a function at all? Since the skill table is recreated at each step, simply fill it up and let Lua fill the array in order like this:

Source code

1
2
3
4
Skill = {
     { name = "Neck Strike",  use = ((not friendly) and  (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5)  and (focus >= 15)) },
     { name = "some other ability",  use = (some other condition) },
}


Just make sure each line inside the table is separated by commas and your good to go.
2013... The year from hell....

1,444

Saturday, March 19th 2011, 6:09pm

That's even better. :)

It was late, I had originally thought there was some significance to incrementing the index but realized later this morning there wasn't, so why bother going through all the extra work, just build the tables normally and the indexes are set automagically.

1,445

Thursday, March 24th 2011, 2:38am

I do something kinda like this (except I didn't know about the length operator):

Source code

1
2
3
4
5
6
7
8
9
10
11
12
SkillTable = {}

function DoDIYCE(customFunction)
    SkillTable = {}
    customFunction()
    MyCombat(SkillTable)
end


function DoSpell(name, condition)
    SkillTable[#SkillTable + 1] = { name = actionName, use = condition == nil or condition }
end


Which allows me to clean up "MageScout.lua" to look something like:

Source code

1
2
3
4
5
function MageScoutDps()
    DoSpell("Fire Rose", BuffTimeLeft("target", "Fire Rose") < 2)
    DoSpell("Fireball")
    DoSpell("Flame")
end


Then my macro looks like:

Source code

1
/run DoDIYCE(MageScoutDps)

1,446

Friday, March 25th 2011, 2:42pm

can eny1 link me the scout/druid code? orever done for s/d code?

1,447

Sunday, March 27th 2011, 12:34am

Is there any way to check the number of arrows that you have equipped?

I have seen the functionality that replaces arrows if your arrow slot is empty, but when you use combo shot at top priority in a diyce macro you sometimes are left with 2 or 1 arrow left over, so the function never reads your arrow slot as empty.

You are then left with the DIYCE macro attempting to use combo shot without enough arrows, so it constantly spams the macro and doesn't fire anything.

Is there any effective way to check the number of arrows? The best I can come up with, is check if combo shot is usable. The only downside, is that check also returns false if you are out of range of the target. So not only would it not cast combo shot when you have less than 3 arrows, it would also not use combo shot when you were out of range. Which isn't a huge downside, but it would never work if you wanted the diyce macro to move you into combo shot range.

Anyone have any idea on how to do something like I am looking for, or is it just not possible with DIYCE?

EDIT: I figured out a way to do it....took me and my friend about 1.5 hours to figure out what exactly was needed then to figure out the proper logic for it, here it is if anyone wants it:

Source code

1
2
3
4
5
6
    local front = UnitIsUnit("player","targettarget")
    local snipe = GetActionUsable(74) --Check if Snipe is usable
    local shot = GetActionUsable(75) --Check if Shot is usable
    local comboshot = GetActionUsable(76) --Check of Combo Shot is usable

    i=i+1; Skill[i] = { name = "Combo Shot", use = (((not friendly) and ((not front) or (string.find(tbuffs, "Blind")))) and ((snipe and (not shot)) or (comboshot))) }


To put it in easier to understand words, this will use combo shot if:

The target is NOT targeting me, or if they are blind (low chance of interrupting CS), but only if snipe is usable (which means we have 1 or more arrows, and are within 240 range), and shot is not usable (which means we are outside 180 range....this will make my character move within CS range if I am outside it, but within a fair range [snipe range] of the target) OR of CS is usable, which means I am already in range and have 3 or more arrows.

Now, for some reason, I can't really explain it (maybe someone else can?), with the way the game logic works if I am out of range and have less than 3 arrows, instead of attempting to cast Combo Shot it will instead go straight to shot (not in my code above since it's just a basic call to use shot). If I am out of range and have 3 or more arrows then it will use combo shot.

Basically, I check multiple skills to determine whether I have less than 3 arrows, and essentially toggle off combo shot if it's less than 3, while also checking snipe so I can target something out of tab range (and up to snipe range), and still move to it and fire combo shot. The only downside, for the same reason that it automatically moves on to shot (from combo shot) if I do not have 3 or more arrows, it will also open with shot if I click the macro to attack a target outside of snipe range.

Anyone want to make improvements to this? I plan on doing something similar with piercing arrow so if I have 2 arrows it will use shot, then wind arrows (instead of getting stuck on piercing arrow) before using a 2nd shot then reloading arrows.....but I would like to see if there is a better way to do this, or maybe some fixes so it always opens with combo shot if I have more than 2 arrows.

1,448

Friday, April 1st 2011, 11:40pm

Maybe I'm just dense, but the whole DIYCE thing looks extremely complicated to set up. Way more than I've ever had to do to get things like effective shot rotations while activating trinkets and on-use items at the same time.

And honestly, the written explanation kind of falls short for me. I mean I think I get it but...:confused: Has anyone ever made a YouTube guide about DIYCE setup? A visual representation would help greatly in my opinion.

I'm not trying to sound ungrateful to the mod author. People that devote time to help make games people love even better have my deepest respect. I just get confused easily since my second stroke (first stroke in my mid 20s, second in my 30s...) and I try to simplify games to as few button presses as possible. I was hoping this addon would help me make playing RoM feel less like whack-a-mole than it does now.

How much use would this be to me while leveling a scout or any other class?

EntropyKnight

Intermediate

Posts: 171

Location: That one place over there - see?

Occupation: Going places, doing things.. getting them done!

  • Send private message

1,449

Saturday, April 2nd 2011, 2:44am

Taking a fair stab in the dark here. Made the code, haven't quite tested it yet, but here's the general aim.

Pick up with a Shadowstab, Vamp to get the dual-DoT going, then Low Blow and Wound Attack to finish that classic chain, leaving the default down to Low Blow. Any logic flaws here for code?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function RogueScout(arg1)
   local Skill = {}
   local i = 0
   local energy = UnitMana("player")
   local enemy = UnitCanAttack("player","target")

   i=i+1; Skill[i] = { name = "Shadowstab", use = (not ChkBuff("target","Bleed") and energy >= 20) }
   i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not ChkBuff("target","Vampire Arrows")) }
   i=i+1; Skill[i] = { name = "Wound Attack", use = (ChkBuff("target","Bleed") and ChkBuff("target","Grievous Wound") and (energy >= 35) and not(CD("Wound Attack"))) }
   i=i+1; Skill[i] = {name = "Low Blow", use = (energy >= 30) }


   MyCombat(Skill,arg1)
end
Mithras: The social server. Has a nice ring to it...

Kimberly (r/m/k - retired until further notice), Trylis (wd/d/r)
And one of the very few people trying to bring back the "RP" in this RPG.

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,450

Saturday, April 2nd 2011, 3:32am

Quoted from "scannerdarkly;405107"

Maybe I'm just dense, but the whole DIYCE thing looks extremely complicated to set up. Way more than I've ever had to do to get things like effective shot rotations while activating trinkets and on-use items at the same time.

And honestly, the written explanation kind of falls short for me. I mean I think I get it but...:confused: Has anyone ever made a YouTube guide about DIYCE setup? A visual representation would help greatly in my opinion.

I'm not trying to sound ungrateful to the mod author. People that devote time to help make games people love even better have my deepest respect. I just get confused easily since my second stroke (first stroke in my mid 20s, second in my 30s...) and I try to simplify games to as few button presses as possible. I was hoping this addon would help me make playing RoM feel less like whack-a-mole than it does now.

How much use would this be to me while leveling a scout or any other class?

It's actually fairly simple and very easy to use once past the initial setup. Have a look in my sig for a link to a guide I wrote up to describe how the parts of the DIYCE work. That may help clear a few things up for you.

As for how useful this engine can be, well you can simplify the combat down to as few buttons as you want, even down to one button depending on your ability to learn the code. As with all things, time spent working with/reading the code will only make you better at it. If you start working with the code and find an issue difficult, try searching this thread for the answer, and if you are unable to locate one feel free to post up your question.

Most other sections of the boards, asking a FAQ will normally get you the response of L2S(learn to search), even I have told people this before. However, this section of the forums is a bit more forgiving and has a lot more leeway for questions. In here, the only dumb question is the one not asked. I would rather have someone keep asking me questions about how to make the code work, than to think they get it, and then go tell others "this is how you do it", as that can lead to more problems down the road.

So, welcome to the forums, and hope to see you around this section more.

1,451

Saturday, April 2nd 2011, 9:51am

chiron the centaur diyce

hello,
can someone help me with how to put the lines of chiron in my macro? he should use valliant shot whenever available and if it isnt availible, he will shoot centaurs arrow automatic(he already does shoot centaurs arrow automatic. this is my diyce, can someone please help me?

Quoted


function WardenScout(arg1)
local Skill = {}
local i = 0
local mana = UnitMana("player")/UnitMaxMana("player")
local focus = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local melee = GetActionUsable(6)
local phealth = PctH("player")
local pmana = PctM("player")



i=i+1; Skill = { name = "Action: 70 (h pot)", use = (phealth <= .50) and GetActionUsable(70) }
i=i+1; Skill[i] = { name = "Action: 71 (HoT Pot)", use = (phealth <= .70) and GetActionUsable(71) }
i=i+1; Skill[i] = { name = "Action: 72 (HoT Pot)", use = (phealth <= .90) and GetActionUsable(70) }
i=i+1; Skill[i] = { name = "Action: 68 (Mana pot)", use = (pmana <= .10) and GetActionUsable(68) }
i=i+1; Skill[i] = { name = "Action: 69 (MOT pot)", use = (pmana <= .40) and GetActionUsable(69) }

i=i+1; Skill[i] = { name = "Anti-Magic Arrow", use = (not friendly) and (not melee) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) and (not melee) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) and (not melee) }

i=i+1; Skill[i] = { name = "Thorny Vine", use = (not friendly) and (pmana >= .10) }
i=i+1; Skill[i] = { name = "Charged Chop", use = (not friendly) and (pmana >= .10) }
i=i+1; Skill[i] = { name = "Cross Chop", use = (not friendly) and (pmana >= .30) }
i=i+1; Skill[i] = { name = "Power of the Wood Spirit", use = (not friendly) and (pmana >= .25) }

i=i+1; Skill[i] = { name = "Anti-Magic Arrow", use = (not friendly) and (pmana <= .30) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) and (pmana <= .10) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) and (pmana <= .10) }

MyCombat(Skill,arg1)
end

1,452

Tuesday, April 5th 2011, 10:51pm

Anyone know where I can get up to date formula's for skills?

On the rom wiki (both of the halfway decent looking ones I could find), it says regenerate costs: 35 + 3.5 / level.....the problem is my warrior/priest is lvl 36/34, regenerate at level 30 currently costs 136. If we follow the above formula exactly, it should cost 35 mana (35 + 3.5 / 30 = 35.116), unless that 3.5 is suppose to be 3.5% of your max mana or something, but even then, I have 1063 mana, so lets try that again:

35 + (1063 * 3.5%) / 30 = 36....nope, still not right.

Am I just completely misunderstanding the formula's or is something really wrong with this formula's?

The reason I ask is because instead of changing the mana values in my script every time I level a skill, I would like to use the same formula's as in-game so it scales with my skill levels (if it's possible to check skill levels with DIYCE).

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,453

Wednesday, April 6th 2011, 12:55am

Quoted from "mwpeck;406328"

Anyone know where I can get up to date formula's for skills?

On the rom wiki (both of the halfway decent looking ones I could find), it says regenerate costs: 35 + 3.5 / level.....the problem is my warrior/priest is lvl 36/34, regenerate at level 30 currently costs 136. If we follow the above formula exactly, it should cost 35 mana (35 + 3.5 / 30 = 35.116), unless that 3.5 is suppose to be 3.5% of your max mana or something, but even then, I have 1063 mana, so lets try that again:

35 + (1063 * 3.5%) / 30 = 36....nope, still not right.

Am I just completely misunderstanding the formula's or is something really wrong with this formula's?

The reason I ask is because instead of changing the mana values in my script every time I level a skill, I would like to use the same formula's as in-game so it scales with my skill levels (if it's possible to check skill levels with DIYCE).

Not sure why you divide, when you need to multiply.

35 + (3.5 * 30) = 140

I have always guessed the information on the wiki is rounded up, so not sure the exact amount each skill takes.

An easier way to do this would be to just check the % of mana you have left, and if you have ... say 5-8% mana left, then cast the spell. This way, no matter how much mana you have (3k, or 30k) 5% is 5% no matter what.

1,454

Wednesday, April 6th 2011, 1:13am

I divided because the wikis show a "/" which I have always known to be divide (multiply is generally "*"), I thought maybe it would be multiply since divide seemed dead wrong, but even multiply didn't come up with the exact same values.

As for checking %, the thing is I don't want it to cast based off % of mana. If I have 4k mana, it would never cast Regenerate if I only had 200 mana left, but I still want it to cast regenerate until I do not have enough mana for it.

For example, here's what I currently have:

i=i+1; Skill = { name = "Regenerate", use = ((health <= 0.8) and (not string.find(pbuffs, "Regenerate")) and (mana >= 196)) }

Basically, that is one of my top skills in DIYCE, I only want it to ever use Regenerate though if I have more than 195 mana, that way I save enough for Holy Aura if I need it. Now if late game I have 10k mana, and say I don't level regen up, it would stop casting Regen if my mana fell below 500, even though it has more than enough to cast it multiple times once I'm below 500.

Instead, what I want, is to be able to scale the amount of mana DIYCE attempts to save for emergencies (enough for Holy Aura followed by regen followed by absorption) with how much the skills actually take. So instead of always saving say 5%, it always saves the mana cost of holy aura (which is static) + regen + the absorption skill, which may or may not be more than that 5% it would save if I set it up that way.



EDIT: Ah, I understand the confusion....in the wiki it says "35 + 3.5 / level", it means 35 + 3.5 PER level, not 3.5 divided by level. That makes a lot more sense. While I do sometimes use "/" to represent per, I am not used to seeing "/" meaning "per" in math-style equations.

1,455

Sunday, April 10th 2011, 8:18pm

Ive been scanning this forum for a R/K code but its so big that I cant seem to find one. If anyone knows where one is can you tell me what post I can find it on?

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,456

Tuesday, April 12th 2011, 4:51pm

Use the "Search this Thread" function, search for "rogueknight". Your search will be narrowed down to two pages.

1,457

Saturday, April 16th 2011, 2:26am

Move forward for blindspot?

I'm wondering is there is a way to add in a move forward a few steps option into my blindspot code (underlined) so that I can attack the target in the back.

i=i+1; Skill = { ['name'] = "Action: 68", ['use'] = (PctH("player") < .30) }
i=i+1; Skill[i] = { ['name'] = "Action: 69", ['use'] = (PctH("player") < .32) }
i=i+1; Skill[i] = { ['name'] = "Action: 70", ['use'] = (PctH("player") < .34) }
i=i+1; Skill[i] = { ['name'] = "Action: 62", ['use'] = (PctH("player") < .40) }
i=i+1; Skill[i] = { ['name'] = "Action: 61", ['use'] = (PctH("player") < .85) }
i=i+1; Skill[i] = { name = "Enhanced Armor", use = ((not combat) and (not string.find(pbuffs, "Enhanced Armor"))) }
i=i+1; Skill[i] = { name = "Premeditation", use = (enemy and (energy >= 20) and (not combat)) }
i=i+1; Skill[i] = { name = "Sneak Attack", use = (enemy and (energy >= 30) and (not combat) and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Blind Spot", use = (enemy and (energy >= 25) and (arg2 == "behind") and (not string.find(tbuffs, "Bleed"))) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (enemy and (energy >= 35) and (not string.find(tbuffs, "Bleed"))) }
i=i+1; Skill[i] = { name = "Wound Attack", use = (enemy and (energy >= 35) and string.find(tbuffs, "Bleed") and string.find(tbuffs, "Grievous Wound")) }
i=i+1; Skill[i] = { name = "Low Blow", use = (enemy and (energy >= 35) and string.find(tbuffs, "Bleed")) }
i=i+1; Skill[i] = { name = "Blind Spot", use = (enemy and (energy >= 25) and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Disarmament", use = (enemy and (mana >= 100) and (not string.find(tbuffs, "Disarmament IV"))) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (enemy and (energy >= 35)) }

MyCombat(Skill, arg1)
end

When I'm using blind spot in combat, I move forward a small amount so I'm behind the target. Is it possible to do that?

KatalanOrk

Intermediate

Posts: 563

Location: Nijmegen, The Netherlands

  • Send private message

1,458

Tuesday, April 19th 2011, 11:12am

I have finally given in and created a DIYCE function for my new combo.

I didn't really find anything that I liked by searching the thread (and a few did not even work) so I thought I would post up mine. It's not great, or clever, and is also completely plagarised from others :) But still it is something for W/K's out there.

Any feedback is appreciated, but that isn't the primary reason for me posting it up. I hope everything is self explanatory.

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


   i=i+1; Skill[i] = { ['name'] = "Enhanced Armor",    ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
   i=i+1; Skill[i] = { ['name'] = "Blocking Stance",   ['use'] = (not string.find(pbuffs,"Blocking Stance")) }--
   i=i+1; Skill[i] = { ['name'] = "Survival Instinct", ['use'] = (phealth < .40) }
   i=i+1; Skill[i] = { ['name'] = "Disarmament",       ['use'] = ((not friendly) and (not string.find(tbuffs,"Disarmament IV")) and (arg2 == "disarm")) }
   i=i+1; Skill[i] = { ['name'] = "Enraged",           ['use'] = ((not friendly) and (rage <= 50)) }
   i=i+1; Skill[i] = { ['name'] = "Tactical Attack",   ['use'] = ((not friendly) and (rage >= 15) and string.find(tbuffs,"Bleed")) }
   i=i+1; Skill[i] = { ['name'] = "Open Flank",        ['use'] = ((not friendly) and (rage >= 10) and string.find(tbuffs,"Bleed")) }
   i=i+1; Skill[i] = { ['name'] = "Probing Attack",    ['use'] = ((not friendly) and (rage >= 20) and string.find(tbuffs,"Bleed")) }
   i=i+1; Skill[i] = { ['name'] = "Slash",             ['use'] = ((not friendly) and (rage >= 25)) }
   i=i+1; Skill[i] = { ['name'] = "Disarmament",       ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end

function WarriorKnight1h(arg1,arg2)
   local Skill = {}
   local i = 0
   local friendly = (not UnitCanAttack("player","target"))
   local rage = UnitMana("player")
   local mana = UnitSkill("player")
   local pbuffs = BuffList("player")
   local tbuffs = BuffList("target")
   local phealth = PctH("player")


   i=i+1; Skill[i] = { ['name'] = "Enhanced Armor",    ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
   i=i+1; Skill[i] = { ['name'] = "Blocking Stance",   ['use'] = (not string.find(pbuffs,"Blocking Stance")) }
   i=i+1; Skill[i] = { ['name'] = "Survival Instinct", ['use'] = (phealth < .40) }
   i=i+1; Skill[i] = { ['name'] = "Disarmament",       ['use'] = ((not friendly) and (not string.find(tbuffs,"Disarmament IV")) and (arg2 == "disarm")) }
   i=i+1; Skill[i] = { ['name'] = "Enraged",           ['use'] = ((not friendly) and (rage <= 50)) }
   i=i+1; Skill[i] = { ['name'] = "Thunder",           ['use'] = ((not friendly) and (rage >= 15) and (string.find(tbuffs,"Weakened"))) }
   i=i+1; Skill[i] = { ['name'] = "Open Flank",        ['use'] = ((not friendly) and (rage >= 10) and (string.find(tbuffs,"Vulnerable"))) }
   i=i+1; Skill[i] = { ['name'] = "Probing Attack",    ['use'] = ((not friendly) and (rage >= 20)) }
   i=i+1; Skill[i] = { ['name'] = "Slash",             ['use'] = ((not friendly) and (rage >= 25)) }
   i=i+1; Skill[i] = { ['name'] = "Disarmament",       ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,459

Tuesday, April 19th 2011, 11:40pm

Time for some new combos from me. Been gearing up a S/wd and a K/M, so here are the functions for them. (Please pardon the formatting, it looks correct in Notepad++. /shrug)

Scout/Warden:

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
arrowTime = 0
SlotRWB = 16 --Action Bar Slot # for Rune War Bow
SlotVLB = 17 --Action Bar Slot # for Valiant Long Bow
function ScoutWarden(arg1, potslot)
    --potslot = Health potion.

    local Skill = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local focus = UnitMana("player")
    local pctmana = PctS("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(13) -- # is your melee range spell slot number
    local phealth = PctH("player")
    local LockedOn = UnitExists("target")
    local a1,a2,a3,a4,a5,ASon = GetActionInfo(14)  -- # is your Autoshot slot number
    local boss = UnitSex("target") > 2
    local party = GetNumPartyMembers() >= 4
    local _,_,_,_,RWB,_ = GetActionInfo( SlotRWB )
    local _,_,_,_,VLB,_ = GetActionInfo( SlotVLB )
    
    --Silence Logic
    local tSpell,tTime,tElapsed = UnitCastingTime("target")
    local silenceList = "/Annihilation/King Bug Shock/Mana Rift/Dream of Gold/Flame/Flame Spell/Wave Bomb/Silence/Recover/Restore Life/Heal/Curing Shot/Leaves of Fire/Urgent Heal/"
    local silenceThis = ((tSpell ~= nil) and (string.find(silenceList, tSpell)) and ((tTime - tElapsed) > 0.1))
    
    --Potion Checks
    potslot = potslot or 0

    --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 VLB) then
            UseAction(SlotVLB)
            return
        end
            
    --Equipment and Pet Protection
    if (PctH("player") <= .05111) then
            SwapEquipmentItem()
        for i=1,3 do
            if (IsPetSummoned(i) == true) then
                ReturnPet(i);
            end
        end        
    end
    
    --Potions and buffs
    i=i+1; Skill[i] = { name = "Action: "..potslot,      use = (phealth < .70) }
       i=i+1; Skill[i] = { name = "Frost Arrow",            use = (not combat) and (focus >= 20) and ((not string.find(pbuffs,"Frost Arrow")) or (BuffTimeLeft("player","Frost Arrow") <= 45)) }
       i=i+1; Skill[i] = { name = "Entling Offering",       use = (pctmana >= .15) and ((not string.find(pbuffs,"Entling Offering")) or (BuffTimeLeft("player","Entling Offering") <= 45)) }
       i=i+1; Skill[i] = { name = "Briar Shield",           use = (pctmana >= .15) and ((not string.find(pbuffs,"Briar Shield")) or (BuffTimeLeft("player","Briar Shield") <= 45)) }
    i=i+1; Skill[i] = { name = "Blood Arrow",            use = ((not combat or (phealth <= .45)) and (string.find(pbuffs,"Blood Arrow"))) }
    i=i+1; Skill[i] = { name = "Target Area",            use = (tdead and (string.find(pbuffs,"Target Area"))) }

   --Combat
    if enemy then
        i=i+1; Skill[i] = { name = "Throat Attack",     use = melee and (silenceThis) }
        if boss then
            i=i+1; Skill[i] = { name = "Blood Arrow",            use = (phealth >= .95) and (not string.find(pbuffs,"Blood Arrow")) }
            i=i+1; Skill[i] = { name = "Target Area",            use = (focus >= 40) and (not string.find(pbuffs,"Target Area")) }
            i=i+1; Skill[i] = { name = "Concentration",            use = (not string.find(pbuffs,"Concentration")) }
            i=i+1; Skill[i] = { name = "Savage Power",            use = (pctmana >= .04) }
            i=i+1; Skill[i] = { name = "Arrow of Essence",      use = (not string.find(pbuffs,"Arrow of Essence")) }
        end
        i=i+1; Skill[i] = { name = "Snipe",                use = (string.find(pbuffs,"Hidden Peril")) }
        i=i+1; Skill[i] = { name = "Hidden Peril",      use = (focus >= 30)}
        i=i+1; Skill[i] = { name = "Thorn Arrow",       use = (pctmana >= .12) }
        i=i+1; Skill[i] = { name = "Autoshot",           use = (not ASon) }
        i=i+1; Skill[i] = { name = "Combo Shot",           use = true }
        i=i+1; Skill[i] = { name = "Shoot",               use = true }
        i=i+1; Skill[i] = { name = "Wind Arrows",        use = (focus >= 15) }
    end
    
    MyCombat(Skill,arg1)
    if (not party) then
        if (tDead) or (not LockedOn) or (not enemy) then
            TargetNearestEnemy()
        end    
    end
end
Knight/Mage:

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
function KnightMage(arg1, potslot, potslot2)
    --potslot = Health potion.
    --potslot2 = Mana potion.

    local Skill = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local mana = UnitMana("player")
    local pctmana = PctM("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(13) -- # is your melee range spell slot number
    local LKBR = GetActionUsable(20) -- # is Lion King Battle Roar spell slot number
    local phealth = PctH("player")
    local LockedOn = UnitExists("target")
    local boss = UnitSex("target") > 2
    local party = GetNumPartyMembers() >= 2

    --Silence Logic
    local tSpell,tTime,tElapsed = UnitCastingTime("target")
    local silenceList = "/Annihilation/King Bug Shock/Mana Rift/Dream of Gold/Flame/Flame Spell/Wave Bomb/Silence/Recover/Restore Life/Heal/Curing Shot/Leaves of Fire/Urgent Heal/"
    local silenceThis = ((tSpell ~= nil) and (string.find(silenceList, tSpell)) and ((tTime - tElapsed) > 0.1))
    
    --Potion Checks
    potslot = potslot or 0    
    potslot2 = potslot2 or 0
    
    --Equipment and Pet Protection
    if (PctH("player") <= .04) then
            SwapEquipmentItem()
        for i=1,3 do
            if (IsPetSummoned(i) == true) then
                ReturnPet(i);
            end
        end        
    end
    
    --Potions and buffs
    i=i+1; Skill[i] = { name = "Action: "..potslot,                    use = (phealth <= .68) }
    i=i+1; Skill[i] = { name = "Action: "..potslot2,                use = (pctmana <= .40) }
    i=i+1; Skill[i] = { name = "Enhanced Armor",                    use = (pctmana >= .05) and ((not string.find(pbuffs,"Enhanced Armor")) or (BuffTimeLeft("player","Enhanced Armor") <= 45)) }
    i=i+1; Skill[i] = { name = "Holy Seal",                            use = (pctmana >= .05) and ((not string.find(pbuffs,"Holy Seal")) or (BuffTimeLeft("player","Holy Seal") <= 45)) }
    i=i+1; Skill[i] = { name = "Lightning Armor",                    use = (pctmana >= .05) and ((not string.find(pbuffs,"Lightning Armor")) or (BuffTimeLeft("player","Lightning Armor") <= 45)) }
    --i=i+1; Skill[i] = { name = "Fire Ward",              use = (pctmana >= .05) and ((not string.find(pbuffs,"Fire Ward")) or (BuffTimeLeft("player","Fire Ward") <= 45)) }

    --Mana Shield
    if IsShiftKeyDown() and (string.find(pbuffs,"Mana Shield")) then
        CancelBuff("Mana Shield")
    end
    i=i+1; Skill[i] = { name = "Mana Shield",                        use = (pctmana <= .25) }

    --Combat
    if enemy then
        i=i+1; Skill[i] = { name = "Silence",                        use = (silenceThis) }
        i=i+1; Skill[i] = { name = "Resolution",                    use = party and boss }
        i=i+1; Skill[i] = { name = "Shield of Discipline",            use = party and boss }
        i=i+1; Skill[i] = { name = "Intensification",                use = party and boss }
        i=i+1; Skill[i] = { name = "Shield of Valor",                use = party and boss }
        i=i+1; Skill[i] = { name = "Hatred Strike",                    use = (pctmana >= .05) and party and boss }
        i=i+1; Skill[i] = { name = "Threaten",                        use = (pctmana >= .05) and party and boss and (string.find(tbuffs,"Holy Seals 3")) }
        i=i+1; Skill[i] = { name = "Action: 20",                    use = (pctmana >= .07) and LKBR and party and boss }
        i=i+1; Skill[i] = { name = "Custom: Holy Light Domain",        use = (pctmana >= .05) and (not string.find(tbuffs,"Holy Illumination")) and ((string.find(tbuffs,"Light Seal I")) or (string.find(tbuffs,"Light Seal II")) or (string.find(tbuffs,"Light Seal III"))) and (g_lastaction ~= "Holy Light Domain") }
        i=i+1; Skill[i] = { name = "Mana Return",                    use = (pctmana <= .80) and (string.find(tbuffs,"Holy Seals 3")) }
        i=i+1; Skill[i] = { name = "Whirlwind Shield",                use = (pctmana >= .05) and (string.find(tbuffs,"Holy Illumination")) }
        i=i+1; Skill[i] = { name = "Custom: Holy Strike",            use = (pctmana >= .05) and (not string.find(tbuffs,"Light Seal III")) }
        i=i+1; Skill[i] = { name = "Disarmament",                    use = (pctmana >= .05) and (not string.find(tbuffs,"Disarmament IV")) and (string.find(tbuffs,"Holy Illumination")) and party and boss }
        i=i+1; Skill[i] = { name = "Custom: Holy Strike",            use = (pctmana >= .05) }
        i=i+1; Skill[i] = { name = "Attack",                        use = (PctH("target") == 1) }
    end
    
    -- Loot corpse, or interact with NPC.
    i=i+1; Skill[i] = { name = "Attack",                            use = (tDead or (not combat and not enemy)) }
        
        MyCombat(Skill,arg1)
        
    if (tDead) or (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
    end    
    
end

Posts: 86

Location: Dominating in 3vs3, 6vs6 and siege.

Occupation: Network Administrator for a local NBC T.V. station.

  • Send private message

1,460

Thursday, April 28th 2011, 2:57am

ScoutWarden

So I have a Wd/S that I'm working on and have tweaked Ghostwolfs ScoutKnight macro from post #to be a friendly with my character. Here is the code and below I have a few questions:

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
g_cnt = 0

function WardenScout(arg1, potslot, potslot2)
    local Skill = {}
    local i = 0
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
    local focus = UnitMana("player")
    local mana = PctS("player")
    local pmana = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local front = UnitIsUnit("player", "targettarget")
    local tDead = UnitIsDeadOrGhost("target")
    local melee = GetActionUsable(9) -- # is your melee range spell slot number
    local phealth = PctH("player")
    local thealth = PctH("target")
    local LockedOn = UnitExists("target")
    local ammo = (GetEquipSlotInfo(10) ~= nil)
    
    potslot = potslot or 0
    potslot2 = potslot2 or 0
    
        --Ammo Check and Equip
    if (ammo == false) then
        local HaveAmmo = false
        local arrows = ""
        for i=1,60 do
            local x,y,name = GetBagItemInfo(i)
            if ((string.find(name, " Thorn")) or (string.find(name, " Arrow"))) then
                HaveAmmo = true
                arrows = name
            end
        end
        if (HaveAmmo == true) then
            i=i+1; Skill[i] = { name = "Item: "..arrows,    use = (not ammo) } --Equip arrows if have           
        elseif ((g_cnt%100) == 0) then
            SendChatMessage("I'm out of arrows!! Hit your reload button!!","SAY")
        end
        g_cnt = g_cnt + 1
    end

        --Potions and buffs
    i=i+1; Skill[i] = { name = "Action: "..potslot,     use = (phealth < .25) }
    i=i+1; Skill[i] = { name = "Action: "..potslot2,    use = (mana < .50) }
    i=i+1; Skill[i] = { name = "Briar Shield",          use = ((not string.find(pbuffs,"Briar Shield")) and (pmana >= 120)) }
       i=i+1; Skill[i] = { name = "Blood Arrow",        use = ((not combat or (phealth <= .45)) and (string.find(pbuffs,"Blood Arrow"))) }
       i=i+1; Skill[i] = { name = "Blood Arrow",        use = (combat and (not string.find(pbuffs,"Blood Arrow") and (phealth > .99))) }
   
    if enemy and (not melee) then
        if IsShiftKeyDown() then
            i=i+1; Skill[i] = { name = "Movement Restriction",                 use = (not combat) }
        end
        i=i+1; Skill[i] = { name = "Shot",    use = true }
        i=i+1; Skill[i] = { name = "Vampire Arrows",    use = (focus >= 20) }
        i=i+1; Skill[i] = { name = "Anti-Magic Arrow",    use = (focus >= 30) }       
        i=i+1; Skill[i] = { name = "Cross Chop",    use = (mana >= .35) }
--        i=i+1; Skill[i] = { name = "Piercing Arrow",    use = true }       
        
    elseif enemy and melee then
        if IsShiftKeyDown() then
            i=i+1; Skill[i] = { name = "Elven Amulet",    use = true }
            i=i+1; Skill[i] = { name = "Throat Attack",    use = true }
        i=i+1; Skill[i] = { name = "Wrist Attack",    use = true }
        end
        i=i+1; Skill[i] = { name = "Thorny Vine",    use = true }
        i=i+1; Skill[i] = { name = "Movement Restriction",    use = true }
        i=i+1; Skill[i] = { name = "Cross Chop",    use = true }
        i=i+1; Skill[i] = { name = "Power of the Wood Spirit",    use = true }
        i=i+1; Skill[i] = { name = "Wrist Attack",    use = (focus >= 35) }
        i=i+1; Skill[i] = { name = "Joint Blow",    use = (not string.find(tbuffs,"Slow")) }
    end    
        
    i=i+1; Skill[i] = { name = "Attack",             use = (tDead or (not combat and not enemy)) }
    
    MyCombat(Skill,arg1)
    
    if (tDead) or (not LockedOn) or (not enemy) then
        TargetNearestEnemy()
    end    
end

g_cnt = 0
I'm not sure what the issue is but for some reason Briar Shield doesn't activate if I'm not already buffed by it. It should use that skill if I'm not buffed with Briar Shield. Also, when I start the macro, it fires Shot and Anti-Magic Arrow before it activates Blood Arrow...I'm wanting it to activate use Briar Shield, Blood Arrow then start attacking. If anyone could shed some light on what I may be doing wrong I would appreciate it.