nick non register msg
#1
salut,

j'aurait besoin d'aide pour debuter mon code;

• J'aimerait que le bot check les joins { #salon1 #salon2 }
• Il verifie si le nick est enregistré.
• Si oui stop de la proc.
• Si non ,message à nick-non-register "blablablabla"
• + un envois sur #salonlog qu'un PV à ete envoyé à nick-non-register.

Et là,j'ai eu beau chercher,pas de resultat,du coup j'ai del le bout de code commencé. :/

Merci .
Répondre Avertir
#2
Aide:
Tu fais un whois sur le nick, tu récupères le raw associé, tu le traites (ne pas comprendre insulter lol) etc etc
CrazyCat a écrit :La prochaine fois, essaye d'imaginer que j'ai un cerveau ...
Répondre Avertir
#3
Re,

bon,j'ai test,mais pas concluant Sad

TCL
#----------------------
#nickregister SCAN SCRIPT -
#--------------------
# absolu [creation]		14/07/2009
#			:raw311 : whois
#			: raw307: nickregister
#			: envois du message sur opchan avec le salon ou se trouve le nick detecté
#			: mise en place un  message  en  mp à l'user.
#	commandes:
#			!mpcount affiche total de mp sur nombre de whois
#			!mpreset remet a zero le compteur
 
set count_whois 0
set count_mp 0
#------->> request registernick <<-----
set badr(list) {
"*n'est pas enregistré.*"
"*not reg*"
 
}
#----->> Info chan <<-----
set opchan "#log-chan"
#----->> Chan à Scanner, seperé par un  espace <<-----
set badr(chan) "#channel1 #channel2" 
#binds
bind join - "$badr(chan) *" brealname:join
bind raw - 311 brealname:check
bind PUB - !compte mp_count
bind PUB - !reset mp_reset
# join
proc brealname:join {nick host hand chan} { 
	global WhoisNick WhoisNickWarn
	if {[strlwr $nick] == [strlwr $::botnick] || [matchattr $hand of|fo $chan]} {
		return 0
	} 
	if {([info exists WhoisNickWarn($host)] == 1)} {
		return 0
	}
	set WhoisNickWarn($host) 1
	timer 2 "unset WhoisNickWarn($host)"
	if {([info exists WhoisNick] == 1)} {
		if {$WhoisNick == 5} {
			putlog "$WhoisNick Whois max"
			return 0
		}
		incr WhoisNick
	} else {
		set WhoisNick 1
		utimer 2 "unset WhoisNick"
	}
	putserv "WHOIS $nick" 
}
# check
proc brealname:check {from key arg} { 
	global opchan count_whois count_mp
	incr count_whois
	set realname [ctrl:filter [string range $arg [expr [string first : $arg]+1] end] ]
	foreach bla $::badr(list) {
		if {![string match -nocase $bla $realname]} {
			continue
		}
	putserv "PRIVMSG $opchan :ACTION 4 Info nickerv :4 [lindex [split $arg] 1] n'estpas enregistré sur $::badr(chan)  0 - PV informatif eFFectué - $count_whois "
	putserv "PRIVMSG [lindex [split $arg] 1] : STP,pour une meilleure gestion du salon Mercid'enregistrer  ton pseudo :lis ceci : http://XXXXXX.nickserv.htm " 
		incr count_mp
	    	break
	}
}
proc mp_count {nick host hand chan text} { 
	global opchan count_whois count_mp
	if {[string match -nocase $chan $opchan] && ([isvoice $nick $chan] || [ishalfop $nick $chan] || [isop $nick $chan])} {
		putserv "PRIVMSG $chan : Total de $count_mp MP pour $count_whois join " 
	}
}
proc mp_reset {nick host hand chan text} { 
	global opchan count_whois count_mp
	if {[string match -nocase $chan $opchan] && [isop  $nick $chan]} {
		set count_mp 0
		set count_whois 0
		putserv "PRIVMSG $chan : Compteur de mp remis à zero :) merci de me soulager $nick" 
	}		
}
#ppslim's filter
proc ctrl:filter {str} {
  regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
  return $str
}
putlog  " \0034Register tcl V1.1a  chargé - Register tcl v1.1a -- scan sur: $badr(chan) / report: $opchan\003"
putserv " privmsg #chan-log : \0034 Register tcl V1.1a  chargé\003 -- scan sur: $badr(chan) / report: $opchan\003 "
############################# fin du TCL ####################



