DOTing for a Beastlord Hunter Script

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Jeegan
orc pawn
orc pawn
Posts: 14
Joined: Tue Aug 24, 2004 3:14 pm

DOTing for a Beastlord Hunter Script

Post by Jeegan » Tue Aug 31, 2004 12:55 pm

Hello all. I am trying to add a DOT section to my beastlord hunter script. I have it setup to be able to kick and DD but with my current setup if I put a DOT using the line I use for the DD, it will chain cast it, but I want it to just cast when it wears off the mob. Is this possible? Here is my current special combat sub.

Code: Select all

Sub SpecialIt

   /declare TempID    int inner  0
   /doevents

   /if ((${Target.Distance}<11)&&(${Me.AbilityReady["Kick"]})) {
   /call Kick
   }

   /if ((${Me.Gem["Blast of Frost"]})&&(${Me.SpellReady["Blast of Frost"]})) {
   /cast "Blast of Frost"
   }

/return

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Tue Aug 31, 2004 1:28 pm

I'd assume you'll need an event that looks for the "Your XXX spell has worn off" message", but I have no idea how to code it!
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Tue Aug 31, 2004 4:32 pm

I don't like events cause they can screw up sometimes (or maybe it's me, but I prefer to blame them and avoid when possible). Plus it's a hassle to call doevents all the time.

Try:

Code: Select all

| (In Sub Main general declarations)

/declare DOTimer timer outer 0

Code: Select all


Sub SpecialIt 

   /declare TempID    int inner  0 
   /doevents 

   /if ((${Target.Distance}<11)&&(${Me.AbilityReady["Kick"]})) { 
   /call Kick 
   } 

   /if ((${Me.Gem["DOTHERE"]})&&(${Me.SpellReady["DOTHERE"]})&&(!${DOTimer})) { 
   /cast "DOTHERE"
   /varset DOTimer ${Math.Calc[${Spell[DOTHERE].Duration}*10]}m
   } 

/return 

should work, or close to that.

[edit] Oh, btw, it won't take into account extended duration focii... and unless you clear the variable on mob death it'll wait for the original one to run out before casting again. Both minor points though.

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Tue Aug 31, 2004 7:43 pm

I find it best to use kick when attack is on, because of mezzed mobs and targetting. Also, throw in spellcast.inc or spell_routines.inc and whatch for interrupts/resists, ect.

Jeegan
orc pawn
orc pawn
Posts: 14
Joined: Tue Aug 24, 2004 3:14 pm

Post by Jeegan » Tue Aug 31, 2004 11:02 pm

I tried adding that, but it doesn't seem to do anything, I don't cast the spell for some reason. No errors or anything, just no casting, I kick fine, however.

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Wed Sep 01, 2004 3:31 am

Did you chance the code he posted?

Code: Select all

   /if ((${Me.Gem["DOTHERE"]})&&(${Me.SpellReady["DOTHERE"]})&&(!${DOTimer})) { 
   /cast "DOTHERE" 
   /varset DOTimer ${Math.Calc[${Spell[DOTHERE].Duration}*10]}m
Did you chance DOTHERE in each instance?

Jeegan
orc pawn
orc pawn
Posts: 14
Joined: Tue Aug 24, 2004 3:14 pm

Post by Jeegan » Wed Sep 01, 2004 9:40 am

This is what I put in.

Code: Select all

   /if ((${Me.Gem["Sicken"]})&&(${Me.SpellReady["Sicken"]})&&(!${DOTimer})) {
   /cast "Sicken"
   /varset DOTimer ${Math.Calc[${Spell["Sicken"].Duration}*10]}m
   }

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Wed Sep 01, 2004 10:02 am

Is this correct??

Code: Select all

   /if ((${Me.Gem["Sicken"]})&&(${Me.SpellReady["Sicken"]})&&(!${DOTimer})) { 
   /cast "Sicken" 
   /varset DOTimer ${Math.Calc[${Spell["Sicken"].Duration}*10]}m 
   } 
Isn't there one too many sets of "( )"? Shouldn't it be...

Code: Select all

   /if ( ${Me.Gem["Sicken"]} && ${Me.SpellReady["Sicken"]})&&(!${DOTimer} ) { 
   /cast "Sicken" 
   /varset DOTimer ${Math.Calc[${Spell["Sicken"].Duration}*10]}m 
   } 
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Wed Sep 01, 2004 3:43 pm

From my experience, (s and )s don't (usually) really matter as long as you have at least one around the whole if, and if each open has a matched close.

The way you have it I don't think it'll work... no matter what the way I've written shouldn't be a problem though.

as a sidenote, you don't need ""s with ${Spell[]} so... ${Spell[Sicken]... should be fine.. I don't remember if that causes a problem or not, but wouldn't think so. while you're running the script.. try doing /echo ${DOTimer} a few times and see if it's ever changed.

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Wed Sep 01, 2004 4:07 pm

well I can't see the rest of the code, but maybe chance it to ${DOTimer}==0 would help. Also, I notice only 1 "T" as in not DOT Timer, make sure your spelling matches in all places.

Jeegan
orc pawn
orc pawn
Posts: 14
Joined: Tue Aug 24, 2004 3:14 pm

Post by Jeegan » Wed Sep 01, 2004 6:32 pm

When I type /echo ${DOTimer}, I get NULL back from MQ2. I added the ==0 to the line but that didn't do anything either. Would it be better if I post the whole macro?

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Wed Sep 01, 2004 6:43 pm

You can't /echo ${DOTimer} from outside the macro because that variable is declared as an "outer", which means it's availiable in the scope of the macro but from the console. If you want to do that you'd have to declare it as "global".

Jeegan
orc pawn
orc pawn
Posts: 14
Joined: Tue Aug 24, 2004 3:14 pm

Post by Jeegan » Wed Sep 01, 2004 6:47 pm

On a side note, how can I add a sub routine to my macro to check and cure poison? BTW, thank you all for all the help.

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Wed Sep 01, 2004 11:08 pm

I was talking about /echoing it at different points of the macro.. I'm assuming it's a bigger macro and lasts a fairly long time... else why would you need to recast like that?

[Edit] Just reread... yes, you can /echo a variable from a macro while that macro is running. The scope determines the length of existence of the variable, not the access available.

PhoenixZorn
Macro Czar
Posts: 127
Joined: Fri Dec 12, 2003 2:20 pm
Contact:

Post by PhoenixZorn » Thu Sep 02, 2004 1:49 am

#include Spellcast.inc

#Event_CurePoison "You have been poisoned"

Sub Event_CurePoison
/target me
/cast "Cure Poison"
/return