Is the following valid code?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Azum
a hill giant
a hill giant
Posts: 229
Joined: Wed Jun 04, 2003 5:04 am

Is the following valid code?

Post by Azum » Tue Nov 25, 2003 9:21 pm

Can anyone tell me if the first /if statement in the following code block is valid? Or can you not use & for two conditions?

Code: Select all

Sub Event_Bash 
    /if $combat()=="True" & $target()=="True" { 
    
   /if n $char(ability,"Bash")>0 /doability "Bash" 
      } 
    } 
   
    /return      

DekeFentle
a lesser mummy
a lesser mummy
Posts: 48
Joined: Wed Oct 22, 2003 1:41 pm

Post by DekeFentle » Tue Nov 25, 2003 10:03 pm

DOn't know about the code but it apears you have two }
Revelation 6:8

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Tue Nov 25, 2003 10:18 pm

It is not a valid /if. Right now, you can not use compound logic in a single /if statement. You would need to nest them. This should work though.

Code: Select all

/if $combat()=="True" /if $target()=="True" /if n $char(ability,"Bash")>0 /doability "Bash"