il compte bien les joins,mais pas de mp envoyé. :/
Répondre Avertir
#4
Lorsque que tu /whois une personne, tu reçois une RAW (je ne sais plus laquelle), qui indique "est un pseudo enregistré". Peut importe le texte, c'est le numéro de la raw qui compte.

Tu lances le /whois, puis quand tu recois 'End of WHOIS List', qui est aussi une raw, tu regardes si tu as reçu la raw "is registered" ou pas. Tu vois l'idée?
Répondre Avertir
#5
Code :
bind join -|- * vip
proc vip { nick uhost hand chan } {
bind raw  - 307 whois_nick
puthelp "whois $nick"
}
proc whois_nick {from keyword arg} {
set pseudo [lindex $arg 1]
set vip [lindex $arg 4]
set sivip "registered"
if {$vip == $sivip } {
putquick "privmsg #tonsalon bonjour $pseudo  "
} else {
putquick "privmsg $pseudo inscrivez-vous en tant que VIP sur blablabla"
unbind raw  - 307 whois_nick
}
}

voila une petite exemple a vous de modifier si il ya un erreur
++
Répondre Avertir
#6
Bonjour,
Apres quelques tests infructueux, et quelques tirages de cheveux, celà fonctionne.

Citation :Attention si vous utilisez ce code, pensez à le modifier en consequence.

TCL
###########################
# Nick-Register.tcl
###########################
set proprio "Votre nick"
set register_version "2.1a"
set foo "#salon1 #salon2 #saon3"
bind join - * foo 
proc foo {n u h c} { 
   puthelp "whois $n" 
} 
bind raw - 311 got311 ;# first WHOIS reply 
bind raw - 307 got307 ;# nick has identified (registered) 
bind raw - 318 got318 ;# End of /WHOIS list 
proc got311 {f k t} { 
   set n [lindex [split $t] 1] 
   set ::whoised($n) 0 
} 
proc got307 {f k t} { 
   set n [lindex [split $t] 1] 
   incr ::whoised($n) 
} 
proc got318 {f k t} { 
   set n [lindex [split $t] 1] 
   if {$::whoised($n) == 0} { 
      puthelp "privmsg $n :Hello \00304$n\003 et bienvenue.Il est préfèrable d'être enregistré pour plus de securité et garder  ton pseudo. \00304 /msg nickserv REGISTER \003 \037\00304 <password> <ton@email> \003 \003 (ce qui est entre < > est à modifier).Un email valide. Si  pb pour t'enregistrer,  vois sur \00304#salon-aide\003" 
	  putquick "PRIVMSG #Salon-DE-log : \037\00303$n\003\ \003 ne semble pas être enregistré.Pv envoyé -> $n <- "
   } 
}  
# on ban apres combien  de secondes ?
set banafter(j:s) 3:60 
 
bind join - * kick:unreg 
 
foreach {banafter(j) banafter(s)} [split $banafter(j:s) :] {break} 
 
proc kick:unreg {nick uhost hand chan} { 
 global banafter whoised rejoins 
 if {![info exists rejoins([set n [string tolower $nick]])]} { set rejoins($n) 0 } 
 if {!$whoised($nick)} { 
    puthelp " mode $chan -v $nick "
#~~~~ On peux bbanir l'user ~~~~~~~~
  #newchanban $chan *!*@[lindex [split $uhost @] 1] unreg "STP , identifies ( /ns identify <ton_password> ) toi ou enregistres toi.Tu est bannis 5 mn. ban.Reviens quand ceci seras fait Merci.Si tu as un soucis vois sur #salon-aide" 5 
  utimer $banafter(s) [list incr rejoins($n) -1] 
  if {[incr rejoins($n)] >= $banafter(j)} { 
   puthelp " mode $chan -v $nick "
#~~~~~~decommanté si l'on  veux débannir (si l'option  ban à ete mise en place) ~~~~~~
#   puthelp "MODE $chan +b *!*@[lindex [split $uhost @] 1]" 
  } 
 } 
} 
putlog "©Nick-REgister.tcl.tcl $register_version Script par  $proprio chargé  "
putserv "PRIVMSG #salon-log : \037\002©Nick-REgister.tcl $register_version Script par  ©cestlemien chargé \037\002 "


