Summoning Script (food/drink)

Moderator: MacroQuest Developers

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

Summoning Script (food/drink)

Post by aChallenged1 » Sun Jun 25, 2006 10:23 pm

Please see third post for the next version; it takes inputs for number of each item to summon.

Echoism's Spell Routines include file v. 2.5.0. This is the include file you need for this to work. It is in the VIP section so you can either donate for the access, or find a way to make one of the others work.

I'd like to thank Lax and fearless for their tactful directions that helped me find the information I needed to get certain portions of this to work. E.g. loops and item counts, and the like. I would also like to thank Bardomatic for his help and suggestions, without which I'd be bald from pulling out my hair. Finally, I'd like to thank OneTimeHero for his very simple CastPractice.iss from which a good portion of my code was originally ripped from.

This can be modified to cast anything, but is set up for 3 items; food, drink, and daggers(for pets).
This version does not take input for number of items to summon, but the next one (third post) does.

I hope this proves useful to anyone looking for a script like this.
I further hope that it helps others trying to learn to write scripts, just as castpractice helped me.

This has some echos in it, their purpose is to give the user a updated count in the isxeqchatwnd. If you are not using isxeqchatwnd, you won't see them.

Code: Select all

#include spell_routines.inc

function main()
{
	[color=red]EQExecute /memspellset Summon[/color]
	[color=cyan];I have a spell set with the items I tend to summon in it, you can comment these lines out that are in red[/color]
	[color=red]wait 3000 ${Me.SpellReady[Dimensional Pocket]}[/color]
	call CastFood
	call CastDrink
	call CastWeaps
	if !${Me.Sitting}
	EQExecute /sit
	echo END!!!!
}

function CastFood()
{
	do
	{
		wait ${Math.Rand[15]:Inc[5]}

		;echo ${Me.SpellReady[Summon Food]} && ${Me.PctMana}>5 [color=cyan];commented out because it really is only for troubleshooting[/color]
		if ${Me.SpellReady[Summon Food]} && ${Me.PctMana}>5
		{
			;echo summoning food [color=cyan];commented out because it really is only for troubleshooting[/color]
			call Cast "Summon Food"
			if ${Cursor(exists)}
			{
				EQExecute /autoinventory
				wait 20 !${Cursor.ID}
				wait 20 ${Me.SpellReady[Summon Food]}
				echo ${FindItemCount[=Summoned: Black Bread]} Black Bread loaves summoned so far.
			}
		}
		else
		{
			[color=cyan];Med to full[/color]
			if !${Me.Sitting}
			EQExecute /sit
			wait 9999 ${Me.PctMana}==100
		}
	}
	while (${FindItemCount[=Summoned: Black Bread]}<100) [color=cyan];watches the count so that it knows when to stop summoning this item[/color]
}

function CastDrink()
{
	do
	{
		wait ${Math.Rand[15]:Inc[5]}

		;echo ${Me.SpellReady[Summon Drink]} && ${Me.PctMana}>5 [color=cyan];commented out because it really is only for troubleshooting[/color]
		if ${Me.SpellReady[Summon Drink]} && ${Me.PctMana}>5
		{
			;echo summoning drink [color=cyan];commented out because it really is only for troubleshooting[/color]
			call Cast "Summon Drink"
			if ${Cursor(exists)}
			{
				EQExecute /autoinventory
				wait 20 !${Cursor.ID}
				wait 20 ${Me.SpellReady[Summon Drink]}
				echo ${FindItemCount[=Summoned: Globe of Water]} Globe's of Water summoned so far.
			}
		}
		else
		{
			[color=cyan];Med to full[/color]
			if !${Me.Sitting}
			EQExecute /sit
			wait 9999 ${Me.PctMana}==100
		}
	}
	while (${FindItemCount[=Summoned: Globe of Water]}<40) [color=cyan];watches the count so that it knows when to stop summoning this item[/color]
}

function CastWeaps()
{
	do
	{
		wait ${Math.Rand[15]:Inc[5]}

		;echo ${Me.SpellReady[Summon Dagger]} && ${Me.PctMana}>5 [color=cyan];commented out because it really is only for troubleshooting[/color]
		if ${Me.SpellReady[Summon Dagger]} && ${Me.PctMana}>5
		{
			;echo summoning drink [color=cyan];commented out because it really is only for troubleshooting[/color]
			call Cast "Summon Dagger"
			if ${Cursor(exists)}
			{
				EQExecute /autoinventory
				wait 20 !${Cursor.ID}
				wait 20 ${Me.SpellReady[Summon Dagger]}
				echo ${FindItemCount[=Summoned: Dagger]} Daggers summoned so far.
			}
		}
		else
		{
			[color=cyan];Med to full[/color]
			if !${Me.Sitting}
			EQExecute /sit
			wait 9999 ${Me.PctMana}==100
		}
	}
	while (${FindItemCount[=Summoned: Dagger]}<2) [color=cyan];watches the count so that it knows when to stop summoning this item[/color]
}
Last edited by aChallenged1 on Mon Jun 26, 2006 8:44 pm, edited 4 times in total.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

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

