Group Shrink

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

sl968
Site Admin
Site Admin
Posts: 11
Joined: Mon Oct 09, 2017 12:41 am

Group Shrink

Post by sl968 » Mon Feb 05, 2018 3:06 pm

Usage: /Macro ShrinkEm

3 edits are required. The ShrinkItem variable, which must be targetable; and the Shrink Delay which is the cast delay plus a little buffer in tenth's of a second 25 = 2.5 seconds, and if the macro should shrink pets or not.

Code: Select all

| ShrinkEm Ver 0.3
| Shrinks all members of your group

Sub Main
    | Specify your shrink item's name here, must be able to be Targetable
    /declare ShrinkItem         string    outer        "Bracelet of the Shadow Hive"

    | Cast Delay in 10th's a second, it's also smart to give a little buffer. IE 15 = 1.5 seconds.
    /declare ShrinkDelay        int        outer       15

    | Shrink Pets? 1 = Yes 0 = No    
    /declare ShrinkPets            int        outer        1     

    | No Edits are needed past this point.

    /declare Ver                    string    outer          0.3
    /declare IAmABard                bool    outer        ${Me.Class.Name.Equal[Bard]}


    /call DoShrink
/return

sub DoShrink
    /declare Person            int            local   0
    /if (${IAmABard}) { 
        /twist off 
        /stopsong
        /delay 5
    }
    /for Person 0 to 5
        /if (${Group.Member[${Person}].ID}) {
            /echo Shrinking ${Group.Member[${Person}].Name}
            /target ID ${Group.Member[${Person}].ID}
            /delay 5
            /itemnotify ${ShrinkItem} rightmouseup
            /delay ${ShrinkDelay}
            /itemnotify ${ShrinkItem} rightmouseup
            /delay ${ShrinkDelay}
            /if (${Group.Member[${Person}].Pet.ID} && ${ShrinkPets} >0) {
                /echo Shrinking ${Group.Member[${Person}].Name}'s Pet ${Group.Member[${Person}].Pet.CleanName}
                /target ID ${Group.Member[${Person}].Pet.ID}
                /delay 5
                /itemnotify ${ShrinkItem} rightmouseup
                /delay ${ShrinkDelay}
                /itemnotify ${ShrinkItem} rightmouseup
                /delay ${ShrinkDelay}
            }
        }
    /next Person
/return
Attachments
shrinkem.mac
(1.41 KiB) Downloaded 70 times

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

Re: Group Shrink

Post by dewey2461 » Mon Feb 05, 2018 6:11 pm

sl968 wrote:
Mon Feb 05, 2018 3:06 pm

Code: Select all

            /target ID ${Group.Member[${Person}].ID}
            /delay 5
            /itemnotify ${ShrinkItem} rightmouseup
            /delay ${ShrinkDelay}
            /itemnotify ${ShrinkItem} rightmouseup
            /delay ${ShrinkDelay}
You can speed these by passing in a boolean expression to /delay.

For example

Code: Select all

/varset ID ${Group.Member[${Person}].ID}
/if ( ${Target.ID} != ${ID} ) {
   /target ID ${ID}
   /delay 5 ${Target.ID}==${ID}
}
NOTE: Have to check if the condition exits I get them backwards half the time.

The same can be done for ${ShrinkDelay} to reduce the number of hard coded pauses by checking the state of the casting window.

exspes007
a hill giant
a hill giant
Posts: 193
Joined: Mon Oct 22, 2012 1:16 am

Re: Group Shrink

Post by exspes007 » Tue Feb 06, 2018 10:07 am

Code: Select all

sub DoShrink
    /declare Person            int            local   0
    /if (${Me.Class.Name.Equal[Bard]} && ${Bool[${Plugin[MQ2Twist]}]} { 
        /twist off 
        /stopsong
        /delay 5
    }
    /for Person 0 to 5
        /if (${Group.Member[${Person}].ID}) {
            /echo Shrinking ${Group.Member[${Person}].DisplayName}
            
            /target ID ${Group.Member[${Person}].ID}
            /delay 5 ${Target.ID} == ${Group.Member[${Person}].ID}
            
            /useitem ${ShrinkItem} 
            /delay 5s !${Me.Casting.ID}
            
            /if (${Group.Member[${Person}].Pet.ID} && ${ShrinkPets} > 0) {
                /echo Shrinking ${Group.Member[${Person}].DisplayName}'s Pet ${Group.Member[${Person}].Pet.DisplayName}
                /target ID ${Group.Member[${Person}].Pet.ID}
                /delay 5
                /useitem ${ShrinkItem} 
                /delay 5s !${Me.Casting.ID}
            }
        }
    /next Person
/return
like dewey suggested, take it bit farther and loop the useitems while the target is > a specific height and add in some conditional delays.

Code: Select all

/while (${Target.Height} > #.##) {
 looped code
}
best to make sure you have the plugin loaded before using a plugin specific command as well.

Code: Select all

${Plugin[MQ2Twist]}
you could also continue it with some class vlaidations for using speciffic AAs, bst or shm group shrinks, mage pet shrinks.

just a couple thoughts
-exspes007

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

Re: Group Shrink

Post by dewey2461 » Tue Feb 06, 2018 4:48 pm

And before you know it we've taken a nice short script and turned it into a 200 line macro. There to be said about KISS :oops:

caj
a hill giant
a hill giant
Posts: 244
Joined: Tue Sep 12, 2006 9:35 am

Re: Group Shrink

Post by caj » Thu Feb 08, 2018 6:57 pm

dewey2461 wrote:
Tue Feb 06, 2018 4:48 pm
And before you know it we've taken a nice short script and turned it into a 200 line macro. There to be said about KISS :oops:
but isnt that what Everquest does? Its amazing how many different scenarios and/or problems pop up trying to do a simple task.

EcraneQ
decaying skeleton
decaying skeleton
Posts: 1
Joined: Wed Feb 15, 2017 7:25 pm

Re: Group Shrink

Post by EcraneQ » Wed Jun 20, 2018 3:27 pm

Is this still working well for you sl968? Thanks!