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.

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

41

Thursday, February 25th 2010, 3:05pm

If there is 3 Holy Seals and Threaten is not on CD, it will fire so long as arg2=threaten. Since it does not consume the seals, you can then fire off the default macro and it will cast MR, killing the Holy Seals. Once seals are built back up again, it will fire Threaten so long as you are using 2nd macro with arg2=threaten.

Basically its a fire off your normal macro most of the time, if you see you need more aggro, fire off the arg2=threaten version. That is what I have chosen to work for me.

as for Hatred Strike just add this line where you want it.

Source code

1
   i=i+1; Skill[i] = { ['name'] = "Hatred Strike",             ['use'] = (not string.find(pbuffs,"Hatred Strike")) and (arg2 == "threaten")) }


that should work

T

42

Thursday, February 25th 2010, 3:12pm

Just an update for everyone using this code... I modified the CD() function to check for times when you change classes.

43

Thursday, February 25th 2010, 3:15pm

Quoted from "Tigsman;234695"

as for Hatred Strike just add this line where you want it.

Source code

1
   i=i+1; Skill[i] = { ['name'] = "Hatred Strike",             ['use'] = (not string.find(pbuffs,"Hatred Strike")) and (arg2 == "threaten")) }
that should work


You're missing one left paren:

Source code

1
   i=i+1; Skill[i] = { name = "Hatred Strike",             use = ((not string.find(pbuffs,"Hatred Strike")) and (arg2 == "threaten")) }

44

Friday, February 26th 2010, 12:54am

Excellent , yes they changed Threaten to not consume the seals , so actually Tigs is working awesome for me. I made one macro called "DPS" for arg1 and one called "TANK" for the arg2 threaten . great stuff....

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

45

Friday, February 26th 2010, 1:19am

What Im thinking is to build a second complete function, so I would have one with MR and attack skills, and one with Hatred Strike, Threaten, MR and attack skills.

basically tank and nontank functions, so I can expand it further if I want. Just havent had the need to do it yet, since I havent been tanking much lately.


T

46

Saturday, February 27th 2010, 11:18pm

First off, awesome work Sixpax. I'm a W/K and trying to get this working.

I'm not able to get Disarment, TA, OF, or PA to function, but slash does, Any ideas what I'm missing.

I wanted to set it up so Disarment would be cast one time, when I use /run WarriorKnight("",disarm).

