mIRC Homepage
Posted By: peachey help with simple greeting script - 16/07/06 12:24 AM
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
Posted By: oblivious Re: help with simple greeting script - 16/07/06 12:31 AM
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
Posted By: symphony Re: help with simple greeting script - 16/07/06 12:36 AM
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,
Posted By: genius_at_work Re: help with simple greeting script - 16/07/06 03:40 AM
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
Posted By: KingTomato Re: help with simple greeting script - 16/07/06 06:50 PM
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?
Posted By: Kameku Re: help with simple greeting script - 17/07/06 07:49 PM
Code:
on *:JOIN:#:{
  /describe $chan welcomes $nick -- Welcome to $chan ,How may we help you? We hope you enjoy your stay in $chan
}
© mIRC Discussion Forums