31/12/2010, 12:21
(This post was last modified: 31/12/2010, 12:21 by alanfollow.)
Bonjour,
J'ai un petit sur ces quelques lignes, qui, comme vous avez pu le comprendre serait que lorsque une personne fait un FAILED OPER, l'eggdrop lui envoi un message, et ainsi qu'un message sur le salon d'oper.
J'essaye ceci, mais rien ne se passe, ni même une erreur en PL.
PHP Code: bind raw - NOTICE opers:notice proc opers:notice {from key arg} { global botnick notc mod set text [split $arg] if {[join [lrange $text 1 3]] == "Failed OPER"} { set opers_nick [lindex $text 6] set opers_user [string range [lindex [split [lindex $text 6] "@"] 0] 1 end] set opers_host [string range [lindex [split [lindex $text 6] "@"] 1] 0 end-1] set oper_userhost "$opers_nick!$opers_user@$opers_host" puthelp "PRIVMSG #opers :Je crois bien que $opers_nick a du mal à s'ircop... ( $opers_userhost )" puthelp "PRIVMSG $opers_nick :Tout va bien ?" } }
Sachant que la "SNOTICE" est :
Code: -NOTICE- Failed OPER attempt by pseudo (~user@host) [unknown oper]
Voilà, merci d'avance !
31/12/2010, 13:46
(This post was last modified: 31/12/2010, 13:54 by alanfollow.)
Comme ceci ?
PHP Code: bind raw - "001" opers:notice proc opers:notice {from key arg} { global botnick notc mod set text [split $arg] if {[join [lrange $text 1 3]] == "Failed OPER"} { set opers_nick [lindex $text 6] set opers_user [string range [lindex [split [lindex $text 6] "@"] 0] 1 end] set opers_host [string range [lindex [split [lindex $text 6] "@"] 1] 0 end-1] set oper_userhost "$opers_nick!$opers_user@$opers_host" puthelp "PRIVMSG #opers :Je crois bien que $opers_nick a du mal à s'ircop... ( $opers_userhost )" puthelp "PRIVMSG $opers_nick :Tout va bien ?" } }
Rien n'y fait.
join [lrange $text 1 3] sur ta notice donne "OPER attempt by" et non pas "Failed OPER".
Toute l'actualité de mes scripts ici (dernière mise à jour le 22/04/2020)
Tout programme comporte au moins un bug et pourrait être raccourci d'au moins une instruction, de quoi l'on peut déduire que tout programme peut être réduit à une seule instruction qui ne fonctionne pas.
As-tu pensé à faire:
Et aussi, est-ce que ton eggdrop a les bons flags pour recevoir ces snotices ?
@alias_angelius: le raw NOTICE est valable.
MenzAgitat Wrote:join [lrange $text 1 3] sur ta notice donne "OPER attempt by" et non pas "Failed OPER".
Je dois mettre :
Ceci alors ?
@CrazyCat: L'eggdrop est ircop, c'est bon normalement, non ? (pour recevoir les snotices).
PHP Code: bind raw - NOTICE opers:notice proc opers:notice {from key arg} { global botnick notc mod set text [split $arg] if {[join [lrange $text 1 2]] == "Failed OPER"} { [lrange $text 1 3] set opers_nick [lindex $text 6] set opers_user [string range [lindex [split [lindex $text 6] "@"] 0] 1 end] set opers_host [string range [lindex [split [lindex $text 6] "@"] 1] 0 end-1] set oper_userhost "$opers_nick!$opers_user@$opers_host" puthelp "PRIVMSG #opers :Je crois bien que $opers_nick a du mal à s'ircop... ( $opers_userhost )" puthelp "PRIVMSG $opers_nick :Tout va bien ?" } }
Ne donne des valeurs au hasard et réfléchis un peu.
Les éléments d'une liste sont comptés à partir de 0.
Pourquoi tu n'essaies pas de mettre cette ligne dans ton code pour voir ce que ça retourne ? Tu verras ainsi ce que tu extrais de la notice :
un peu de lecture : http://www.eggdrop.fr/Utilisation_des_listes
Toute l'actualité de mes scripts ici (dernière mise à jour le 22/04/2020)
Tout programme comporte au moins un bug et pourrait être raccourci d'au moins une instruction, de quoi l'on peut déduire que tout programme peut être réduit à une seule instruction qui ne fonctionne pas.
31/12/2010, 14:48
(This post was last modified: 31/12/2010, 14:49 by CrazyCat.)
alanfollow Wrote:MenzAgitat Wrote:join [lrange $text 1 3] sur ta notice donne "OPER attempt by" et non pas "Failed OPER". Je dois mettre :
Non, tu vois bien que l'index 1 contient "OPER".
Il te faut donc:
alanfollow Wrote:@CrazyCat: L'eggdrop est ircop, c'est bon normalement, non ? (pour recevoir les snotices). Il lui faut surtout le flag +s (receive server notices)
J'ai l'impression que tu n'as pas lu mon message et donc pas testé mon petit bout de script.
Conclusion: j'aiderai quand tu liras et appliqueras.
Kékidi ? ^^
T'en fais pas pour la sécurité ;)
PHP Code: bind raw - NOTICE opers:notice proc opers:notice {from key arg} { global botnick notc mod set oper_text [split $arg] if {[join [lrange $oper_text 0 1]] == "Failed OPER"} { set opers_nick [lindex $oper_text 6] set opers_user [string range [lindex [split [lindex $oper_text 6] "@"] 0] 1 end] set opers_host [string range [lindex [split [lindex $oper_text 6] "@"] 1] 0 end-1] set oper_userhost "$opers_nick!$opers_user@$opers_host" puthelp "PRIVMSG #opers :Je crois bien que $opers_nick a du mal à s'ircop... ( $opers_userhost )" puthelp "PRIVMSG $opers_nick :Tout va bien ?" putlog "[lrange $oper_text 1 2]" } }
bind raw - * test:raw proc test:raw {from kw text} { putlog "$from => $kw : $text" }
Rien ne se passe avec ton petit bout de code @ CrazyCat.
Ni en PL, ni rien.
Sinon, j'ai essayé ceci pour les connexions, et ça fonctionne.
PHP Code: bind raw - NOTICE connection:notice proc connection:notice {from key arg} { global botnick notc mod set text [split $arg] if {[join [lrange $text 2 5]] == "Notice -- Client connecting"} { set c_nick [lindex $text 9] set c_user [string range [lindex [split [lindex $text 10] "@"] 0] 1 end] set c_host [string range [lindex [split [lindex $text 10] "@"] 1] 0 end-1] set c_userhost "$c_nick!$c_user@$c_host" puthelp "PRIVMSG #opers :Il y a $c_user @$c_host qui arrive !" } }
Mais pour le FAILED OPER, impossible, rien ne se passe.
31/12/2010, 17:29
(This post was last modified: 31/12/2010, 17:30 by cestlemien.)
coucou ,
Et si tu changes le mot detecté " Failed OPER "
Par : " [unknown oper] "
cordialement.
|