Post by aChallenged1 » Mon Jun 26, 2006 9:16 am

:Blank:
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

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

Post by aChallenged1 » Mon Jun 26, 2006 8:53 pm

This version is nearly the same as the first, but requries user inputs.

To use: /runscript chowcall x y z
Where x = number of food to summon
Where y = number of drink to summon
Where z = number of daggers to summon

Code: Select all

; ChowCall.iss
; Version 1.0.2
; created by aChallenged1
; code ripped from castpractice.iss by onetimehero
; help provided by Lax, Hendrix, Bardomatic, Echoism, fearless, and others.

#include spell_routines.inc

function main(int Food, int Drink)
{
	[color=red]EQExecute /memspellset Summon[/color]
	[color=cyan];I have a spell set with the items I tend to summon in it, you can comment these lines out that are in red[/color]
	[color=red]wait 3000 ${Me.SpellReady[Dimensional Pocket]}[/color]
	call CastFood ${Food}
	call CastDrink ${Drink}
	call CastWeaps ${Weapon}
	if !${Me.Sitting}
	EQExecute /sit
	echo END!!!!
}

function CastFood(int Food)
{
	do
	{
		wait ${Math.Rand[15]:Inc[5]}

		;echo ${Me.SpellReady[Summon Food]} && ${Me.PctMana}>5
		[color=cyan];commented out because it really is only for troubleshooting[/color]
		if ${Me.SpellReady[Summon Food]} && ${Me.PctMana}>5
		{
			;echo summoning food
			[color=cyan];commented out because it really is only for troubleshooting[/color]
			call Cast "Summon Food"
			if ${Cursor(exists)}
			{
				EQExecute /autoinventory
				wait 20 !${Cursor.ID}
				wait 20 ${Me.SpellReady[Summon Food]}
				echo ${FindItemCount[=Summoned: Black Bread]} Black Bread loaves summoned so far.
			}
		}
		else
		{
			[color=cyan];Med to full[/color]
			if !${Me.Sitting}
			EQExecute /sit
			wait 9999 ${Me.PctMana}==100
		}
	}
	while (${FindItemCount[=Summoned: Black Bread]}<${Food})
	[color=cyan];watches the count so that it knows when to stop summoning this item[/color]
}

function CastDrink(int Drink)
{
	do
	{
		wait ${Math.Rand[15]:Inc[5]}

		;echo ${Me.SpellReady[Summon Drink]} && {Me.PctMana}>5
		[color=cyan];commented out because it really is only for troubleshooting[/color]
		if ${Me.SpellReady[Summon Drink]} && ${Me.PctMana}>5
		{
			;echo summoning drink [color=cyan]
			;commented out because it really is only for troubleshooting[/color]
			call Cast "Summon Drink"
			if ${Cursor(exists)}
			{
				EQExecute /autoinventory
				wait 20 !${Cursor.ID}
				wait 20 ${Me.SpellReady[Summon Drink]}
				echo ${FindItemCount[=Summoned: Globe of Water]} Globe's of Water summoned so far.
			}
		}
		else
		{
			[color=cyan];Med to full[/color]
			if !${Me.Sitting}
			EQExecute /sit
			wait 9999 ${Me.PctMana}==100
		}
	}
	while (${FindItemCount[=Summoned: Globe of Water]}<${Drink})
	[color=cyan];watches the count so that it knows when to stop summoning this item[/color]
}

function CastWeaps(int Weapon)
{
	do
	{
		wait ${Math.Rand[15]:Inc[5]}

		;echo ${Me.SpellReady[Summon Dagger]} && ${Me.PctMana}>5
		[color=cyan];commented out because it really is only for troubleshooting[/color]
		if ${Me.SpellReady[Summon Dagger]} && ${Me.PctMana}>5
		{
			;echo summoning drink
			[color=cyan];commented out because it really is only for troubleshooting[/color]
			call Cast "Summon Dagger"
			if ${Cursor(exists)}
			{
				EQExecute /autoinventory
				wait 20 !${Cursor.ID}
				wait 20 ${Me.SpellReady[Summon Dagger]}
				echo ${FindItemCount[=Summoned: Dagger]} Daggers summoned so far.
			}
		}
		else
		{
			[color=cyan];Med to full[/color]
			if !${Me.Sitting}
			EQExecute /sit
			wait 9999 ${Me.PctMana}==100
		}
	}
	while (${FindItemCount[=Summoned: Dagger]}<${Weapon})
	[color=cyan];watches the count so that it knows when to stop summoning this item[/color]
}
Corrected the parameter's portion, which I somehow left out from the working version. Fixed the comments in blue so they were on their own lines, not that it mattered because they were behind lines already commented out.
Last edited by aChallenged1 on Sun Jul 16, 2006 9:32 pm, edited 2 times in total.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

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

Post by aChallenged1 » Mon Jun 26, 2006 8:54 pm

:blank:
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

hendrix04
a lesser mummy
a lesser mummy
Posts: 38
Joined: Tue Jul 13, 2004 5:02 pm

