mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 10
Z
zu_yong Offline OP
Pikka bird
OP Offline
Pikka bird
Z
Joined: Aug 2003
Posts: 10
I would like to have 2 different msgs in 2 different irc channels. I tried this but it works for the first channel only :

on *:JOIN:#chan1:{
if ($level($address($nick,3)) < 25) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick Please read the rules before doing anything stupid by typing
.notice $nick 12!rules , 12!triggers. AND please register your nicks.
.notice $nick Thank you and enjoy yourself while you are here smile
}

on *:JOIN:#chan2:{
if ($level($address($nick,3)) < 25) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick This is a temporary backup channel.
.notice $nick Please do not msg the OPs here.
.notice $nick Thank you and enjoy yourself while you are here smile
}

I'll be off to work now so i won't be replying. I am still a newbie in irc so please include some examples if possible. Thank you in advance. ^_^

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Try this (a few examples that somebody might show you a better way of doing):

on *:join:#: {
if (($chan == chan1) && ($level($address($nick,3)) < 25)) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick Please read the rules before doing anything stupid by typing
.notice $nick 12!rules , 12!triggers. AND please register your nicks.
.notice $nick Thank you and enjoy yourself while you are here
}
if (($chan == chan2) && ($level($address($nick,3)) < 25)) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick This is a temporary backup channel.
.notice $nick Please do not msg the OPs here.
.notice $nick Thank you and enjoy yourself while you are here
}
}


Or it could be done this way:


on *:join:#: {
if ($level($address($nick,3)) < 25) {
if ($chan == chan1) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick Please read the rules before doing anything stupid by typing
.notice $nick 12!rules , 12!triggers. AND please register your nicks.
.notice $nick Thank you and enjoy yourself while you are here
}
if ($chan == chan2) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick This is a temporary backup channel.
.notice $nick Please do not msg the OPs here.
.notice $nick Thank you and enjoy yourself while you are here
}
}

You could even do it this way:

on *:join:#chan1,#chan2: {
if ($level($address($nick,3)) < 25) {
if ($chan == chan1) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick Please read the rules before doing anything stupid by typing
.notice $nick 12!rules , 12!triggers. AND please register your nicks.
.notice $nick Thank you and enjoy yourself while you are here
}
if ($chan == chan2) {
.notice $nick Welcome to $chan $+ , $nick $+ ! I am this channel's bot.
.notice $nick This is a temporary backup channel.
.notice $nick Please do not msg the OPs here.
.notice $nick Thank you and enjoy yourself while you are here
}
}
}

EDITED: The issue you might be getting (probably) is multiple events of the same type in the same file (which is known to fudge up). If this is the case (being in the sme file) only the top one triggers

Last edited by landonsandor; 14/09/03 07:00 AM.

Those who fail history are doomed to repeat it
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
First off - don't post a question and then leave for a week. Post the question after the week. Should you have a follow-up question, people will hardly notice since your thread isn't on the first page anymore.

Second, nothing and I do mean nothing warrants you to send FOUR notices to innocent users who join your channel. Not only are you flooding them - if as little as 2 or 3 users join in short timespan you will be flooding yourself off. Limit it to 1 notice. You can easily combine those four into one.

That said:

Code:
on *:JOIN:#: {
  if ($level($address($nick,3)) &gt;= 25) halt
  if ($chan !isin #channel1 #channel2) halt
  .notice $nick your message here
}


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Aug 2003
Posts: 10
Z
zu_yong Offline OP
Pikka bird
OP Offline
Pikka bird
Z
Joined: Aug 2003
Posts: 10
Ahhh...back from work...
Thanks to landonsandor and LocutusofBorg for your replies.

#1 - Thanks landonsandor. The script u posted works perfectly. Thanks laugh
#2 - Thanks LocutusofBorg for ur advice. I removed all the other ".notice" so I wouldn't flood myself or others grin


Link Copied to Clipboard