spell_routines.inc ( updated: 11/07/2004 )

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

Hannibal
orc pawn
orc pawn
Posts: 19
Joined: Sat Jul 03, 2004 10:28 pm

Post by Hannibal » Wed Aug 25, 2004 9:48 pm

Rusty~

I recently upgraded to your latest spell_routines.inc.

Below, is my summon arrow subroutine:

Code: Select all

Sub event_SummonArrow(line,int arrows)
	
	/declare a int local

	/echo Summoning ${arrows} stack(s) of arrows.

	/for a 1 to ${arrows}
		/call cast "Tolan's Darkwood Bracer" item
		/autoinventory
	/next a

/return
This worked great, until the latest spell_routines.inc - I'm frequently finding that the autoinventory is not functioning.

Did something change that may affect this?

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Wed Aug 25, 2004 11:32 pm

it just returns control to your macro sooner now (which is a good thing!)... the problem is there's a small delay between when you finish casting a summoned item and when it appears on your cursor. this should fix your problem though:

Code: Select all

   /call cast "Tolan's Darkwood Bracer" item 
   /delay 1s ${Cursor.ID}
   /autoinventory 
[/code]

Hannibal
orc pawn
orc pawn
Posts: 19
Joined: Sat Jul 03, 2004 10:28 pm

Post by Hannibal » Thu Aug 26, 2004 7:20 am

That appears to fix the autoinventory issue, but I typically do not have my Tolan's equipped - so it swaps it in, casts, then swaps back.

What happens is that it will get 'stuck' and I'll have the Tolan's AND the arrows on my cursor. I have to /mqpause to correct it, and then unpause the macro again.

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Thu Aug 26, 2004 8:15 am

ah.. ok, i'll see what i can do to fix that.

frabtik
a ghoul
a ghoul
Posts: 114
Joined: Sat Feb 21, 2004 10:07 am

Post by frabtik » Mon Aug 30, 2004 5:54 am

Not sure if I want to change over to this or not, needs some work to do what I want but stealing some things here and there till I decide what is best for me.
Seems this doesn't work. Just gives syntax.
/windowstate spellbook close
Found a post from DKAA saying it uses windownames now and /windows will list them. Course my server is down so I can't do that command to find the name for ya.

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Tue Aug 31, 2004 12:16 am

yeah noticed windowstate thing was bugged and fixed it but forgot to post the updated version.

still havent gotten around to working on the small item swap bugs, but will try to as soon as possible

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Wed Sep 01, 2004 8:30 pm

ok.... casting items that summon other items should now work. i tested it with fisherman's companion as it's only item i had that did that.

Nueder
decaying skeleton
decaying skeleton
Posts: 7
Joined: Tue Aug 31, 2004 2:11 pm

Post by Nueder » Thu Sep 02, 2004 5:39 pm

Sorry noob question...How do i retrieve the return value from spell_routines.inc such as CAST_RESISTED.

I saw somewhere this syntax but it is not working for me:

/if ($return==CAST_RESISTED) {
/blah
/blah
}

Can you plz post how to do this i would RTFM if i knew where the FM was /grin.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Thu Sep 02, 2004 6:22 pm

Code: Select all

/if (${Macro.Return.Equal["CAST_RESISTED"]})

Nueder
decaying skeleton
decaying skeleton
Posts: 7
Joined: Tue Aug 31, 2004 2:11 pm

Post by Nueder » Thu Sep 02, 2004 6:57 pm

Code: Select all

			/call Cast "Ultor's Greaves of Faith" item
			/if (${Macro.Return.Equal["CAST_RESISTED"]}){
				/if (${announce}==1) {
					/g %T RESISTED ${morspell}
				} else {
					/chat #${mychannel} %T RESISTED ${morspell}
				}
			}
Whats wrong with this?

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Thu Sep 02, 2004 7:32 pm

Code: Select all

/if (${Macro.Return.Equal["CAST_RESISTED"]}){ 
need a space before you put a bracket

Hannibal
orc pawn
orc pawn
Posts: 19
Joined: Sat Jul 03, 2004 10:28 pm

Post by Hannibal » Thu Sep 02, 2004 7:43 pm

ok.... casting items that summon other items should now work. i tested it with fisherman's companion as it's only item i had that did that.
Works well, my tolan's macro is back to working as intended.

Hannibal
orc pawn
orc pawn
Posts: 19
Joined: Sat Jul 03, 2004 10:28 pm

Post by Hannibal » Mon Sep 06, 2004 3:04 am

Not sure about this one - but I think in the older release, it used to return the swapped item to the original bag slot.

It appears to auto-inventory it now.

Bad thing being, before - I could /arrows 100, and it would only drop arrows on the ground. Now, it will actually drop the Tolan's.

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue Sep 21, 2004 4:10 pm

is ${Macro.Return} working as intended? I had this in my ranger macro to detect resisted snares, some reason it wasnt returning anything. I've bandaged up my macros by putting local events in, but using macro.return was alot cleaner.
LOADING PLEASE WAIT...

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Wed Sep 22, 2004 10:32 am

${Macro.Return} works fine. not sure why you'd be having problems with it really.

and yes, there are some bugs in the itemswap code again i found, i'm going to work on rewriting it again =/

i had problems when people would cast mod rods or something while casting and i'd get stuck in a loop so i added the autoinventory stuff.. but that introduced new problems now heh