Post by hendrix04 » Sun Jul 16, 2006 5:25 pm

I edited this so that it will actually work... There were comments at the end of a line (you can only use a ; comment at the start of a line. an end of the line comment must look like /** Comment **/) and the main function wasnt setup to accept paramaters... Now it is. Other than those 2 things it seems to be working well. Oh I also edited the script to summon a hammer weapon instead of daggers (because i am a cleric ;) ).

Code: Select all

; ChowCall.iss
; Version 1.0.2
; created by aChallenged1
; code ripped from castpractice.iss by onetimehero
; help provided by Lax, Hendrix, Bardomatic, Echoism, fearless, and others.

#include spell_routines.iss

function main(int Food, int Drink, int Weapon)
{
   EQExecute /memspellset Summon
   ;I have a spell set with the items I tend to summon in it, you can comment these lines out that are in red
   wait 3000 ${Me.SpellReady[Hammer of Wrath]}
   call CastFood ${Food}
   call CastDrink ${Drink}
   call CastWeaps ${Weapon}
   if !${Me.Sitting}
   EQExecute /sit
   echo END!!!!
}

function CastFood(int Food)
{
   do
   {
      wait ${Math.Rand[15]:Inc[5]}

      ;echo ${Me.SpellReady[Summon Food]} && ${Me.PctMana}>5 commented out because it really is only for troubleshooting
      if ${Me.SpellReady[Summon Food]} && ${Me.PctMana}>5
      {
         ;echo summoning food commented out because it really is only for troubleshooting
         call Cast "Summon Food"
         if ${Cursor(exists)}
         {
            EQExecute /autoinventory
            wait 20 !${Cursor.ID}
            wait 20 ${Me.SpellReady[Summon Food]}
            echo ${FindItemCount[=Summoned: Black Bread]} Black Bread loaves summoned so far.
         }
      }
      else
      {
         ;Med to full
         if !${Me.Sitting}
         EQExecute /sit
         wait 9999 ${Me.PctMana}==100
      }
   }
   while (${FindItemCount[=Summoned: Black Bread]}<${Food}) 
   ;watches the count so that it knows when to stop summoning this item
}

function CastDrink(int Drink)
{
   do
   {
      wait ${Math.Rand[15]:Inc[5]}

      ;echo ${Me.SpellReady[Summon Drink]} && ${Me.PctMana}>5 commented out because it really is only for troubleshooting
      if ${Me.SpellReady[Summon Drink]} && ${Me.PctMana}>5
      {
         ;echo summoning drink commented out because it really is only for troubleshooting
         call Cast "Summon Drink"
         if ${Cursor(exists)}
         {
            EQExecute /autoinventory
            wait 20 !${Cursor.ID}
            wait 20 ${Me.SpellReady[Summon Drink]}
            echo ${FindItemCount[=Summoned: Globe of Water]} Globe's of Water summoned so far.
         }
      }
      else
      {
         ;Med to full
         if !${Me.Sitting}
         EQExecute /sit
         wait 9999 ${Me.PctMana}==100
      }
   }
   while (${FindItemCount[=Summoned: Globe of Water]}<${Drink}) 
   ;watches the count so that it knows when to stop summoning this item
}

function CastWeaps(int Weapon)
{
   do
   {
      wait ${Math.Rand[15]:Inc[5]}

      ;echo ${Me.SpellReady[Summon Dagger]} && ${Me.PctMana}>5 ;commented out because it really is only for troubleshooting
      if ${Me.SpellReady[Hammer of Wrath]} && ${Me.PctMana}>5
      {
         ;echo summoning drink ;commented out because it really is only for troubleshooting
         call Cast "Hammer of Wrath"
         if ${Cursor(exists)}
         {
            EQExecute /autoinventory
            wait 20 !${Cursor.ID}
            wait 20 ${Me.SpellReady[Hammer of Wrath]}
            echo ${FindItemCount[=Summoned: Hammer of Wrath]} Hammers summoned so far.
         }
      }
      else
      {
         ;Med to full
         if !${Me.Sitting}
         EQExecute /sit
         wait 9999 ${Me.PctMana}==100
      }
   }
   while (${FindItemCount[=Summoned: Hammer of Wrath]}<${Weapon}) 
   ;watches the count so that it knows when to stop summoning this item
}

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

Post by aChallenged1 » Sun Jul 16, 2006 9:23 pm

Funny you say that about the ";" not working in the middle of a line. That was a mistake Each of those cyan comments should be on their own line below the line they comment. Lines that were all commented out anyways.

And yeah, I figured others would be modifying it for a weapon of choice for their character needs/class.

I don't use this one for summoning weapons any longer, so that whole section is commented out in mine now. I've gone with my SummonIt script to summon multiples of items since this one, because I can use it to summon anything with spell name and number to summon. Well, anything that is in the xml file, which I'm going to have to rework with the latest changes dealing with XML, I suppose.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:03 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:04 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:05 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:06 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:07 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:08 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:09 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:11 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Summoning Script (food/drink)

Post by xyilla » Wed Jul 16, 2025 4:12 am