Macro Spawn alert using mmotext

Tapout

Before You Blackout
Joined
Oct 22, 2006
Messages
385
Reaction score
14
Points
18
I've been trying to get this mac to work so that I can get a text when a mob spawns but I'm not having any luck. I know my plugins work. I can test those but I'm not sure what I'm doing wrong with this mac. Any help would be appreciated.

Code:
|Watching.mac by HardOne 12/20/2010
|This macro will watch for a specific mob to spawn
|When your mob spawns, it will send a text using MQ2MMOText Plugin

#turbo 80

#event ImDead          "#*#You have been slain by#*#"
#event ImDead          "Returning to home point, please wait..."
#event ImDead          "#*#Returning to Bind Location#*#"

Sub Main
	/if (!${Plugin[MQ2MMOText].Name.Equal[mq2mmotext]}) /plugin MQ2MMOText load
	/if (!${Plugin[MQ2PCCheck].Name.Equal[mq2pccheck]}) /plugin MQ2PCCheck load
	/if (!${Plugin[MQ2CEcho].Name.Equal[mq2cecho]}) /plugin MQ2CEcho load
	/target clear
	
| ** Edit this section with the mob your looking for. Place mob name in quotes for multi-names

	/declare MobName1		string	outer	"Mob One"
	/declare MobName2		string	outer	MobTwo
	/declare MobName3		string	outer	MobThree
	/declare MobName4		string	outer	"Mob Four"
	
| ** No more edits needed past this point
	
	/declare PageTimer1		timer	outer	0
	/declare PageTimer2		timer	outer	0
	/declare PageTimer3		timer	outer	0
	/declare PageTimer4		timer	outer	0	
 
 
	/cecho Watching for ${MobName1}, ${MobName2}, ${MobName3}, and ${MobName4} in \ao${Zone}!

	:mainloop
		/doevents
		/if (!${PageTimer1}) /call CheckSpawn1
		/if (!${PageTimer2}) /call CheckSpawn2
		/if (!${PageTimer3}) /call CheckSpawn3
		/if (!${PageTimer4}) /call CheckSpawn4
	/goto :mainloop
/return

Sub CheckSpawn1
	/if (${SpawnCount[npc named ${MobName1}]}) {
		/echo ${MobName1} has Spawned @ ${Time}!
		/bc ${MobName1} has Spawned @ ${Time}!
		/mmotext send ${MobName1} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer1 5m
		}
/return

Sub CheckSpawn2
	/if (${SpawnCount[npc named ${MobName2}]}) {
		/echo ${MobName2} has Spawned @ ${Time}!
		/bc ${MobName2} has Spawned @ ${Time}!
		/mmotext send ${MobName2} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer2 5m
		}
/return
	
Sub CheckSpawn3
	/if (${SpawnCount[npc named ${MobName3}]}) {
		/echo ${MobName3} has Spawned @ ${Time}!
		/bc ${MobName3} has Spawned @ ${Time}!
		/mmotext send ${MobName3} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer3 5m
		}
/return
	
Sub CheckSpawn4
	/if (${SpawnCount[npc named ${MobName4}]}) {
		/echo ${MobName4} has Spawned @ ${Time}!
		/bc ${MobName4} has Spawned @ ${Time}!
		/mmotext send ${MobName4} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer4 5m
		}
/return

Sub Event_ImDead
	/doevents
	/echo I've been Killed! Alerting People...
	/bc Somehow I Died! Ending Macro.
	/call PeopleNear
	/mmotext send I was killed, no longer watching!
	/beep
	/beep
	/beep
	/endmac
/return
 
Really need more information on what is not working.

This at top of macro needs editing for mob you are after

Code:
	/declare MobName1		string	outer	"Mob One"
	/declare MobName2		string	outer	MobTwo
	/declare MobName3		string	outer	MobThree
	/declare MobName4		string	outer	"Mob Four"

Does any of the code fire off when mob spawns? or just nothing at all?
 
I change the Mob one two and three to different mob names and then run the mac but nothing will fire off if the mob spawns. I've just been testing it out by killing a static mob that I know will spawn and then wait to see if it does anything. I've named it 3 different ways just to see if I was naming it wrong. Nothing at all happens.
 
Try this.

Code:
|Watching.mac by HardOne 12/20/2010
|This macro will watch for a specific mob to spawn
|When your mob spawns, it will send a text using MQ2MMOText Plugin

#turbo 80

#event ImDead          "#*#You have been slain by#*#"
#event ImDead          "Returning to home point, please wait..."
#event ImDead          "#*#Returning to Bind Location#*#"

Sub Main
	/if (!${Plugin[MQ2MMOText].Name.Equal[mq2mmotext]}) /plugin MQ2MMOText load
	/if (!${Plugin[MQ2PCCheck].Name.Equal[mq2pccheck]}) /plugin MQ2PCCheck load
	/if (!${Plugin[MQ2CEcho].Name.Equal[mq2cecho]}) /plugin MQ2CEcho load
	/target clear
	
| ** Edit this section with the mob your looking for. Place mob name in quotes for multi-names

	/declare MobName1		string	outer	"Mob One"
	/declare MobName2		string	outer	MobTwo
	/declare MobName3		string	outer	MobThree
	/declare MobName4		string	outer	"Mob Four"
	
| ** No more edits needed past this point
	
	/declare PageTimer1		timer	outer	0
	/declare PageTimer2		timer	outer	0
	/declare PageTimer3		timer	outer	0
	/declare PageTimer4		timer	outer	0	
 
 
	/cecho Watching for ${MobName1}, ${MobName2}, ${MobName3}, and ${MobName4} in \ao${Zone}!

	:mainloop
		/doevents
		/if (!${PageTimer1}) /call CheckSpawn1
		/if (!${PageTimer2}) /call CheckSpawn2
		/if (!${PageTimer3}) /call CheckSpawn3
		/if (!${PageTimer4}) /call CheckSpawn4
	/goto :mainloop
/return

Sub CheckSpawn1
	/if (${SpawnCount[npc ${MobName1}]}) {
		/echo ${MobName1} has Spawned @ ${Time}!
		/bc ${MobName1} has Spawned @ ${Time}!
		/mmotext send ${MobName1} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer1 5m
		}
/return

Sub CheckSpawn2
	/if (${SpawnCount[npc ${MobName2}]}) {
		/echo ${MobName2} has Spawned @ ${Time}!
		/bc ${MobName2} has Spawned @ ${Time}!
		/mmotext send ${MobName2} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer2 5m
		}
/return
	
Sub CheckSpawn3
	/if (${SpawnCount[npc ${MobName3}]}) {
		/echo ${MobName3} has Spawned @ ${Time}!
		/bc ${MobName3} has Spawned @ ${Time}!
		/mmotext send ${MobName3} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer3 5m
		}
/return
	
Sub CheckSpawn4
	/if (${SpawnCount[npc ${MobName4}]}) {
		/echo ${MobName4} has Spawned @ ${Time}!
		/bc ${MobName4} has Spawned @ ${Time}!
		/mmotext send ${MobName4} has Spawned!
			/beep
			/beep
			/beep
		/varset PageTimer4 5m
		}
/return

Sub Event_ImDead
	/doevents
	/echo I've been Killed! Alerting People...
	/bc Somehow I Died! Ending Macro.
	/call PeopleNear
	/mmotext send I was killed, no longer watching!
	/beep
	/beep
	/beep
	/endmac
/return
 
Thank you fry. Just 1 little thing that I probably read 100 times but never realized.