Quoted from "Sixpax;312057"
Why not just put a check near the top of your function to see if you have low health and the vanish/hide buff in effect, and if so, just return from the function so nothing gets executed?
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
--Healing
-- i=i+1; Skill[i] = { name = "Urgent Heal", use = (health <= .70) }
-- i=i+1; Skill[i] = { name = "Regenerate", use = ((health <= .90) and (not string.find(buffs,"Regenerate"))) }
--Buffs
-- i=i+1; Skill[i] = { name = "Essence of Magic", use = ((not string.find(buffs,"Essence of Magic")) or (BuffTimeLeft("player","Essence of Magic") < 5)) }
--AOE
if (arg2 == "aoe") then
i=i+1; Skill[i] = { name = "Electrostatic Charge", use = (true) }
i=i+1; Skill[i] = { name = "Discharge", use = (true) }
i=i+1; Skill[i] = { name = "Purgatory Fire", use = (true) }
end
|
Quoted from "jgill33;312127"
Now my question is:
When the function calls Regenerate or Urgent heal or even Essence of Magic the cursor turns to a wand and it waits until I click on my toon for the spell to cast, which really sucks if I'm not paying close attention. Is there a way to tell it to cast it on myself, so the cursor doesn't change and wait for a target?
Quoted from "Sixpax;312057"
Why not just put a check near the top of your function to see if you have low health and the vanish/hide buff in effect, and if so, just return from the function so nothing gets executed?
Quoted from "lokanu;311442"
![]()
Source code
1 2 3 4 5 6... function RogueKnight(arg1, arg2) if(os.time() < wait)then return -- If we're still in wait cycle, skip running and let the game continue end ...
Quoted from "lokanu;312467"
That's actually what I suggested, except I included a timing bit so that after his wait period, he can continue to use the engine. You can see the full post here.
Say he gets healed while in Vanish, and wants to use the engine to break Vanish and start attacking again. Reducing it down to a simple buff-check and return will require you to manually break out of Hide/Vanish in the event you should want to override it. Using that argument against my suggestion of a wait, it's likely that after the Healer's response time + heal's cast time, the wait will have passed and the engine would be available immediately.
|
|
Source code |
1 2 3 4 5 6 7 |
--Vanish
if ((health < .25) and (UnitDebuff("player",1) == nil) and CD("Vanish")) then
i=i+1; Skill[i] = { name = "Vanish", use = (combat) }
CEwait(5)
MyCombat(Skill,arg1)
return -- Skip function and start wait cycle
end
|
|
|
Source code |
1 2 3 |
if((os.time() < wait) and string.find(pbuffs,"Vanish"))then
return -- If we're still in wait cycle, skip running and let the game continue
end
|
Quoted from "jgill33;312570"
But the way the code is written, even if he checks for the vanish buff instead of enhanced armor, he won't be able to use the engine until the buff is gone. Which means the engine can't be used to break the vanish even if he gets healed and the wait time is up, because one of the first checks is the buff check and if it passes (which it will because you've done nothing to get rid of that buff because you've been waiting) then the wait timer is reset to another 5 seconds and you are returned out of the function to wait.
The problem is the call to use vanish and how the wait timer is set. Here's how it should look to function the way you're thinking lokanu.
Also it would probably be best to add an additional check to the waiting cycle, so that if you get knocked out of vanish before the wait timer is up, you can use the engine immediately without have to wait it out.
![]()
Source code
1 2 3 4 5 6 7--Vanish if ((health < .25) and (UnitDebuff("player",1) == nil) and CD("Vanish")) then i=i+1; Skill[i] = { name = "Vanish", use = (combat) } CEwait(5) MyCombat(Skill,arg1) return -- Skip function and start wait cycle end
Now, this means it might have to get bumped down some so that pbuffs is defined and filled before you can check.
![]()
Source code
1 2 3if((os.time() < wait) and string.find(pbuffs,"Vanish"))then return -- If we're still in wait cycle, skip running and let the game continue end
|
|
Source code |
1 2 3 4 5 6 |
...
function RogueKnight(arg1, arg2)
if(os.time() < wait)then
return -- If we're still in wait cycle, skip running and let the game continue
end
...
|
Quoted from "lokanu;312699"
Sure the engine can be used to break Vanish, after the wait is up. It only skips the engine during the wait. Once the wait is over, it no longer prevents it from running. No additional code needed. Vanish has a 10 minute cooldown, so it's not going to call it again for a while. You're suggesting to limit the wait cycle solely for Vanish, when I'm suggesting to leave it available for many other possible functions. I'm actually planning to use this for a R/W hand-swap idea I've been wanting to merge into DIYCE. My only further suggestion was to reduce the wait to 3 seconds as I thought 5 was a bit long.
This can be read literally as: "If the current time is under wait time, then return"
![]()
Source code
1 2 3 4 5 6... function RogueKnight(arg1, arg2) if(os.time() < wait)then return -- If we're still in wait cycle, skip running and let the game continue end ...
|
|
Source code |
1 2 3 4 |
if string.find(pbuffs,"Enhanced Armor") then
CEwait(5)
return -- Skip function and start wait cycle
end
|
Quoted from "jgill33;312833"
I know exactly what you mean with the os.time() < wait code at the top of the function, I really don't have a problem with that piece of code.
It's this piece of code that will not allow the engine to be used to break Vanish:
(Assuming the buff is changed to Vanish) This piece of code is not tied to the calling of Vanish so it is executed every time the function is called and checks for the vanish buff and if its on then sets the wait timer and the wait cycle begins. With this piece of code so near the top, every time you call the function and the wait timer is done and you are still vanished, then it will just reset the wait timer for another 5 seconds because the buff hasn't been broken, because there is no code before this that will trigger and break Vanish. See what I'm saying?
![]()
Source code
1 2 3 4if string.find(pbuffs,"Enhanced Armor") then CEwait(5) return -- Skip function and start wait cycle end
I think the wait timer is a great idea and I'm not disputing the wait timers uses or that you strictly limit it to Vanish, I'm just making a suggestion as to the way it was called and set in this case, that's all.
Quoted from "lokanu;311442"
I'm boggled here as to why you're checking for "Enhanced Armor" ... I would think you'd check for the Vanish 20 second buff, but I left it as you had it. It's 5 am and I'm tired.
Quoted from "Pharoh93;311592"
Thank you very much for the thorough explaination, the reason I left it as "enhanced armor" is because I was messing with my code trying to get it to work and Vanish is on a 10 minute timer so i needed a buff for the wait function to check to that was more readily available.![]()
|
|
Source code |
1 2 3 4 5 6 |
--Vanish
i=i+1; Skill[i] = { name = "Vanish", use = ((health < .25) and (UnitDebuff("player",1) == nil)) }
if string.find(pbuffs,"Vanish") then
CEwait(5)
return -- Skip function and start wait cycle
end
|
|
|
Source code |
1 2 3 4 5 6 7 |
--Vanish
if ((health < .25) and (UnitDebuff("player",1) == nil) and CD("Vanish")) then
i=i+1; Skill[i] = { name = "Vanish", use = (combat) }
CEwait(5)
MyCombat(Skill,arg1)
return -- Skip function and start wait cycle
end
|
Quoted from "BluSky;313390"
If there is a function that finds your level then the various skills could utilize that as a condition.
pseudocode:
local level = (LevelFindingFunction("player"))
use = (( level => 10 ) and (whatever) )
|
|
Source code |
1 |
local plevel,slevel = UnitLevel("player")
|
|
|
Source code |
1 2 3 4 5 6 7 |
function CustomAction(action)
if(action == "Shot")then
CastSpellByName(action)
end
return false
end
i=i+1; Skill[i] = { ['name'] = "Custom: Shot", ['use'] = (not friendly) }
|
|
|
Source code |
1 |
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
|
Quoted from "HuBu;313573"
Is there a way to detect if multiple mobs are hitting you? I would like my 'whirlwind shield' to only hit if there are multiple mobs on me?
Quoted from "jdstang;313807"
Maybe someone can help me with an issue I'm having. When I use the custom function below, if I'm kiting a mob the script never executes. It starts the animation, but nothing ever happens. This only happens when I'm strafing and attacking.
|
|
Source code |
1 2 3 4 5 6 7 |
function CustomAction(action)
if(action == "Shot")then
CastSpellByName(action)
return true
end
return false
end
|
Quoted from "Sixpax;313822"
You need to set the return value to true when it does use Shot, otherwise the engine thinks no action was taken and tries to execute something else at the same time.
So your code should be:
I'm curious though why you'd use a custom action for that?
![]()
Source code
1 2 3 4 5 6 7function CustomAction(action) if(action == "Shot")then CastSpellByName(action) return true end return false end
Quoted from "jdstang;313807"
Maybe someone can help me with an issue I'm having. When I use the custom function below, if I'm kiting a mob the script never executes. It starts the animation, but nothing ever happens. This only happens when I'm strafing and attacking.
Quoted from "ooglydit;313884"
It's because the "Shot" skill doesn't activate the GCD.
This means that you WANT the engine to think no action was taken and execute another action at the same time because the game would allow it.
|
|
Source code |
1 2 |
/cast Shot /cast Wind Arrows |
Quoted from "ooglydit;313884"
It's because the "Shot" skill doesn't activate the GCD.
This means that you WANT the engine to think no action was taken and execute another action at the same time because the game would allow it.
Not sure why your script isn't firing.
I have that exact function and code in amongst my code and Shot fires fine, whether strafing or still.
What makes you think it's not firing?