tcl
bind join - #sex proc:join
bind msg - * msg:all
proc proc:join {nick host hand chan} {
puthelp "NOTICE $nick Bonjour $nick,Pour pouvoir rentrer sur le salon il me faut ton âge (tape la commande /msg AGent-de-police \"age\" ) !"
puthelp "NOTICE $nick TchaT-TenDanCe ne sera pas responsable si vous êtes mineur et que vous entrez sur le salon !!"
return 0
}
proc msg:all {nick host hand text} {
set arg [split $arg]
set age [lindex $arg 0]
if {[isnum $age]} {
if {$age < 18} {
puthelp "NOTICE $nick :Tu n'as pas l'âge requis pour rejoindre le salon !!"
puthelp "NOTICE $nick :L' âge requis est de 18 ans minimum"
puthelp "SAPART $nick #sex"
return 0
} else {
puthelp "NOTICE $nick :Bienvenue sur #sexe"
return 0
}
}
}
proc isnum {string} {
if {([string compare $string ""]) && (![regexp \[^0-9\] $string])} then {return 1}
return 0
}