OK, I look forward to your updated script. It gave me some new ideas of my own after seeing what you had plans for. It's a solid idea, wish I had thought of it. :p
Reposting the original:
I've read through most of this thread - 100 plus of the 120 some odd pages.
This was designed around a Rogue / Druid. The Earth Pulse can be replaced by arrows, lightening bolts or whatever for other class combinations.
|
Source code
|
1
2
3
4
5
6
|
local spell_range = GetActionUsable(21) -- Earth Pulse
local throw_range = GetActionUsable(22) -- Throw
local melee_range = GetActionUsable(23) -- Shadowstab
local front = GetActionUsable(24) -- Blind Stab only usable from front
local back = GetActionUsable(25) -- Blind Spot only usable from rear
local stealth = GetActionUsable(26) -- Sneak Attack only usable out of combat from rear
|
Theory:
All: False. No target selected or way out side of aggro range. Safe to run buffs and character maintenance.
(spell_range) only: True. Close enough to pull the mob. I'm using mine with conditionals (not combat) and (enemy) and (mana >= .75) and (arg2=="pull"). This pulls a mob when I'm close enough using a free, renewable resource (mana) to save projectiles.
(throw_range): True. Same as above except uses a projectile to pull when mana is at a premium and is better reserved for possible heals.
(melee_range): True. Mob is within general melee attack distance. Position is not yet determined.
(melee_range) and (front): Both True. Used for frontal attacks.
(melee_range) and (back): Both True. In back AND in combat. Used for rear attacks.
(stealth): True. In back AND out of combat. Used for stealth attacks.
I'm only about halfway through writing my entire script and haven't thoroughly tested it yet. At this point the only apparent flaws I can find are 1) when positioned at some very odd side attack angles when you're not in front OR in back of the mob; and 2) during the 10 second cooldown from Blind Stab I've experience some odd stuff. However, I'm not familiar enough with how the cooldowns are read to know if the engine knows a skill WILL BE usable once the cooldown expires. Regardless, during those small windows the generic attacks suffice. I will probably drop the melee_range entirely later on as all the generic, front and rear attacks have the same 50 range.
I am missing anything obvious? Are there any secrets in the last 20 pages of this thread I haven't gotten to yet?
Well, I am out of ideas. It does not work. The Theory seems sound. Either there is a problem with my understanding of GetActionUseable() or as more likely seems to be the case is the way the game engine itself (not DIYCE) handles Blind Stab and Blind Spot which are being used to identiy front and back. My suspicion at this point lies with the game engine due to the following tests:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
Target Range Expected Skill State Actual Skill State
1. Blind Stab None N/A Not Ready Ready
1. Blind Spot None N/A Not Ready Ready
2. Blind Stab Self N/A Not Ready Ready
2. Blind Spot Self N/A Not Ready Ready
3. Blind Stab Enemy Out of Range Not Ready Not Ready
3. Blind Spot Enemy Out of Range Not Ready Not Ready
4. Blind Stab Enemy In Range / Front Ready Ready
4. Blind Spot Enemy In Range / Front Not Ready Ready
5. Blind Stab Enemy In Range / Rear Not Ready Ready
5. Blind Spot Enemy In Range / Rear Ready Ready
|
TEST SUMMARY:
TEST 1: Unexpected value. Skills should not be ready as you do not even have a target to use them on.
TEST 2: Unexpected value. Skills should not be ready as there is no reason you would want to attack yourself.
TEST 3: The only test that worked as expected.
TEST 4: Unexpected value for Blind Spot. Blind Spot should not be ready as you are in front of the target.
TEST 5: Unexpected value for Blind Stab. Blind Stab should not be read as you are behind the target. This is the exact opposite problem from Test 4.
It appears (to me) the game engine assumes these skills are always ready and the actual check is not made until the button is pushed. I am not certain if this is accurate or actually what is happening. When I pulled my original post I had only noticed the problem with no target and self target. I thought I could get around it using:
((enemy) and (front/back/stealth))
Not only did that not work, it doesn't begin to address the issue with front and back. For the time being I've reverted to using UnitIsUnit("player", "targettarget") based upon the inaccurate assumption that you are only in front of the mob when tanking. The downside of course is it doesn't work with a real tank in the group.
Based upon what I have read previously, using multiple variables with some nature of (and) conditions to determine location "feels" like a leap forward, but it's not quite there yet.
As I have yet to see another one, I am posting the full Rogue/Druid code as it stands now for discussion and troubleshooting:
|
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
|
function RogueDruid(arg1, arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local mana = PctS("player")
local buffs_player = BuffList("player")
local buffs_target = BuffList("target")
local combat = GetPlayerCombatState()
local dps_assrage = string.find(buffs_player, "Assassins Rage")
local dps_fattack = string.find(buffs_player, "Fervent Attack") -- VERIFY BUFF NAME WHEN ACQUIRED
local dps_informer = string.find(buffs_player, "Informer") -- VERIFY BUFF NAME WHEN ACQUIRED
local enemy = UnitCanAttack("player","target")
local vanished = string.find(buffs_player, "Vanish")
-- DEBUFF VARIABLES
local blind = BuffTimeLeft("target", "Blind")
local bleed = BuffTimeLeft("target", "Bleed")
local wound = BuffTimeLeft("target", "Grievous Wound")
-- POSITION VARIABLES
local tank = UnitIsUnit("player", "targettarget")
local front = GetActionUsable(31) -- Blind Stab only usable from front
local back = GetActionUsable(32) -- Blind Spot only usable from rear
local spell_range = GetActionUsable(11) -- Earth Pulse
local throw_range = GetActionUsable(3) -- Throw
local melee_range = GetActionUsable(28) -- Shadowstab
local stealth = GetActionUsable(27) -- Sneak Attack only usable out of combat from rear
-- AUTO VANISH IF IMMINENT DEATH
if vanished then
return
end
i=i+1; Skill[i] = {name = "Vanish", use = (PctH("player") <= .15)}
-- HEALS
i=i+1; Skill[i] = {name = "Action: 41 (Health Pot)", use = (PctH("player") <= .40)}
i=i+1; Skill[i] = {name = "Action: 42 (Health Pot)", use = (PctH("player") <= .40)}
i=i+1; Skill[i] = {name = "Action: 43 (Health Pot)", use = (PctH("player") <= .40)}
i=i+1; Skill[i] = {name = "Action: 44 (Health Pot)", use = (PctH("player") <= .40)}
i=i+1; Skill[i] = {name = "Action: 45 (Health Pot)", use = (PctH("player") <= .40)}
i=i+1; Skill[i] = {name = "Recover", use = (PctH("player") <= .60) and (not string.find(buffs_player, "Recover"))}
-- CURES
-- INSERT CURE SCRIPT HERE
-- BUFFS
if ((arg2=="pull") and (not combat)) then
i=i+1; Skill[i] = {name = "Savage Blessing", use = ((not string.find(buffs_player, "Savage Blessing")))}
i=i+1; Skill[i] = {name = "Poison", use = ((not string.find(buffs_player, "Poison")))}
i=i+1; Skill[i] = {name = "Hysteric Vengeance", use = ((not string.find(buffs_player, "Hysteric Vengeance")))}
end
-- INSERT AMMO SCRIPT HERE
-- PULL
if ((arg2=="pull") and (enemy) and (not combat)) then
i=i+1; Skill[i] = {name = "Earth Pulse", use = (mana >= .75)}
i=i+1; Skill[i] = {name = "Throw", use = (mana < .75)}
end
-- STEALTH AND ELITE COMBAT
if ((enemy) and (not combat)) then
i=i+1; Skill[i] = {name = "Premeditation", use = ((energy >= 25) and (not string.find(buffs_player, "Premeditation")))}
i=i+1; Skill[i] = {name = "Sneak Attack", use = ((energy >= 35) and (stealth))}
end
i=i+1; Skill[i] = {name = "Assassins Rage", use = ((UnitSex("target") >= 2))} -- INSERT ADDITIONAL DPS BUFF CHECKS WHEN ACQUIRED TO AVOID OVERLAP
-- INSERT INFORMER BUFF WHEN ACQUIRED
-- INSERT FERVENT ATTACK BUFF WHEN AQUIRED
-- GENERIC COMBAT
if (enemy) then
i=i+1; Skill[i] = {name = "Wound Attack", use = ((energy >= 40) and (bleed > 1) and (wound > 1))}
i=i+1; Skill[i] = {name = "Low Blow", use = ((energy >= 35) and (bleed > 2) and (wound < 3))}
i=i+1; Skill[i] = {name = "Shadowstab", use = ((energy >= 25) and (bleed < 3))}
i=i+1; Skill[i] = {name = "Attack", use = (PctH("target") > .99)}
end
-- POSITIONAL COMBAT
if (enemy) then
i=i+1; Skill[i] = {name = "Blind Stab", use = ((energy >= 25) and (blind < 3) and (tank))}
i=i+1; Skill[i] = {name = "Blind Spot", use = ((energy >= 30) and (bleed < 3) and (not tank))}
end
-- NON ESSENTIAL MAINTENANCE
i=i+1; Skill[i] = {name = "Action: 46 (Mana Pot)", use = (mana <= .50)}
i=i+1; Skill[i] = {name = "Action: 47 (Mana Pot)", use = (mana <= .50)}
i=i+1; Skill[i] = {name = "Action: 48 (Mana Pot)", use = (mana <= .50)}
i=i+1; Skill[i] = {name = "Action: 49 (Mana Pot)", use = (mana <= .50)}
MyCombat(Skill, arg1)
end
|
|
Source code
|
1
2
3
4
5
|
/run RogueDruid("v2", "pull")
/run SendSystemChat("END PULL.")
/run RogueDruid("v2")
/run SendSystemChat("END COMBAT.")
|