mIRC Home    About    Download    Register    News    Help

Print Thread
#167708 29/12/06 02:53 AM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
How do I make a script that says "Welcome ____" if I have another on join script... I tried the one in the example but it won't work, if the other script is activated

THE_ADZ #167709 29/12/06 02:58 AM
Joined: Dec 2006
Posts: 37
T
THE_ADZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2006
Posts: 37
This is what I had so far:

on 1:JOIN:#avatarrp:if ($nick isin %list) { /mode #avatarrp +h $nick } else { msg $chan Welcome to $chan $nick }

But it won't work...

THE_ADZ #167711 29/12/06 03:13 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
on 1:JOIN:#avatarrp:{ if ($nick isin %list) { /mode #avatarrp +h $nick } | else { msg $chan Welcome to $chan $nick } }

The ELSE needs a command seperator in front of it this is the same as placing int on another line, thats why u might see constructs like...
if ( ) { ... }
else { ... }

to put it on one line it must be
if ( ) { ... } | else { ... }

essentially i think ELSE is in someway a special IF construct that says IF (last if failed) { }



THE_ADZ #167712 29/12/06 03:19 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on 1:JOIN:#avatarrp:{
  if ($nick isin %list) {
    /mode #avatarrp +h $nick
  }
  else {
    msg $chan Welcome to $chan $nick
  }
}

There's nothing wrong with using multiple lines and it can make locating just where a problem exists a lot easier.

If you want to have it all on one line, then you need to put a pipe | in front of the else statement (remember there needs to be a space on both sides of the pipe)
Code:
on 1:JOIN:#avatarrp:if ($nick isin %list) { /mode #avatarrp +h $nick } | else { msg $chan Welcome to $chan $nick }


Link Copied to Clipboard