Unban Niubot..
#2
Il y a une légère optimisation que je ferais: contrôler que la victime est bannie avant le reste.
D'autant plus qu'il me semble voir une erreur: si un autre utilisateur que Niubot pose un ban, tu débannis (et deop le poseur) sans vérifier si la victime doit être bannie.
Voici comment j'agencerais ton code:
TCL
namespace eval ::niuban {
   variable niubotchan "#salon"
   bind MODE - "* +b" [namespace current]::unban_niubot
   proc unban_niubot { nick uhost hand chan mc target } {
      variable niubotchan
      if {[isbotnick $nick]} { return 0 }
      if {[isban $target $chan]} { return 0 }
 
      if {[string match -nocase niubot?? $nick]} {
         putquick "PRIVMSG $niubotchan :unban $target $chan"
      } else {
         putquick "mode $chan -ob $nick $target"
         puthelp "privmsg $niubotchan :\037\0034Seuls les bans via $::botnick sont autorisés !\037\0034"
      }
   }
}


Répondre


Messages dans ce sujet
Unban Niubot.. - par aliasangelius - 11/11/2012, 18:35
RE: Unban Niubot.. - par CrazyCat - 12/11/2012, 10:16
RE: Unban Niubot.. - par aliasangelius - 12/11/2012, 10:21
RE: Unban Niubot.. - par CrazyCat - 12/11/2012, 18:20
RE: Unban Niubot.. - par aliasangelius - 13/11/2012, 09:58

Sujets apparemment similaires…
Sujet Auteur Réponses Affichages Dernier message
  [Résolu] problème de timer sur un unban Alucard`68 6 1,821 18/04/2017, 15:25
Dernier message: Alucard`68
  Création d'un script d'unban Demonis 9 3,967 17/03/2013, 22:18
Dernier message: Demonis
  Eggdrop, qui unban automatiquement... IluZi0n 4 3,183 16/04/2009, 14:52
Dernier message: David
  unban apres x temps pepino 0 2,958 16/08/2008, 22:00
Dernier message: pepino

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)