This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

little help needed

Old posts that have not been replied to for several years.
Locked
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

little help needed

Post by Pitchat »

Hi

i have this little scripts who send a part msg when someone leave the channel. the problem is that the eggdrop say that message on everychannel he`s on and i`d like tio make it channel specific heres the code

Code: Select all

set channel "#aide-moi.net"
bind part - "*" do_part 

proc do_part {nick user hand chan arg} { 
   putserv "NOTICE $nick :Merci de ta présence parmis nous et à bientôt sur #Aide-Moi.Net" 
   return 0 
} 
thanks

Pitchat
D
Darkj
Halfop
Posts: 86
Joined: Sun Jul 06, 2003 9:58 pm

Post by Darkj »

Code: Select all

set channel "#aide-moi.net" 
bind part - "*" do_part 

proc do_part {nick user hand chan arg} { 
   global channel
   if {$chan != $channel} { return 0 }
   putserv "NOTICE $nick :Merci de ta présence parmis nous et à bientôt sur #Aide-Moi.Net" 
   return 0 
} 
P
Pitchat
Op
Posts: 122
Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:

Post by Pitchat »

works great

thanks

is it possible to use the same synthax for other scripts ?

Code: Select all

set channel "#aide-moi.net" 
global channel 
if {$chan != $channel} { return 0 } 
thks again

Pitchat
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Certain IRCD's (Most?) have a tendancy of returning channel names in various case formats (as a result of a user joining the channel in a different case)... as such you will want to make it a case insensitive expression, to handle these occurances....

For example:

Code: Select all

if {[string tolower $chan] != [string tolower $channel]} { return 0 }
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Also, you can have the channel name included in the bind like:

Code: Select all

bind part - "#channel *" do_part
but again, the string tolower (strlwr if alltools.tcl is loaded) rules :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

set channel "#aide-moi.net"

$channel is already lower-case so [string tolower $channel] wouldn't be needed ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

If you are shure you have it in lowercase then is not needed.
Once the game is over, the king and the pawn go back in the same box.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Sir_Fz wrote:set channel "#aide-moi.net"

$channel is already lower-case so [string tolower $channel] wouldn't be needed ?
Yes but if you don't , and then later on you try to change that configuration variable (for a different channel) and slip in a capital letter, your code would be broken without the conversion.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok, that I realise :)
Locked