mIRC Home    About    Download    Register    News    Help

Print Thread
help with simple greeting script #153413 16/07/06 12:24 AM
Joined: Jun 2006
Posts: 6
P
peachey Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Jun 2006
Posts: 6
Code:
;================================
;= Autogreet by Peachey
;= Mailto: p858snake@yahoo.com.au
;================================

on *:JOIN:#:{
  describe $active welcomes $nick -- Welcome to $chan ,How may we help you? We hope you enjoy your stay in $chan
}


I have this script running from my MIRC which controls the 2 channels i help run (#pweb and #peachhut[mine]) when someone joins either channel it produces this:

[10:14] * @peachbot welcomes peachey -- Welcome to #Pweb ,How may we help you? We hope you enjoy your stay in #Pweb

and if someone joins both channels:

[10:14] * @peachbot welcomes peachey -- Welcome to #Pweb ,How may we help you? We hope you enjoy your stay in #Pweb
[10:14] * @peachbot welcomes peachey -- Welcome to #peachhut ,How may we help you? We hope you enjoy your stay in #peachhut

Is their a way to edit the script so it only shows the #pweb one in the #pweb channel and the #peachhut welcome in #peachhut

Thanks in advance.
Peachey

Re: help with simple greeting script #153414 16/07/06 12:31 AM
Joined: Jul 2006
Posts: 53
O
oblivious Offline
Babel fish
Offline
Babel fish
O
Joined: Jul 2006
Posts: 53
Code:
 
on *:JOIN:#:{
  if ($chan == #pweb) { 
    describe $active welcomes $nick -- Welcome to $chan ,How   may we help you? We hope you enjoy your stay in $chan
  }
  if ($chan == #peachhut) { 
    describe $active welcomes $nick -- Welcome to $chan ,How may we help you? We hope you enjoy your stay in $chan
  }
} 


try that

Last edited by oblivious; 16/07/06 01:07 AM.
Re: help with simple greeting script #153415 16/07/06 12:36 AM
Joined: Jan 2006
Posts: 468
symphony Offline
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
Hi, use this
Code:
on *:JOIN:#Channel_name:{  
  describe # welcomes $nick -- Welcome to $chan ,How may we help you? We hope you enjoy your stay in #
}


Or you can use this.
Code:
on *:JOIN:#:{  
  if $istok(#channel1 #channel2 #channel3 , $chan , 32) {
    describe # welcomes $nick -- Welcome to $chan ,How may we help you? We hope you enjoy your stay in #
  }
}


These codes will work for you, but if you are running it in more than one channel, I recommend the 2nd code.
PS: you can add as many channels as you want, separate them with spaces.

Regards,

Re: help with simple greeting script #153416 16/07/06 03:40 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The problem is that you are sending the message to $active. $active returns the window that is currently active/open on your mIRC. The identifier you need to use is $chan. $chan returns the channel where the event was triggered (ie, where the user joined).

-genius_at_work

Re: help with simple greeting script #153417 16/07/06 06:50 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Quote:

Or you can use this.
Code:
on *:JOIN:#:{  
  if $istok(#channel1 #channel2 #channel3 , $chan , 32) {
    describe # welcomes $nick -- Welcome to $chan ,How may we help you? We hope you enjoy your stay in #
  }
}


Why not use the on *:JOIN:#channel1,#channel2,#channel3: { } already in existance?


-KingTomato
Re: help with simple greeting script #153418 17/07/06 07:49 PM
Joined: Jul 2006
Posts: 3
K
Kameku Offline
Self-satisified door
Offline
Self-satisified door
K
Joined: Jul 2006
Posts: 3
Code:
on *:JOIN:#:{
  /describe $chan welcomes $nick -- Welcome to $chan ,How may we help you? We hope you enjoy your stay in $chan
}