Voteban + votekick (pour bot)

Contenu du snippet

ce code a été trouvé sur le net il ne fonctionait pas ; il a été reoptimisé par tofu et moi meme

Source / Exemple :


#votekick on
on *:text:*:#: { 
  if $1 == !votekick || $1 == !voteban { 
    if $2 == $me { msg $chan 4HaHaHa $nick tu es un drole toi allé bouge avant que je te bouge :P } 
    elseif $hget(votekick,voting) { msg $chan $3 un vote est deja en cours } 
    elseif $2 !ison $chan { msg $chan $2 4Indique moi un pseudo $nick je suis pas madame SoLeiL ! } 
    elseif $2 == %owner { msg $chan $2 ne peut pas etre banni } 
    elseif $2 ison $chan { 
      if !$hget(votekick) { hmake votekick 100 } 
      hadd votekick type $iif($1 == !voteban,ban,kick) 
      hadd votekick nick $2 
      hadd votekick vnick $nick 
      hadd votekick chan $chan 
      hadd votekick voting 1 
      notice $chan 4 Un vote est ouvert tapez !vote oui/non pour viré $2 vous avez ( $iif($3 > 30 && $3 isnum,$3,30) Secondes ) 
      timervote 1 $iif($3 > 30,$3,30) voteend 
    } 
  } 
  if $1 == !vote && $chan == $hget(votekick,chan) { 
    if !$hget(votekick,voting) || !$hget(votekick,nick) { halt } 
    if ($nick isin $hget(votekick,voted)) { halt } 
    if (oui == $2) { 
      hadd votekick voted $hget(votekick,voted) $+ , $+ $nick 
      %oui = $calc($hget(votekick,oui) + 1) 
      hadd votekick oui %oui 
      msg $chan $nick 4ton vote est bien enregistré :)

    } 
    if (non == $2) { 
      hadd votekick voted $hget(votekick,voted) $+ , $+ $nick 
      %non = $calc($hget(votekick,non) + 1) 
      hadd votekick non %non 
      msg $chan $nick 4ton vote est bien enregistré :)

    } 
    if (non isin $2) && (oui isin $2) { 
      msg $chan $nick $+ 's éssaie d'etre inteligent stp :/
    } 
  } 
} 

alias voteend { 
  msg $hget(votekick,chan) Résulta des votes: (oui: $+ $iif(!$hget(votekick,oui),0,$hget(votekick,oui)) $+ ) (non: $+ $iif(!$hget(votekick,non),0,$hget(votekick,non)) $+ ) 
  if ($iif(!$hget(votekick,non),0,$hget(votekick,non)) => $iif(!$hget(votekick,oui),0,$hget(votekick,oui))) { 
    msg $hget(votekick,chan) $hget(votekick,nick) ne sera pas kické pas de chance $hget(votekick,vnick) 
  } 
  elseif ($iif(!$hget(votekick,oui),0,$hget(votekick,oui)) > $iif(!$hget(votekick,non),0,$hget(votekick,non))) { 
    if ($hget(votekick,type) == ban) mode $hget(votekick,chan) +b $address($hget(votekick,nick),2) | { kick $hget(votekick,chan) $hget(votekick,nick) Ban et paffff dans ta face :) } 
    elseif ($hget(votekick,type) == kick) { kick $hget(votekick,chan) $hget(votekick,nick) Kick et paffff dans ta face :) }
  } 
  hfree votekick 
} 
#votekick end 

menu channel { 
  VoteKick 
  .On : msg # 4le mode votekick est actif :))) - !votekick <nick> ou !voteban <nick> - | .enable #VoteKick 
  .Off : msg # 4le mode votekick est inactif :p  | .disable #VoteKick | $iif($hget(votekick,voting),hadd votekick voting $false) 
}

Conclusion :


ca fonctionne tré bien et est assé utilile quand il ny a pas dop sur le chan ou pour deliré tt simplement

A voir également

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.