Summon water and food...

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

legion
orc pawn
orc pawn
Posts: 17
Joined: Tue Jan 06, 2004 10:30 am

Summon water and food...

Post by legion » Wed Jan 14, 2004 9:14 am

I am writing a macro that is trying to be completely independant for hunting. As such when I am out of water and food I want to summon about 5 drop them into the inv and continue.

Here is what I have so far:

Code: Select all

#event nowater "You are out of drink."

/declare nowater global

sub CheckW
	/declare stack local

	/if n @Debug==1 /echo Checking Water status...	

	/doevents nowater

	/if n @nowater==1 {
		/windowstate inventory open	
		/memspell 8 "Summon Drink"
		/for stack 1 to 5
			/call Castspell	"Summon Drink"
      /autoinventory
			/delay 30      
		/next stack
  	/windowstate inventory close
	}
	/varset nowater 0
/return
It works to a fashion, but everytime it's called to check it will summon the water or food. I have a duplicate of this for food.

dman
a hill giant
a hill giant
Posts: 181
Joined: Fri Dec 05, 2003 12:54 pm

Post by dman » Wed Jan 14, 2004 1:19 pm

Since I am not sure what your Sub Event_nowater does, but I assume it just sets @nowater==1 when the event triggers, I would consider doing something like this instead.

Code: Select all

sub CheckW  
   /if n @Debug==1 /echo Checking Water status...    

   /if n $count("Summoned: Globe of Water")<=1 { 
      /windowstate inventory open    
      /memspell 8 "Summon Drink" 
      :Waterloop 
         /call Castspell   "Summon Drink" 
         /autoinventory 
         /delay 30      
         /if n $count("Summoned: Globe of Water")<5 /goto :Waterloop
      /windowstate inventory close 
   } 
   /return