mIRC Home    About    Download    Register    News    Help

Print Thread
#173067 20/03/07 02:07 PM
Joined: Oct 2006
Posts: 166
B
b1ink Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
There is someone I came across recently. it's not that huge problem. but I would like to see it in the future.

When I try to write a multiple-line command "event" the bracket { comes after it and then if I want an if condition statement normally it will be the second line after the event itself. but if I tried to put the if condition after the event directly (I meant between the event and the { bracket it won't work. try both examples:
Code:
on *:input:*:{
  if /* !iswm $1 {
    msg $active x $1-
    halt
  }
}

We've all seen this before. it will work. now see the other one with the small difference I tried.
Code:
on *:input:*:if /* !iswm $1 {
  msg $active x $1-
  halt
}

It won't!!

Keep in your mind that this thing doesn't only happen in the on input event. but that's what I tried to do and I would like you to test/try.


Kind Regards, blink
b1ink #173074 20/03/07 02:34 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I believe that is due to the syntax of what a { is for. In order to have a multi-line script, you need a { directly following the event... not after you're part way into the code. Whether or not that should be changed, I don't know, but that's the reason for it.


Invision Support
#Invision on irc.irchighway.net
b1ink #173078 20/03/07 02:47 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Code:
on *:input:*: {
  if ($1 == a) if ($2 == b) {
    echo -a yay: $1-
  }
}


It should be valid imo just as the above is valid. Although not pretty :P

I guess mIRC just checks if the first char is a { to see if it's multiline block or not when parsing events.



$maybe

Link Copied to Clipboard