I saw that someone had written a welcome message. therefore i put 1 downe that i use
/
by replacing " $chan " for " $nick " you make it a personal welcomes message
/
on *:JOIN:#: {
/set %join.rand $rand(1, 3)
if (%join.rand == 1) /msg $chan welcome on the $chan chat $nick
if (%join.rand == 2) /msg $chan welcome on the $chan chat chanal $nick $+ .
if (%join.rand == 3) /msg $chan welcome $nick, stick to the rules and I will not kick you ;)
}
@Mr.MaSTeR your if ($nick !=== $me isn't really needed when you can just do on !*:join:
Well, for a three-line randomization, this snippet doesn't require a text file to begin with. A
$gettok( ,$r(1,3) , 32 )
should get the job done right. :P
Or:
var %var = $r(1,3)
if (%var == 1) { do this }
elseif (%var == 2) { do that }
else { do another }
But then again, it's considered quit a bit of effort to jot down or copy / paste everything on the body of a text file to be randomized utilizing
$read()
Also, @extreme12 why would you go through the pain of wasting so much space for a snippet that can be done in 1 or 2 lines of coding? A .txt file would suffice in snippets like this. It reduces the length of the code for starters and eliminates the need for it to jump to a number to read the line.
On *:JOIN:#: { .msg $chan $Read(Welcome.txt) }
This would work perfectly. Sorry if I seem a bit rude. Apologies.
Let me butt in here and say the snippet doesn't work as @Sorasyn and @Stewie1k94 stated. Let's examine why.
Your code:
on *:JOIN:#: {
/set %join.rand $rand(1.3) {
if (%join.rand == 1) /msg $chan welcome on the $chan chat $nick
if (%join.rand == 2) /msg $chan welcome on the $chan chat chanal $nick.
if (%join.rand == 3) /msg $chan welcome $nick, stick to the rules and I will not kick you ;)
}
}
Line 2 is incorrect. Let's start from the first error. You have a period instead of a comma where you use $rand. It should read $rand(1,3) not $rand(1.3). Secondly, this line doesn't require a bracket at the end. There is no statement preceding the bracket, therefore it won't work as-is. Your code should look similar to @Stewie1k94's code in order for it to work properly. >.<
Overall, I don't understand why people still make these types of snippets anymore. No one really wants to be greeted by a bot. It's quite annoying (personally). However, it is a good place to start (I suppose) if you're new to coding mSL. >.<
Your way didn't work for me, as I just tested it. But I removed the bracket, and changed some things:
on *:JOIN:#thunderbolt: {
set %join.rand $rand(1,3)
if (%join.rand == 1) msg $chan welcome on the $chan chat $nick
if (%join.rand == 2) msg $chan welcome on the $chan chat chanal $nick.
if (%join.rand == 3) msg $chan welcome $nick, stick to the rules and I will not kick you ;)
}
- Stewie (I@m.Sexy.Stewie) has joined #thunderbolt
<&thunderbolt|ghost> welcome on the #thunderbolt chat Stewie
; this is one of mine welcome mesage random