pulling a declared string at the start of a macro

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

MyEmQueTwo
orc pawn
orc pawn
Posts: 14
Joined: Mon Jul 13, 2015 7:15 pm

pulling a declared string at the start of a macro

Post by MyEmQueTwo » Fri Jul 17, 2015 1:44 pm

I am trying to figure out how to pull a name when starting a macro and then have it target that name

For example:

Code: Select all

HealTarget.mac

/macro HealTarget.mac nameoftarget
I then want the macro to be able to target the name ive defined like such:

Code: Select all

/tar nameoftarget
/cast heal
I know there are other ways/more efficent ways, etc, yes, but I am trying to learn myself and just need some example of how this is done. Any help would be appreciated.

Maskoi

Re: pulling a declared string at the start of a macro

Post by Maskoi » Fri Jul 17, 2015 2:15 pm

param - The macro will pick up the variably after the Macro Name. Each new param is determined by a space. if the info that needs to be passed has spaces then it needs quotes. "Info with spaces"

/mac mcaroname param0 param1 param2

Code: Select all

/if (${Defined[Param0]}) {
        /varset nameoftarget ${Param0}
    }

MyEmQueTwo
orc pawn
orc pawn
Posts: 14
Joined: Mon Jul 13, 2015 7:15 pm

Re: pulling a declared string at the start of a macro

Post by MyEmQueTwo » Fri Jul 17, 2015 4:00 pm

Thanks a bunch, learned what I needed =)