#*#can't find this text to trigger event#*#

For questions regarding conversion of scripts from the old, parm style to the new MQ2Data format. Conversion questions only!

Moderator: MacroQuest Developers

TheSalesman
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sat Apr 17, 2004 7:41 pm

#*#can't find this text to trigger event#*#

Post by TheSalesman » Sat Jul 03, 2004 4:30 am

I am using the new HUD to show my DoT damage real-time, including crits and total damage to mob. I am having problems with #event handling, and it is with the new #*# that seems to be the problem.

Take a line like:

Trakanon's body begins to splurt.

Matched by:

Code: Select all

#event "#*#begins to splurt#*#"
or any other number of ways. Take my code:

Code: Select all

#event snaredcast "#*# is engulfed in an embracing darkness#*#"
#event Pyrocast "#*#blood ignites#*#"
#event DPcast "#*#covered in black spots#*#"
#event FPcast "#*#enveloped#*#"
#event NFcast "#*#blood boils through#*#"
#event BoTcast "#*#veins turn a vile shade of green#*#"
#event Splurtcast "#*#body begins to splurt#*#"
#event NBcast "#*#renewed#*#"

#event dotick "#*#taken #1# damage from your #2#."
These are various trigger events for necro dots, so I am able to start my counters and damage que. The dotick event handles the actual damage, depending on param #2 assigns it to whatever dot is doing the damage.

dotick event works fine. The rest, are completely random. Sometimes they go off, sometimes they don't. Especially if I change the trigger string. For example, my Splurtcast event doesn't work (but it should, the string matches just fine), if I change the string to say, "#*#body begins#*#" or "#1#to splurt#*#" then the Splurtcast event might work, but it is guaranteed that one other event will NOT work. It is driving me crazy, where is my error?

Here's the full code if anyone wants to use it. The macro adds up the damage just fine, but it doesn't recognize when a dot is being first cast, and so screwy things start happening.

Macro is:

Code: Select all

#event dahail "#*#Hail,#*#"
#event snaredcast "#*#engulfed#*#embracing darkness#*#"
#event Pyrocast "#*#blood ignites#*#"
#event DPcast "#*#covered in black spots#*#"
#event FPcast "#*#enveloped#*#"
#event NFcast "#*#blood boils through#*#"
#event BoTcast "#*#veins turn a vile shade of green#*#"
#event Splurtcast "#*#body begins to splurt#*#"
#event NBcast "#*#renewed#*#"

#event dotick "#*#taken #1# damage from your #2#."

