Antipv

Contenu du snippet

encore un de mes snippets sur les htables :)p (dsl Sorn ^^). Donc, ceci est un antipv et antiflood d'ouverture de pv (je n'ai pas pu tester entièrement l'antiflood donc prévenez moi si il y a des bugs merci :))

Source / Exemple :


alias antipv { dialog -m antipv antipv }
dialog antipv {
  title "anti-pv system (/antipv)"
  size -1 -1 130 130
  option dbu
  tab "Anti pv", 1,2 1 125 125
  tab "Anti flood pv", 2,3 1 125 125
  tab "About", 3,3 1 125 125
  box "Action" 4, 7 17 115 40, tab 1
  text "Action lorsque vous recevez un privé:", 5,10 25 110 10, disable nowrap tab 1
  check "Fermer le privé", 6, 15 32 50 10, tab 1
  check "Envoyer un message à la personne", 7, 15 42 94 10, tab 1
  box "Message" 8, 7 58 115 30, tab 1
  text "Message envoyé à celui qui ouvre un privé:", 9, 10 66 110 10, disable nowrap tab 1
  edit "", 10,9 76 110 10, autohs limit 900 tab 1
  box "Activation" 11,7 90 75 35, tab 1
  check "Activer l'anti pv", 12, 11 100 50 10, tab 1
  check "Logguer les messages pv", 13, 11 110 70 10, tab 1
  button "Ok", 14, 85 103 37 10, ok tab 1
  button "Open log", 15, 85 90 37 10, tab 1
  text "isalpha Anti-pv" ,16, 85 115 40 10, disable nowrap tab 1
  box "Selection" 17, 7 17 115 40, tab 2 
  text "Nombre de pv:" , 18,10 27 35 10, disable nowrap tab 2
  edit "" ,19,50 26 10 10, center autohs limit 900  tab 2
  text "Nombre de secondes:" , 20,10 42 52 10, disable nowrap tab 2
  edit "" ,21,65 41 20 10, autohs limit 900  tab 2
  box "Message" 22, 7 58 115 30, tab 2
  text "Message d'ignore des pvs:", 23, 10 66 110 10, disable nowrap tab 2
  edit "", 24,9 76 110 10, autohs limit 900 tab 2
  box "Activation" 25,7 90 75 35, tab 2
  check "Activer l'anti flood pv", 26, 11 100 70 10, tab 2
  check "Logguer les flood", 27, 11 110 70 10, tab 2
  button "Open log", 28, 85 102 37 10, tab 2
  text "Anti ouverture/flood de pv pour isalpha" 29,5 20 100 8, tab 3 nowrap disable
  text "Contacts:" 30,5 30 30 8, tab 3 nowrap disable
  link "www.xdb-project.fr.tc" 31, 5 40 60 8, tab 3
  link "FreKi@exagon.org" 32, 5 50 80 8, tab 3
  box "Aide" 33, 5 60 120 60, tab 3
  text "-> Le message de l'anti flood pv vous avertira" 34, 10 70 110 10, disable nowrap tab 3
  text "en echo que vous vous faîtes flooder." 35, 10 80 105 10, disable nowrap tab 3
  text "-> Les logs (si activés) garderont en mémoire" 36, 10 90 110 10, disable nowrap tab 3 
  text "les adresses et messages des personnes" 37, 10 100 110 10, disable nowrap tab 3
  text "ayant voulues vous prendre en pv" 38,10 110 110 10, disable nowrap tab 3
}

