Bug in /alert ?

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Bug in /alert ?

Post by dewey2461 » Tue Nov 10, 2015 7:20 pm

I have some old code that I'm revisiting after year+ that used the alert feature and it seems the error checking is causing me some issues that I think would produce valid statements.

I'm basically trying to find the number of mobs/pc's in an area and exclude things I don't want to pull.

Here is an example section of code that should let me do ${SpawnCount[alert 11]} and find the number of things I can kill.

Code: Select all

Sub Main
	/echo TESTING ALERT CODE 
	/alert clear 1
	/alert clear 11
	
	/echo
	/echo -- Alert 11 = path I want to search along
	/alert add 11 npc radius 250 noalert 1 loc 13 -631
	/alert add 11 npc radius 250 noalert 1 loc -25 -751
	/alert add 11 npc radius 250 noalert 1 loc -155 -780
	/alert add 11 npc radius 250 noalert 1 loc -283 -787
	/echo -- All four points loaded ! 
	/alert clear 1
	/alert add 1 npc rabbit
	/alert add 1 npc pest
	/alert add 1 npc parasite
	/echo -- everything looks good so far.
	/echo ---------------------------------------------------------
	/echo -- update the path with same points AFTER alert 1 set ....
	/alert clear 11
	/alert add 11 npc radius 250 noalert 1 loc 13 -631
	/alert add 11 npc radius 250 noalert 1 loc -25 -751
	/alert add 11 npc radius 250 noalert 1 loc -155 -780
	/alert add 11 npc radius 250 noalert 1 loc -283 -787
	/echo -- same alerts now fail.
/return

After testing this I think I can do the same thing with by dropping the no alert and put that in the search spawn.

JudgeD
a snow griffon
a snow griffon
Posts: 354
Joined: Sat Aug 18, 2012 8:07 pm

Re: Bug in /alert ?

Post by JudgeD » Tue Nov 10, 2015 7:59 pm

Can you explain what the bug is a little more? I'm not following what's broken

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Re: Bug in /alert ?

Post by dewey2461 » Tue Nov 10, 2015 8:16 pm

The error checking is tripping up on the order in which the alerts are added.

Code: Select all

Sub Main
	/echo TESTING ALERT CODE 
	/alert clear 1
	/alert clear 2

	
	/echo -- WORKS
	/alert add 1 npc radius 250 noalert 2 loc 13 -631
	/alert add 1 npc radius 250 noalert 2 loc 13 -631
	/alert add 2 npc rabbit

	/echo == NO ERRORS !! GOOD == 
	
	/echo == Now try in reverse order 

	/alert clear 1
	/alert clear 2
	/alert add 2 npc rabbit
	/alert add 1 npc radius 250 noalert 2 loc 13 -631
	/alert add 1 npc radius 250 noalert 2 loc 13 -631
	/echo == reverse order fails 
/return