• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->

Question - script that reads time left on DoTs (1 Viewer)

Joined
Mar 23, 2019
RedCents
137¢
I am making a necro script and its going well but I thought at one point i saw a /if that could read time left on DoT or buff? in otherwords, reads how long is left on a DoT and wont recast until xxx seconds is left on the DoT. is this a thing or am i smoking crack? lol
 
Joined
Aug 27, 2020
RedCents
176¢
I think you're looking for something like this?

/echo ${Target.Slowed.Name} will fade in ${Target.Slowed.Duration.TotalSeconds}s

Obviously, you don't want snared, but that's the first example I came across here.

I think you can find what you're looking for there or here or here.

Sorry, I mostly just use OPC (other people's code) here, but hopefully, that gets you in the right direction.
 

ctaylor22

Moderator
Joined
Mar 21, 2014
RedCents
19,479¢
What @naamloseeen explained is correct. What ${Target.Slowed} returns is a type Spell, and so does ${Target.Buff[Some DOT Name]} so you can use ${Target.Buff[DOT Name Here].Duration.TotalSeconds} as well. Use ${Target.Buff[DOT Name Here].ID} to test if the target has the Debuff.
 
Joined
Oct 5, 2012
RedCents
1,671¢
I am a fan of creating declaring timers, then during the main combat loop checking if the timer=0. If it does equal zero then it will cast the dot, nuke, etc. If the timer is greater than 0, then skip that spell and continue on until the combat loop comes back around.
 

Coldblooded

Purveyor of all things MQNext and Lua
Joined
Mar 23, 2019
RedCents
3,605¢
I am a fan of creating declaring timers, then during the main combat loop checking if the timer=0. If it does equal zero then it will cast the dot, nuke, etc. If the timer is greater than 0, then skip that spell and continue on until the combat loop comes back around.
I wonder if setting a timer, that is then queried in a condition is actually more efficient than just querying memory for the amount of time left. If it isn't just querying memory seems to be a better way in terms of fewer things to go wrong, and less overhead of extra variables.
 
Joined
Oct 5, 2012
RedCents
1,671¢
I wonder if setting a timer, that is then queried in a condition is actually more efficient than just querying memory for the amount of time left. If it isn't just querying memory seems to be a better way in terms of fewer things to go wrong, and less overhead of extra variables.

I'm not incredibly skilled with macros, so I always tried to keep it as simple as I could. The more complex it became the more I felt like I wasn't able to keep my head above water in a lot of cases. Especially if I wasn't incredibly familiar with what a function did.

For example I have a healing macro that checks group average HP with a snipped I used from another macro I came across when I first got into scripting for MQ2, and I don't entire know how it works. It's always bothered me, but it worked for what I needed and just kinda let it slide.

I've used the timer method I mentioned for most of my emu experience since KA was iffy at best for them, and completely unresponsive at worst. So I could reliably find the duration of a buff or dot and hard set a timer every time the spell was cast.

Timer1 would equal 0 initially, once cast for a dot Timer1 would be set to 18000 (for example). During the dos rotation it would check if Timer1=0. If not, skip and cast something else.

Once combat ends and you receive an exp message or kill message set Timer1 to 0 again as a safety to ensure it would be available for the next pull.

I used the same method for buffs, but less involved since all that was required for that was to check for combat state and that timer=0.

It may not have been the best but I managed to get it to be reliable about 95% of the time. Those 5% situations being when a buff wouldn't land on a puller or DPS timer wouldn't reset on a no exp mob. Mostly non-issue situations.

I have some examples but am currently out of the house. When I get home I'll see if I can get what I used @zathus to see if you might be able to cannibalize anything from them for yourself.
 
Joined
Mar 23, 2019
RedCents
137¢
What @naamloseeen explained is correct. What ${Target.Slowed} returns is a type Spell, and so does ${Target.Buff[Some DOT Name]} so you can use ${Target.Buff[DOT Name Here].Duration.TotalSeconds} as well. Use ${Target.Buff[DOT Name Here].ID} to test if the target has the Debuff.
Thru my testing, ${Target.buff.xxx.ID} will check that specific ID but that includes other casters. ${Target.MyBuff.xxx.ID} seems to fix that. In other words if there is another necro it only looks for my DoT, not all DoTs. Interestingly enough, the script re-casts the DoT at around the 6 seconds left timer. I need to play with it more as to why that happens. This may be useful to someone else but i also wanted the scripts to loop but only if there is a Mob and the solution i came up with seems to work ok. here is an example. I also changed it to the spell gem instead of the name of the spell. doing this allows me to mem whatever i want in any order and it doesnt mess with the script as long as its a debuff. half the fun is fine tuning to perfection so their are improvements to be made but so far works pretty good


INI:
#warning
#turbo 200

Sub Main
:Loop
/delay 5s ${Me.SpellReady[1]}
/if (${Target.Type.Equal[NPC]} && ${Me.SpellReady[1]} && ${Target.MyBuff[${Me.Gem[1].Name}].ID}==0) /cast 1
/if (${Me.XTarget} > 0) /goto :Loop
/if (${Me.XTarget} == 0) /end
 
Joined
Mar 23, 2019
RedCents
137¢
What @naamloseeen explained is correct. What ${Target.Slowed} returns is a type Spell, and so does ${Target.Buff[Some DOT Name]} so you can use ${Target.Buff[DOT Name Here].Duration.TotalSeconds} as well. Use ${Target.Buff[DOT Name Here].ID} to test if the target has the Debuff.
and to clarify, what I'm trying to achieve is at lets say, 3 seconds left on the DoT to expire it recasts it instead of reaching zero. so to keep the DoT always on but not waste it instead of after it fades
 

ctaylor22

Moderator
Joined
Mar 21, 2014
RedCents
19,479¢
INI:
#warning
#turbo 200

Sub Main
:Loop
/delay 10 ${Me.SpellReady[1]}
|/if (${Target.Type.Equal[NPC]} && ${Me.SpellReady[1]} && ${Target.MyBuff[${Me.Gem[1].Name}].ID}==0) /cast 1
/if (${Target.Type.Equal[NPC]} && ${Me.SpellReady[1]}) {
    /if (!${Target.MyBuff[${Me.Gem[1].Name}].ID} || ${Target.MyBuff[${Me.Gem[1].Name}].Duration.TotalSeconds}<4) {
        /cast 1
    } else {
        /delay 5
    }
}
/if (${Me.XTarget} > 0) /goto :Loop
/if (${Me.XTarget} == 0) /end

Try something like this.
 
Joined
Mar 23, 2019
RedCents
137¢
INI:
#warning
#turbo 200

Sub Main
:Loop
/delay 10 ${Me.SpellReady[1]}
|/if (${Target.Type.Equal[NPC]} && ${Me.SpellReady[1]} && ${Target.MyBuff[${Me.Gem[1].Name}].ID}==0) /cast 1
/if (${Target.Type.Equal[NPC]} && ${Me.SpellReady[1]}) {
    /if (!${Target.MyBuff[${Me.Gem[1].Name}].ID} || ${Target.MyBuff[${Me.Gem[1].Name}].Duration.TotalSeconds}<4) {
        /cast 1
    } else {
        /delay 5
    }
}
/if (${Me.XTarget} > 0) /goto :Loop
/if (${Me.XTarget} == 0) /end

Try something like this.
nailed it! i removed the un-needed code that's redundant. toyed around a little. this works perfectly! this stacks the 4 dots and starts recasting with 3 seconds left. have a few versions depending on the mob and they all work great now! Thank you!
INI:
#warning
#turbo 200

Sub Main
:Loop
/delay 50 ${Me.SpellReady[1]}
/if (${Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[1].Name}].ID} || ${Target.MyBuff[${Me.Gem[1].Name}].Duration.Seconds}<1) /cast 1
/delay 50 ${Me.SpellReady[2]}
/if (${Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[2].Name}].ID} || ${Target.MyBuff[${Me.Gem[2].Name}].Duration.Seconds}<1) /cast 2
/delay 50 ${Me.SpellReady[3]}
/if (${Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[3].Name}].ID} || ${Target.MyBuff[${Me.Gem[3].Name}].Duration.Seconds}<1) /cast 3
/delay 50 ${Me.SpellReady[4]}
/if (${Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[4].Name}].ID} || ${Target.MyBuff[${Me.Gem[4].Name}].Duration.Seconds}<1) /cast 4
/if (${Me.XTarget} > 0) /goto :Loop
/if (${Me.XTarget} == 0) /end
 

Users who are viewing this thread

Top