on *:DIALOG:antipv:*:*:{
  if ($devent == init) {
    dll dll\mdx.dll SetMircVersion $version
    dll dll\mdx.dll MarkDialog $dname
    dll dll\mdx.dll SetDialog $dname icon 0 img\antipv.ico
    if (!$hget(antipv)) { hmake antipv | hadd antipv msgpv Dsl <nick> je ne prends pas les messages privés n'insistez pas merci. | hadd antipv msgflood De <nick> <host> : il sera ignoré pour <time> secondes } 
    if ($hget(antipv,chkmsgpv) != on) { did -m $dname 10 } 
    if ($hget(antipv,chkmsgpv) == on) { did -c $dname 7) } 
    if ($hget(antipv,chkfpv) == on) { did -c $dname 6 } 
    if ($hget(antipv,chkactpv) == on) { did -c $dname 12 } 
    if ($hget(antipv,chklogpv) == on) { did -c $dname 13 } 
    if ($hget(antipv,chkactflood) == on) { did -c $dname 26 } 
    if ($hget(antipv,chklogflood) == on) { did -c $dname 27 } 
    did -a $dname 10 $hget(antipv,msgpv)
    did -a $dname 19 $hget(antipv,nbpv)
    did -a $dname 21 $hget(antipv,nbsec)
    did -a $dname 24 $hget(antipv,msgflood)
  }
  if ($devent == edit) { 
    if ($did == 10) { hadd antipv msgpv $did($dname,10) }
    if ($did == 19) { hadd antipv nbpv $did($dname,19) }
    if ($did == 21) { hadd antipv nbsec $did($dname,21) }
  }
  if ($devent == sclick) {
    if ($did($dname,6).state == 1) {  hadd antipv chkfpv on }
    if ($did($dname,6).state == 0) {  hdel antipv chkfpv  }
    if ($did($dname,7).state == 1) { did -n $dname 10 | hadd antipv chkmsgpv on }
    if ($did($dname,7).state == 0) { did -m $dname 10 | hdel antipv chkmsgpv  }
    if ($did($dname,12).state == 1) {  hadd antipv chkactpv on }
    if ($did($dname,12).state == 0) { hdel antipv chkactpv  }
    if ($did($dname,13).state == 1) {  hadd antipv chklogpv on }
    if ($did($dname,13).state == 0) { hdel antipv chklogpv  }
    if ($did == 15) { run logs\antipv.txt }
    if ($did($dname,26).state == 1) {  hadd antipv chkactflood on }
    if ($did($dname,26).state == 0) { hdel antipv chkactflood  }
    if ($did($dname,27).state == 1) {  hadd antipv chklogflood on }
    if ($did($dname,27).state == 0) { hdel antipv chklogflood  }
    if ($did == 28) { run logs\antifloodpv.txt }
    if ($did == 32) { run mailto:FreKi@eXagon.org }
    if ($did == 31) { run iexplore http://www.xdb-project.fr.tc }
  }
  if ($devent == close) { hsave -o antipv antipv.txt }
}
On *:OPEN:?:{
  if ($hget(antipv,chkactpv) == on) {
    if ($hget(antipv,chkfpv) == on) { close -m $nick } 
    if ($hget(antipv,chkmsgpv) == on) { msg $nick $replace($hget(antipv,msgpv),<nick>,$nick) }
    if ($hget(antipv,chklogpv) == on) { write logs\antipv.txt -> $+($chr(40),$time,$chr(41)) $+($nick,:) $1-    }
  }
  if ($hget(antipv,chkactflood) == on) {
    hadd -z antipv pv 1
    if ($hget(antipv,pv) > $hget(antipv,nbpv)) { .ignore $+(-u,$hget(antipv,nbsec),p) *!*@* | echo -a $c(7,• $b($chr(40))) $+ $c(1,/Flood) $+ $c(7,$b($chr(41))) $replace($hget(antipv,msgflood),<nick>,$nick,<host>,$address($nick,2),<time>,$hget(antipv,nbsec)) }
    if ($hget(antipv,chklogflood) == on) { write logs\antifloodpv.txt -> $+($chr(40),$time,$chr(41)) $+($chr(40),$address($nick,2),$chr(41)) $+($nick,:) $1-    }
  }
  else {
    echo -a $c(7,• $b($chr(40))) $+ $c(1,/Query) $+ $c(7,$b($chr(41))) : $+ $b(:) de $nick $c(7,$b($chr(40))) $+ $c(1,$address) $+ $c(7,$b($chr(41))) : $+ $b(:)) $c(1,$1-)
  }
}

menu * {
  Modules
  .$submenu($modules($1))
}

alias modules {
  if ($1 == begin || $1 == end){ return - }
  if ($1 == 1) return Antipv:/antipv
}

on *:start:{
hmake antipv
  hload antipv antipv.txt 
}
On *:Load:{ 
write -c  logs\antipv.txt
write -c logs\antifloodpv.txt
 }

alias u { return $+($chr(31),$1,$chr(31)) }
alias b { return $+($chr(2),$1,$chr(2)) }
alias r { return $+($chr(22),$1,$chr(22)) }

Conclusion :


petit screen: http://membres.lycos.fr/xdbconcept/scripting/antipv.PNG

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.