/if statement Help

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Yeoman
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Oct 14, 2012 11:17 pm

/if statement Help

Post by Yeoman » Mon Oct 15, 2012 7:38 pm

Wiki is very unclear on useage, and syntax, Not sure how to write /if's

/if (!${Me.no.target}) /makecamp return

If there is no target, return to camp is what It should do, but I think I got something wrong.

/if (!${me.target}) /attack on

if there is a target it should attack on.

any help or point me in right direction of info how to construct would be appreciative.

Thanks.

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

Re: /if statement Help

Post by ieatacid » Mon Oct 15, 2012 8:51 pm

Code: Select all

/if(${Target.ID}) /echo i have a target
And everything is case-sensitive.

Yeoman
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Oct 14, 2012 11:17 pm

Re: /if statement Help

Post by Yeoman » Mon Oct 15, 2012 9:30 pm

is the echo needed for that never seen echo stuff, thanks will play around with it

User avatar
htw
a grimling bloodguard
a grimling bloodguard
Posts: 512
Joined: Wed Feb 18, 2004 8:30 pm
Location: Albuquerque, NM USA
Contact:

Re: /if statement Help

Post by htw » Tue Oct 16, 2012 7:26 am

Yeoman wrote:is the echo needed for that never seen echo stuff, thanks will play around with it
No, he was giving you an example of proper usage.

For the ones you put, and what you asked, it would be:

/if (!${Target.ID}) /makecamp return

/if (${Target.ID}) /attack on

htw

Yeoman
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Oct 14, 2012 11:17 pm

Re: /if statement Help

Post by Yeoman » Tue Oct 16, 2012 8:08 pm

Thanks