mIRC Home    About    Download    Register    News    Help

Print Thread
autogreet script #238925 08/09/12 07:10 PM
Joined: Oct 2005
Posts: 54
B
bojak71730 Offline OP
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

Re: autogreet script [Re: bojak71730] #238926 08/09/12 07:59 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
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
Re: autogreet script [Re: bojak71730] #238935 09/09/12 05:17 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
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 #