Sub Event_dotick(string Line,int dmg,string dotname)
	/if (${String[${dotname}].Equal["Splurt"]}) {
		/varcalc Splurt_dmg ${Splurt_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc Splurt_time ${Splurt_time}-1
		/if (${dmg}>300) {
			/varcalc Splurt_crit ${Splurt_crit}+1
		}
	} else /if (${String[${dotname}].Equal["Night's Beckon"]}) {
		/varcalc NB_dmg ${NB_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc NB_time ${NB_time}-1
		/if (${dmg}>400) {
			/varcalc NB_crit ${NB_crit}+1
		}
	} else /if (${String[${dotname}].Equal["Pyrocruor"]}) {
		/varcalc Pyro_dmg ${Pyro_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc Pyro_time ${Pyro_time}-1
		/if (${dmg}>200) {
			/varcalc Pyro_crit ${Pyro_crit}+1
		}
	} else /if (${String[${dotname}].Equal["Funeral Pyre of Kelador"]}) {
		/varcalc FP_dmg ${FP_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc FP_time ${FP_time}-1
		/if (${dmg}>500) {
			/varcalc FP_crit ${FP_crit}+1
		}
	} else /if (${String[${dotname}].Equal["Night Fire"]}) {
		/varcalc NF_dmg ${NF_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc NF_time ${NF_time}-1
		/if (${dmg}>600) {
			/varcalc NF_crit ${NF_crit}+1
		}
	} else /if (${String[${dotname}].Equal["Blood of Thule"]}) {
		/varcalc BoT_dmg ${BoT_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc BoT_time ${BoT_time}-1
		/if (${dmg}>600) {
			/varcalc BoT_crit ${BoT_crit}+1
		}
	} else /if (${String[${dotname}].Equal["Dark Plague"]}) {
		/varcalc DP_dmg ${DP_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc DP_time ${DP_time}-1
		/if (${dmg}>200) {
			/varcalc DP_crit ${DP_crit}+1
		}
	} else /if (${String[${dotname}].Equal["Embracing Darkness"]}) {
		/varcalc ED_dmg ${ED_dmg}+${dmg}
		/varcalc Mob_dmg ${Mob_dmg}+${dmg}
		/varcalc ED_time ${ED_time}-1
		/if (${dmg}>100) {
			/varcalc ED_crit ${ED_crit}+1
		}
	}
/return

Sub Event_snaredcast
	/varset ED_time 21
	/varset ED_name Embracing Darkness
	/varset ED_dmg 0
|	/varset ED_crit 0
/return

Sub Event_Splurtcast
	/varset Splurt_time 17
	/varset Splurt_name Splurt
	/varset Splurt_dmg 0
|	/varset Splurt_crit 0
/return

Sub Event_NBcast
	/varset NB_time 11
	/varset NB_name Night's Beckon
	/varset NB_dmg 0
|	/varset NB_crit 0
/return

Sub Event_Pyrocast
	/varset Pyro_time 19
	/varset Pyro_name Pyrocruor
	/varset Pyro_dmg 0
|	/varset Pyro_crit 0
/return

Sub Event_FPcast
	/varset FP_time 10
	/varset FP_name Funeral Pyre
	/varset FP_dmg 0
|	/varset FP_crit 0
/return

Sub Event_NFcast
	/varset NF_time 10
	/varset NF_name Night Fire
	/varset NF_dmg 0
|	/varset NF_crit 0
/return

Sub Event_BoTcast
	/varset BoT_time 8
	/varset BoT_name Blood of Thule
	/varset BoT_dmg 0
|	/varset BoT_crit 0
/return

Sub Event_DPcast
	/varset DP_time 21
	/varset DP_name Dark Plague
	/varset DP_dmg 0
|	/varset DP_crit 0
/return

Sub Event_dahail
	/varset Mob_dmg 0
	/varset BoT_dmg 0
	/varset FP_dmg 0
	/varset NF_dmg 0
	/varset ED_dmg 0
	/varset Pyro_dmg 0
	/varset DP_dmg 0
	/varset Splurt_dmg 0
	/varset NB_dmg 0

	/varset BoT_time 0
	/varset FP_time 0
	/varset NF_time 0
	/varset ED_time 0
	/varset Pyro_time 0
	/varset DP_time 0
	/varset Splurt_time 0
	/varset NB_time 0

	/varset BoT_crit 0
	/varset FP_crit 0
	/varset NF_crit 0
	/varset ED_crit 0
	/varset Pyro_crit 0
	/varset DP_crit 0
	/varset Splurt_crit 0
	/varset NB_crit 0

	/varset BoT_name
	/varset FP_name
	/varset NF_name
	/varset ED_name
	/varset Pyro_name
	/varset DP_name
	/varset Splurt_name
	/varset NB_name

/return

Sub Main
	/declare Mob_dmg int outer 0

	/declare BoT_dmg int outer
	/declare FP_dmg int outer
	/declare NF_dmg int outer
	/declare ED_dmg int outer
	/declare Pyro_dmg int outer
	/declare DP_dmg int outer
	/declare Splurt_dmg int outer
	/declare NB_dmg int outer

	/declare BoT_name string outer
	/declare FP_name string outer
	/declare NF_name string outer
	/declare ED_name string outer
	/declare Pyro_name string outer
	/declare DP_name string outer
	/declare Splurt_name string outer
	/declare NB_name string outer

	/declare BoT_time int outer
	/declare FP_time int outer
	/declare NF_time int outer
	/declare ED_time int outer
	/declare Pyro_time int outer
	/declare DP_time int outer
	/declare Splurt_time int outer
	/declare NB_time int outer

	/declare BoT_crit int outer
	/declare FP_crit int outer
	/declare NF_crit int outer
	/declare ED_crit int outer
	/declare Pyro_crit int outer
	/declare DP_crit int outer
	/declare Splurt_crit int outer
	/declare NB_crit int outer

	:daloop
|		/doevents snaredcast
|		/doevents Pyrocast
|		/doevents DPcast
|		/doevents FPcast
|		/doevents NFcast
|		/doevents BoTcast
|		/doevents Splurtcast
|		/doevents NBcast
|		/doevents dahail
|		/doevents dotick
		/doevents

		/delay 1
		/goto :daloop

/endmacro
And the HUD to go along with it:

Code: Select all

[MQ2HUD]
Last=Elements

[Elements]  	
;The order is TYPE,X,Y,RED,GREEN,BLUE,TEXT  	
TargetInfo=3,5,35,255,255,255,${Target}  	
LabelText=3,400,20,255,255,255,Effect Name
LabelText2=3,530,20,255,255,255,Damage Done
LabelText3=3,630,20,255,255,255,Ticks Left
LabelLine=3,400,21,255,255,255,__________________________________________
EffectLabel1=3,400,35,0,255,100,${ED_name}
EffectLabel2=3,400,45,125,125,255,${DP_name}
EffectLabel3=3,400,55,125,125,255,${Pyro_name}
EffectLabel4=3,400,65,125,125,255,${FP_name}
EffectLabel5=3,400,75,125,125,255,${NF_name}
EffectLabel6=3,400,85,125,125,255,${BoT_name}
EffectLabel7=3,400,95,125,125,255,${Splurt_name}
EffectLabel8=3,400,105,125,125,255,${NB_name}
EffectLabel1dmg=3,530,35,0,255,100,${ED_dmg}
EffectLabel1crit=3,360,35,255,100,100,${ED_crit}
EffectLabel1ticks=3,630,35,100,255,100,${ED_time}
EffectLabel2dmg=3,530,45,125,125,255,${DP_dmg}
EffectLabel2crit=3,360,45,255,100,100,${DP_crit}
EffectLabel2ticks=3,630,45,125,125,255,${DP_time}
EffectLabel3dmg=3,530,55,125,125,255,${Pyro_dmg}
EffectLabel3crit=3,360,55,255,100,100,${Pyro_crit}
EffectLabel3ticks=3,630,55,125,125,255,${Pyro_time}
EffectLabel4dmg=3,530,65,125,125,255,${FP_dmg}
EffectLabel4crit=3,360,65,255,100,100,${FP_crit}
EffectLabel4ticks=3,630,65,125,125,255,${FP_time}
EffectLabel5dmg=3,530,75,125,125,255,${NF_dmg}
EffectLabel5crit=3,360,75,255,100,100,${NF_crit}
EffectLabel5ticks=3,630,75,125,125,255,${NF_time}
EffectLabel6dmg=3,530,85,125,125,255,${BoT_dmg}
EffectLabel6crit=3,360,85,255,100,100,${BoT_crit}
EffectLabel6ticks=3,630,85,125,125,255,${BoT_time}
EffectLabel7dmg=3,530,95,125,125,255,${Splurt_dmg}
EffectLabel7crit=3,360,95,255,100,100,${Splurt_crit}
EffectLabel7ticks=3,630,95,125,125,255,${Splurt_time}
EffectLabel8dmg=3,530,105,125,125,255,${NB_dmg}
EffectLabel8crit=3,360,105,255,100,100,${NB_crit}
EffectLabel8ticks=3,630,105,125,125,255,${NB_time}
LabelLine2=3,400,106,255,255,255,__________________________________________
LabelText4=3,400,120,255,100,100,Total Damage:
LabelText5=3,530,120,255,100,100,${Mob_dmg}
Last edited by TheSalesman on Sat Jul 03, 2004 5:07 am, edited 1 time in total.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sat Jul 03, 2004 4:56 am

Make sure in mq2main/blech/blech.h you see this..
#define BLECHVERSION "Lax/Blech 1.5.1"

If it's not 1.5.1, you dont have the newest Blech because you dont update cleanly.. If you do, then there's possibly another bug in Blech. I went through a lot of testing on Blech though on the current version, so I dont see why this would be a problem.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

TheSalesman
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sat Apr 17, 2004 7:41 pm

Post by TheSalesman » Sat Jul 03, 2004 5:09 am

Yep have 1.5.1

As the code is right now, out of 8 dots that I cast, 7 of them trigger their proper #event. The only one that doesn't is the snaredcast. But like I said, if I play around enough with the string I'll make it work, but guarantee that some of the others will storm working instead. I'm thinking that I can try to code around it using |${targetname}| so I don't have to use the #*#.

And Lax, thanks for the fast reply, I'm thankful for your help.

TheSalesman
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sat Apr 17, 2004 7:41 pm

Post by TheSalesman » Sat Jul 03, 2004 8:36 am

Fix (hacked):

Here's what works that I use now:

Code: Select all

#event dahail "#5#Hail, #4#'"
#event snaredcast "#*# is engulfed in an embracing darkness."
#event Pyrocast "#*#'s blood ignites."
#event DPcast "#*#'s skin is covered in black spots."
#event FPcast "#*# is enveloped in a funeral pyre."
#event NFcast "#*#'s blood boils through his skin."
#event BoTcast "#*#'s veins turn a vile shade of green."
#event Splurtcast "#*#'s body begins to splurt."
#event NBcast "You feel your body being renewed."

#event dotick "#3	# has taken #1# damage from your #2#."
Probably should post the macro for the necro's who like to solo dot out there.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Sat Jul 03, 2004 11:45 am

If the events are going off randomly, I would look at the :daloop in your Main sub. Why do you have all of the individual events commented out? I would uncomment them so that it processes at least 1 of each event, each time through the loop:

I dont know if its required or just convention, but I would put your Sub Main first in the macro, before your event subs.

I would suggest changing your dahail event. Either renaim it Sub Event_Slain and replace #event dahail "#*#Hail,#*#" with:

Code: Select all

#event Slain "#1# has been slain by #*#"
#event Slain "You have slain #1#!"
or if you really want to have to hail each mob to reset your vars, change your event to:

Code: Select all

#event dahail "You say, 'Hail, #1#'"
As your code is now, it will reset your numbers everytime anyone hails anything. At least change it to trigger only when you hail.

You might go on to modify your macro to work with more than 1 mob later (why the variables for the mob names).

I would try to tighten up the events a little bit to triger only when you cast the spell (not some other necro nearby) or at least get as specific as you can on the event text.

In the dotick event, you dont need to convert the name of the dot to a sting cause is IS already a string. Also, since you set the names above, there is really no need to hardcode the names of the spells below. Try this:

Code: Select all

Sub Event_dotick(string Line,int dmg,string dotname) 
   /if (${dotname.Equal["${Splurt_name}"]}) { 
      /varcalc Splurt_dmg ${Splurt_dmg}+${dmg} 
      /varcalc Mob_dmg ${Mob_dmg}+${dmg} 
      /varcalc Splurt_time ${Splurt_time}-1 
      /if (${dmg}>300) /varcalc Splurt_crit ${Splurt_crit}+1
   } else /if (${dotname.Equal["${NB_name}"]}) { 
      /varcalc NB_dmg ${NB_dmg}+${dmg} 
      /varcalc Mob_dmg ${Mob_dmg}+${dmg} 
      /varcalc NB_time ${NB_time}-1 
      /if (${dmg}>400) /varcalc NB_crit ${NB_crit}+1
   } else /if ...
Finally I would think about putting all your spell information into an array. Im not sure about is if you can mix types in an array (strings and ints) so you might actually want to make a second array for the names. It would also make it easier to add spells, like Horror for example.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Sat Jul 03, 2004 2:39 pm

I dont have a high level necro to test it on, so this code is untested but I put together a macro with the changes I suggested above. See if you like:

Code: Select all

|dots.mac
|usage: /mac dots

#event Snarecast "#1# is engulfed in an embracing darkness." 
#event Pyrocast "#1#'s blood ignites." 
#event DPcast "#1#'s skin is covered in black spots." 
#event FPcast "#1# is enveloped in a funeral pyre." 
#event NFcast "#1#'s blood boils through #*#" 
#event BoTcast "#1#'s veins turn a vile shade of green." 
#event Splurtcast "#1#'s body begins to splurt." 
#event NBcast "You feel your body being renewed."
#event Hcast "#1# screams in abject terror."

#event dotick "#*#taken #1# damage from your #2#."
#event Slain "#1# has been slain by #*#" 
#event Slain "You have slain #1#!"

Sub Main 
   /declare Mob_dmg int outer 0
   /declare dot[9,4] int outer 0
   /declare dot_name[9] string outer
   
   |thresholds for 'critical' dots
   /varset dot[1,4] 100
   /varset dot[2,4] 300
   /varset dot[3,4] 400
   /varset dot[4,4] 200
   /varset dot[5,4] 500
   /varset dot[6,4] 600
   /varset dot[7,4] 600
   /varset dot[8,4] 200
   /varset dot[9,4] 650

   :daloop 
      /doevents Snarecast 
      /doevents Pyrocast 
      /doevents DPcast 
      /doevents FPcast 
      /doevents NFcast 
      /doevents BoTcast 
      /doevents Splurtcast 
      /doevents NBcast
      /doevents Hcast
      /doevents Slain
      /doevents dotick 
      /doevents 

      /delay 1 
      /goto :daloop 

/endmacro

Sub Event_dotick(string Line,int dmg,string dotname)
   /declare c int local
   /for c 1 to 9
      /if (${dotname.Equal["${dot_name[${c}]}"]}) { 
         /varcalc dot[${c},1] ${dot[${c},1]}-1 
         /varcalc dot[${c},2] ${dot[${c},2]}+${dmg}
         /varcalc Mob_dmg ${Mob_dmg}+${dmg} 
         /if (${dmg}>${dot[${c},4]}) /varcalc dot[${c},3] ${dot[${c},3]}+1
      }
   /next c
/return

Sub Event_Slain
   /declare c int local 9
   /declare i int local 3

   /for c 1 to 9
      /for i 1 to 3
         /varset dot[${c},${i}] 0
      /next i
      /varset dot_name[${c}] 
   /next c

/return

Sub Event_Snarecast 
   /varset dot_name[1] Embracing Darkness
   /varset dot[1,1] 21 
   /varset dot[1,2] 0 
   /varset dot[1,3] 0 
/return 

Sub Event_Splurtcast 
   /varset dot_name[2] Splurt 
   /varset dot[2,1] 17 
   /varset dot[2,2] 0 
   /varset dot[2,3] 0 
/return 

Sub Event_NBcast 
   /varset dot_name[3] Night's Beckon 
   /varset dot[3,1] 11 
   /varset dot[3,2] 0 
   /varset dot[3,3] 0 
/return 

Sub Event_Pyrocast 
   /varset dot_name[4] Pyrocruor 
   /varset dot[4,1] 19 
   /varset dot[4,2] 0 
   /varset dot[4,3] 0 
/return 

Sub Event_FPcast 
   /varset dot_name[5] Funeral Pyre of Kelador 
   /varset dot[5,1] 10 
   /varset dot[5,2] 0 
   /varset dot[5,3] 0 
/return 

Sub Event_NFcast 
   /varset dot_name[6] Night Fire 
   /varset dot[6,1] 10 
   /varset dot[6,2] 0 
   /varset dot[6,3] 0 
/return 

Sub Event_BoTcast 
   /varset dot_name[7] Blood of Thule 
   /varset dot[7,1] 8 
   /varset dot[7,2] 0 
   /varset dot[7,3] 0 
/return 

Sub Event_DPcast 
   /varset dot_name[8] Dark Plague
   /varset dot[8,1] 21 
   /varset dot[8,2] 0 
   /varset dot[8,3] 0 
/return

Sub Event_DPcast 
   /varset dot_name[9] Horror
   /varset dot[9,1] 5 
   /varset dot[8,2] 0 
   /varset dot[8,3] 0 
/return
If you decide to use, you will need to modify your HUD to use the new array variable names of course, but that shouldnt be too hard.