HTML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function WarriorKnight(arg1,arg2)
   local Skill = {}
   local i = 0
   local friendly = (not UnitCanAttack("player","target"))
   local rage = UnitMana("player")
   local focus = UnitSkill("player")
   local tbuffs = BuffList("player")
   local pbuffs = BuffList("target")
   local tspell = UnitCastingTime("target")

   i=i+1; Skill[i] = { ['name'] = "Disarmament",       ['use'] = ((not friendly) and (not string.find(tbuffs,"Disarmament I")) and (arg2 == "disarm")) }
   i=i+1; Skill[i] = { ['name'] = "Enraged",           ['use'] = ((not friendly) and (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'] = "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'] = "Enhanced Armor",    ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
   i=i+1; Skill[i] = { ['name'] = "Blocking Stance", ['use'] = (not string.find(pbuffs,"Blocking Stance")) }

   MyCombat(Skill,arg1)
end

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

47

Sunday, February 28th 2010, 2:32am

correct me if I'm wrong but I beleive you should run /run WarriorKnight("","disarm") for it to work.

I would also move Slash below TA, OF and PA. Think of this as a priority list, it sorta has to be built in reverse sequence.

I would also move EA to the top of the list, this way, if you lose EA during battle, it gets put back on ASAP. I dont use BS or play my W side often enough to recall the BS buff, but if you want it on at all times possible, put at top of list as well.

Further, you want disarm looking for Disarmament IV so its in full effect.

and I just noticed, the biggest reason nothing fires, is you have the buffs backwards. tbuffs should be your target, not you.

if I get time later tonight i will rework your code for ya if someone else hasnt beaten me to it, you even reference focus which a w/k aint got. your code needs a cleanup.



T

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

48

Sunday, February 28th 2010, 3:43pm

Quoted from "dharleyman;235644"



Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function WarriorKnight(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")


   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'] = "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) }

   MyCombat(Skill,arg1)
end


I think that's a bit cleaner and should work ok


T

49

Sunday, February 28th 2010, 7:21pm

Awesome. Thanks for the help Tigs.

I have 1 other question. I want to cast Feint if the enemy dodges, but i'm having issues with this test.

HTML

1
i=i+1; Skill[i] = { ['name'] = "Feint",             ['use'] = (if GetActionUsable(19)) }
where slot 19 on skill bar is Feint.

Any ideas?

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

50

Sunday, February 28th 2010, 7:36pm

I would not do by slots as things change, besides not sure it would work in this engine. The creator would know more, but since if you cast feint they need to have dodged, the casting of feint should only need to know that the target is not friendly. I would simply put it first in the progressing before buffs. That should work.

Source code

1
i=i+1; Skill[i] = { ['name'] = "Feint",             ['use'] = (not friendly) }



T

51

Tuesday, March 2nd 2010, 1:21am

Quoted from "dharleyman;235843"

Awesome. Thanks for the help Tigs.

I have 1 other question. I want to cast Feint if the enemy dodges, but i'm having issues with this test.

HTML

1
i=i+1; Skill[i] = { ['name'] = "Feint",             ['use'] = (if GetActionUsable(19)) }
where slot 19 on skill bar is Feint.

Any ideas?


IIRC when I tested Feint with GetActionUsable(), it didn't work right because it returns true even if the mob doesn't dodge. I think it's only doing a range and cooldown check. However, if that's not the case and it does work right then just remove the "if" from your ['use'] definition and it should work fine.

Quoted from "Tigsman;235852"

I would not do by slots as things change, besides not sure it would work in this engine.


I try not to ever use slot #'s in my functions if at all possible, but sometimes it's unavoidable because there is no GetSkillUsable() function, unfortunately. A good example of when you *HAVE* to use GetActionUsable() is doing range checking since they disabled UnitDistance(). GetActionUsable() returns a true/false so it's certainly usable within the engine.

Quoted from "Tigsman;235852"

The creator would know more, but since if you cast feint they need to have dodged, the casting of feint should only need to know that the target is not friendly. I would simply put it first in the progressing before buffs. That should work.


Actually that won't work because it will just keep trying to use Feint in vain (since the engine won't know that it can't). So everything defined after Feint would never execute. If I'm not mistaken, the only way to use Feint programmatically is to monitor the COMATMETER_DAMAGE event looking for a dodge to occur.

52

Tuesday, March 2nd 2010, 1:31am

Quoted from "Tigsman;235852"

I would not do by slots as things change, besides not sure it would work in this engine. The creator would know more, but since if you cast feint they need to have dodged, the casting of feint should only need to know that the target is not friendly. I would simply put it first in the progressing before buffs. That should work.

Source code

1
i=i+1; Skill[i] = { ['name'] = "Feint",             ['use'] = (not friendly) }
T


He more then likely tried that (and it doesn't work as Feint is never in CD unless it's used. You can mod the CD check function or just do something like:

Source code

1
/script if(GetActionUsable(32)) then UseAction(32); else  WarriorKnight(); end;
I'd love it if there was a default distance check ability added to it as well. Right now I check if (a) I have mana for Holy Strike see if its "not" usable, and if so, check to see if my Surprise Attack is usable .. and if so I cast Surprise Attack.

It does get a bit !@#$ up if you're within the 50-59 feet away ... but that's solved quickly if you're using /run vs. /script as your macro command (and if you just spam the macro, lol).

Source code

1
/script if(GetActionUsable(32)) then UseAction(32); elseif(((UnitSkill("player") >= 150) and (not GetActionUsable(11))) and (GetActionUsable(12))) then UseAction(12); else  WarriorKnight(); end;
If someone knows a better way of doing the distance thing.. please post it!

Notes:
Slot 32: Feint
Slot 11: Holy Strike
Slot 12: Surprise Attack

53

Tuesday, March 2nd 2010, 5:45pm

I originally tried CastSpellByName("Feint") but it wasn't working so I tried using the slot number.

I'll try to set something up to monitor the combat log and see if I can get that to work.

Thanks for the help guys.

54

Tuesday, March 2nd 2010, 10:47pm

Working on a RogueKnight function but have a question on syntax: what is the difference between using "not ChkBuff("player","Enhanced Armor")" and "not string.find(pbuffs,"Ehanced Armor")" or is there one?

Also, is it advisable to put Premed into the function or will that cause it not to fire the function if in combat already?

Thanks

55

Tuesday, March 2nd 2010, 11:09pm

Function for RogueKnight:

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

    i=i+1; Skill[i] = { ['name'] = "Enhanced Armor",    ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
    i=i+1; Skill[i] = { ['name'] = "Lions Protection",    ['use'] = (not string.find(pbuffs,"Lions Protection")) }
    i=i+1; Skill[i] = { ['name'] = "Premeditation",        ['use'] = ((not string.find(pbuffs,"Premeditation")) and (not combat)) }
    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'] = "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'] = "Disarmament",     ['use'] = (not friendly) }

    MyCombat(Skill,arg1)

end

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

56

Tuesday, March 2nd 2010, 11:54pm

Quoted from "LucasUpright;236835"

Working on a RogueKnight function but have a question on syntax: what is the difference between using "not ChkBuff("player","Enhanced Armor")" and "not string.find(pbuffs,"Ehanced Armor")" or is there one?


I've been curious about this one myself, since I see both in various combat scripts here. As far as I can tell, they both do the same thing, except the first uses a custom function and the later a built-in function.

57

Wednesday, March 3rd 2010, 12:18am

Quoted from "jsalemi;236877"

I've been curious about this one myself, since I see both in various combat scripts here. As far as I can tell, they both do the same thing, except the first uses a custom function and the later a built-in function.


string.find(pbuffs,"Ehanced Armor")
could be used in a loop that iterates through a list of buffs storing each one in pbuffs.

where as:
ChkBuff("player","Enhanced Armor")
compares the second argument to a list of buffs and returns true or false if found or not.

string.find(pbuffs,"Ehanced Armor")
would be what you are likely to find in the function ChkBuff as it loops through all the buffs...

58

Wednesday, March 3rd 2010, 1:32pm

Quoted from "LucasUpright;236835"

Working on a RogueKnight function but have a question on syntax: what is the difference between using "not ChkBuff("player","Enhanced Armor")" and "not string.find(pbuffs,"Ehanced Armor")" or is there one?


While technically either way works, using ChkBuff takes longer to execute if you're using it multiple times in your function. Every time you execute ChkBuff, it goes through each and every one of the buffs on the specified unit looking for the buff/debuff. By storing a string of buffs one time at the beginning of the function and then just using string.find, it only has to make 1 pass through the unit's buffs/debuffs. Remember that every time you run your function, it builds that table, so if you're spamming it 2-3 times per second, any improvements in execution time help to prevent overlap.

One other caveat to using the string.find method is you don't need the full buff/debuff name. For instance, if you're looking for any debuff with the word "Bleed" in it, you'd have to do multiple ChkBuffs (one for each bleed name) but only one string.find. If you do want to use string.find to find the exact full name of the buff/debuff, use slashes before and after the string as that is the delimiter. Example: string.find(tbuffs,"/Shadowstab Bleed/")

59

Wednesday, March 3rd 2010, 1:37pm

Quoted from "LucasUpright;236849"

Preliminary function for RogueKnight:

Source code

1
<snip>


How does that look?


Looks good to me. You could change all of the ChkBuff("player","buffname") calls to the string.find(pbuffs,"buffname") instead to improve performance.

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

60

Wednesday, March 3rd 2010, 2:30pm

Ok, so with a recent change to the Holy Seals buff, things have gone a bit wonky with my Engine, so, need to figure out whats going on.

For some reason my Mana Return is not firing with 3 Holy Seals, but my Threaten does even with Six's help with the proper way to code the new uff Holy Seals %(3%) MR is not firing, I even went so far as to have MR checked first to see if it would fire at all, and my only conclusion at this point is that somehow/somewhere, UnitMana is no longer using the same value to define itself.

here is my current code trying to force Mana Return to fire and it wont. Threaten gets cast when there are 3 Holy Seals and not already buffed.

Source code

1
2
   i=i+1; Skill[i] = { ['name'] = "Mana Return",          ['use'] = (string.find(tbuffs,"Holy Seals %(3%)") and (mana <= .99)) }
   i=i+1; Skill[i] = { ['name'] = "Threaten",             ['use'] = (string.find(tbuffs,"Holy Seals %(3%)") and (not string.find(pbuffs,"Threaten"))) }



T