mIRC Home    About    Download    Register    News    Help

Print Thread
#238925 08/09/12 07:10 PM
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
Code:
 on *:join:#: { 
if ($nick == bojak) 
msg  $chan Welcome master to $chan 

	}
 
elseif ($nick !== bojak)

 { msg $chan Welcome to $chan }

} 


i cant get this autojoin to send the last message if its not me.. im coding this for my bot

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You are missing the { after the IF statement. Also, not equal is != not !==.

Code:
on *:join:#: { 
  if ($nick == bojak) {
    msg $chan Welcome master to $chan 
  }
  elseif ($nick != bojak) {
    msg $chan Welcome to $chan
  }
}


And, because the IF/ELSEIF can only be 2 things, you don't really need the ELSEIF. Just use ELSE because if it's not the first thing, then it has to be the second.

Code:
on *:join:#: { 
  if ($nick == bojak) {
    msg $chan Welcome master to $chan 
  }
  else {
    msg $chan Welcome to $chan
  }
}



Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Adding to Riamus2 suggestion about using if-then-else, you can shorten it further as a one-liner code using $iif
Code:
on *:join:#: msg # Welcome $iif($nick == bojak,master) to #


Link Copied to Clipboard