Calling scripts from macros

Posted by Shadowfyr on Mon 28 Jan 2002 05:13 AM — 6 posts, 15,326 views.

USA #0
I ran into an interesting problem resently. One spell which is occationally useful on the mud I play is called Rejuvenate. It has an insanely short duration and heals slightly less than is sometimes helpful. The problem is that it is often critical to cast it immediately after a previous cast. The solution to this is of course to trigger on the success line and have the trigger recast it. However, in the most resent case I needed to cast until the person I was working with finished one of their spells, then immediately switch to cacting the less expensive spell, since rejuvenate sucks up cp (spell points) very rapidly.

The problem is that it is very hard to interupt the cycle. The duration is literally so short the spell will be cast before the mud can even recieve the command to interrupt it, and then that command is ignored and a fraction of a second later when the trigger sends the command again. I have since altered my scripts so that the alias I created for interrupting spells also dumps the trigger, but it would be nice if I could link the deactivation script to a macro. That way I could simply cast a regular healing spell using the macro and it would call the script to shut down the trigger at the same time.

Currently I can't do this, since macros don't call scripts and all spells for my guild start with the exact same statement. There is nothing I can trigger on when casting a different spell that will allow me to call the deactivation script nor, if there was, is there any way to make sure that the new spell would be cast, rather than being interrupted by the rejuvenate trigger. Using the alias to interrupt it is not always convenient either, especially since I can cast a heal wounds in the time it would take to remove my finger from the macro key and type the alias. And as I said, when you need this spell, timing is extremely important. ;)
Australia Forum Administrator #1
Make the macro generate a nonsense word, eg. '345dfgxgasf'.

Then make an alias to match on that word, then the alias can call the script you want.

Or, to make the alias look a bit more sensible in the command history, instead of a nonsense word, just use something you don't normally type, eg. 'cancel_the_spell_now'.

It isn't sent to the MUD, so it doesn't matter how long-winded it is.
USA #2
Hmm.. Didn't know you could do that. Think I tried something similar with world.send and it didn't, so I assumed the behaviour would be the same for macros.

However, any chance of selectively disabling having macro commands added to the command history. This is another thing that can be occationally annoying since sometimes you have one command you use only once before entering a fight and you have to scroll through any macro commands used in the fight (if you run and have to resummon something for instance) to get to the only one not a macro. Not a big deal, but it would sometimes make things easier if you had the option of treating a macro command the same way as directions from the keypad. ;)
Australia Forum Administrator #3
I have added this as suggestion #447.
Canada #4
Grins.

I have nothing to contribute, I just want to brag:
(LOL)

If ya were using my spell queue and script, you would only need to change "HealOthertype" via an alias.

The way my scipt works, when a healing spell is complete, a trigger calls a "Check_Heal" script which will automatically recast the spell in "HealOthertype" if "Maxheal" is true.

You can turn off "maxheal" to prevent the heal-casting loop, or you can change "HealOtherType" on the fly, and when one type is complete the new type will be cast instead.

You still have the URL to my script file?

My script only takes into account Healer spells L30 and below... I add new script for spells\skills as I aquire them.

My script requires a massive number of triggers, especially for occasions where skills or spells fail in a unique way, and I need to call "Casting_False" so that the spell queue will resume functions.

I might consider posting elements of my script here, but I don't want to do that unless I post script to create the appropriate triggers as well, and there are too many to make that worthwhile for now. I made a suggestion regarding exporting triggers to a script/text file, and it's on the list of things for Nick to add...

Even if it wasn't to a script file... if I could export individual triggers\aliases, that would be handy. Or if the trigger\aliases file were fairly readable, I could manually edit the file to remove all I don't want. Point is, I want to give away SOME triggers\aliases, not all.
Australia Forum Administrator #5
[quote]
However, any chance of selectively disabling having macro commands added to the command history.
[/quote]

An option to do that is now in version 3.41.