mIRC Homepage
Posted By: bojak71730 autogreet script - 08/09/12 07:10 PM
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
Posted By: Riamus2 Re: autogreet script - 08/09/12 07:59 PM
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
  }
}

Posted By: Tomao Re: autogreet script - 09/09/12 05:17 PM
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 #
© mIRC Discussion Forums