Répondre Avertir
#7
Salut,

Ou est-il possible de mettre un timer pour attendre avant d'enclencher la proc, car le temps qu'il s'identifie... par exemple 30 secondes après, la proc se lance ?

Merci bien de votre aide.
Répondre Avertir
#8
Avec:
TCL
bind join - * foo
proc foo {n u h c} {
   utimer 30 [puthelp "whois $n"]
}


Répondre
#9
Bonjour,

J'ai cette erreur :

Code :
(•- 14:42 -•) <(athena> [14:42] Tcl error in script for 'timer3108':
(•- 14:42 -•) <(athena> [14:42] invalid command name "0"
(•- 14:42 -•) <(athena> [14:42] Tcl error in script for 'timer3113':
(•- 14:42 -•) <(athena> [14:42] invalid command name "0"
Code :
(•- 18:38 -•) <(athena> [18:38] Tcl error [kick:unreg]: can't read "whoised(Manon`OqP)": no such element in array
(•- 18:39 -•) <(athena> [18:39] Tcl error in script for 'timer6048':
(•- 18:39 -•) <(athena> [18:39] invalid command name "0"
(•- 18:45 -•) <(athena> [18:45] Tcl error in script for 'timer6124':
(•- 18:45 -•) <(athena> [18:45] invalid command name "0"
(•- 18:45 -•) <(athena> [18:45] Tcl error in script for 'timer6125':
(•- 18:45 -•) <(athena> [18:45] invalid command name "0"
(•- 18:45 -•) <(athena> [18:45] Tcl error in script for 'timer6126':
(•- 18:45 -•) <(athena> [18:45] invalid command name "0"
Il n'attend pas les 30 seconds, il whois et dit la phrase de suite, à l'arrivée de l'utilisateur.
Répondre Avertir
#10
C'est quoi ces utimer sur les puthelp ? Quel est leur intérêt ?
Et comment doit fonctionner ton TCL avec 2 bind join ?
Répondre
#11
Exact, je n'avais pas fais attention !
Le utimer ne fonctionne toujours pas... la phrase " Tu ne sembles pas être identifié, ou voir enregistré $n." sort directement à l'entrée de $n.

Code PHP :
set foo "#Loft"
bind join #Loft foo
proc foo {n u h c} {
   
utimer 30 [puthelp "whois $n"]
}
bind raw 311 got311 ;# first WHOIS reply
bind raw 307 got307 ;# nick has identified (registered)
bind raw 318 got318 ;# End of /WHOIS list
proc got311 {f k t} {
   
set n [lindex [split $t1]
   
set ::whoised($n0
}
proc got307 {f k t} {
   
set n [lindex [split $t1]
   
incr ::whoised($n)
}
proc got318 {f k t} {
   
set n [lindex [split $t1]
   if {$::
whoised($n) == 0} {
     
putquick "PRIVMSG #Opers : $n ne semble pas être enregistré ou identifié."
     
puthelp " mode #loft -v $n "
     
puthelp " privmsg #loft  Tu ne sembles pas être identifié, ou voir enregistré $n."
   
}
}  

putlog "©Nick-REgister.tcl" 

Code :
(•- 22:20 -•) <(athena> [22:20] Tcl error in script for 'timer8862':
(•- 22:20 -•) <(athena> [22:20] invalid command name "0"
Répondre Avertir
#12
Un problème avec l'utimer ?
Répondre Avertir


Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté