Commandes ircop

Contenu du snippet

Il permet de gline shun gzline rapidementa avec alias/inputs/popups testé sur Unrealircd

Source / Exemple :


;~~~ Alias ~~~

alias gl {
  if ( $$1 != $null ) {
    set %gl. [ $+ [ $1 ] ] oui
    if ( $2 == $null ) { 
      set %gl.temps. [ $+ [ $1 ] ] %GlineInstTime
    }
    else {
      set %gl.temps. [ $+ [ $1 ] ] $2
    }
    if ( $3 == $null ) {
      set %gl.raison. [ $+ [ $1 ] ] No reason.
    }
    else {
      set %gl.raison. [ $+ [ $1 ] ] $3-
    }
    userhost $1
  }
}

alias shu {
  if ( $$1 != $null ) {
    set %shu. [ $+ [ $1 ] ] oui
    if ( $2 == $null ) { 
      set %shu.temps. [ $+ [ $1 ] ] %GlineInstTime
    }
    else {
      set %shu.temps. [ $+ [ $1 ] ] $2
    }
    if ( $3 == $null ) {
      set %shu.raison. [ $+ [ $1 ] ] No reason
    }
    else {
      set %shu.raison. [ $+ [ $1 ] ] $3-
    }
    userhost $1
  }
}

alias gz {
  if ($$1 != $null) {
    set %gz. [ $+ [ $1 ] ] oui
    if ($2 == $null) { 
      set %gz.temps. [ $+ [ $1 ] ] %GlineInstTime
    }
    else {
      set %gz.temps. [ $+ [ $1 ] ] $2
    }
    if ( $3 == $null ) {
      set %gz.raison. [ $+ [ $1 ] ] No reason
    }
    else {    
      set %gz.raison. [ $+ [ $1 ] ] $3-
    }
    userhost $1
  }
}

alias ki {
  kill $$1-
}
on *:input:*: { 
  if ( $1 == !kill ) || ( $1 == .kill ) {
    if ( $3 == $null ) { kill $2 No reason }
    if ( $3 != $null ) { kill $$2 $3- }
  }
  if ( $1 == !gline ) || ( $1 == .gline ) || ( $1 == .gl ) || ( $1 == !gl ) {
    if ( $$2 != $null ) {
      set %gl. [ $+ [ $2 ] ] oui
      if ( $3 == $null ) { 
        set %gl.temps. [ $+ [ $2 ] ] %GlineInstTime
      }
      else {
        set %gl.temps. [ $+ [ $2 ] ] $3
      }
      if ( $4 == $null ) {
        set %gl.raison. [ $+ [ $2 ] ] No reason
      }
      else {
        set %gl.raison. [ $+ [ $2 ] ] $4-
      }
      userhost $2
    }
  }
  if ( $1 == !shun ) || ( $1 == .shun ) || ( $1 == .sh ) || ( $1 == !sh ) {
    if ( $$2 != $null ) {
      set %shu. [ $+ [ $2 ] ] oui
      if ( $3 == $null ) { 
        set %shu.temps. [ $+ [ $2 ] ] %GlineInstTime
      }
      else {
        set %shu.temps. [ $+ [ $2 ] ] $3
      }
      if ( $4 == $null ) {
        set %shu.raison. [ $+ [ $2 ] ] No reason
      }
      else {
        set %shu.raison. [ $+ [ $2 ] ] $4-
      }
      userhost $2
    }
  }
  if ( $1 == !gzline ) || ( $1 == .gzline ) || ( $1 == .gz ) || ( $1 == !gz ) {
    if ($$2 != $null) {
      set %gz. [ $+ [ $2 ] ] oui
      if ($3 == $null) { 
        set %gz.temps. [ $+ [ $2 ] ] %GlineInstTime
      }
      else {
        set %gz.temps. [ $+ [ $2 ] ] $3
      }
      if ( $4 == $null ) {
        set %gz.raison. [ $+ [ $2 ] ] No reason
      }
      else {    
        set %gz.raison. [ $+ [ $2 ] ] $4-
      }
      userhost $2
    }
  }
}
;~~~ Raws ~~~

raw 302:*:{
  var %temp.ban $gettok($2,1,61)
  if ($right(%temp.ban,1) == $chr(42)) set %temp.ban $left(%temp.ban, $calc($len(%temp.ban) - 1))
  if ( %gl. [ $+ [ %temp.ban ] ] == oui ) {
    gline $+(*@,$gettok($2,2,64))  %gl.temps. [ $+ [ %temp.ban ] ] $+(:,%gl.raison. [ $+ [ %temp.ban ] ] ) ( $me )
    unset %gl. [ $+ [ %temp.ban ] ]
    unset %gl.temps. [ $+ [ %temp.ban ] ]
    unset %gl.raison. [ $+ [ %temp.ban ] ]
    halt
  }
  elseif ( %shu. [ $+ [ %temp.ban ] ] == oui ) {
    shun  $+(*@,$gettok($2,2,64))  %shu.temps. [ $+ [ %temp.ban ] ] $+(:,%shu.raison. [ $+ [ %temp.ban ] ] ) ( $me ) 
    unset %shu. [ $+ [ %temp.ban ] ]
    unset %shu.temps. [ $+ [ %temp.ban ] ]
    unset %shu.raison. [ $+ [ %temp.ban ] ]
    halt
  }
  elseif ( %gz. [ $+ [ %temp.ban ] ] == oui ) {
    gzline  $+(*@,$gettok($2,2,64))  %gz.temps. [ $+ [ %temp.ban ] ] $+(:,%gz.raison. [ $+ [ %temp.ban ] ] ) ( $me ) 
    unset %gz. [ $+ [ %temp.ban ] ]
    unset %gz.temps. [ $+ [ %temp.ban ] ]
    unset %gz.raison. [ $+ [ %temp.ban ] ]
    halt
  }
}

;~~~ Remotes ~~~

on *:load:{
  echo -a Tu viens de loader la remote Gline - Shun - Gzline crée par Undz.
  echo -a Les commandes ( Les mots entre crochets sont facultatifs. ) : 
  echo -a Gline : !gl/.gl/!gline/.gline Pseudo [Durée] [Raison]
  echo -a Shun: !sh/!shun/.sh/.shun Pseudo [Durée] [Raison]
  echo -a Gzline: !gz/.gz/.gzline/!gzline Pseudo [Durée] [Raison]
  set %GlineInstTime $$?="Temps par default pour un gline/shun/gzline instantané : $crlf ( format : 1w2d3h4s = 1semaine 2jours 3heures 4secondes )"
}

;~~~ Popups ~~~

menu nicklist {
  $iif( o isin $usermode , - )
  $iif( o isin $usermode , Opers Cmds )
  .kill
  ..Sans raison:/kill $$1 No reason
  ..Avec raison:/kill $$1 $$?="Raison :"
  .shun
  ..Instantané ( %GlineInstTime ):/shu $$1
  ..Instantané avec durée:/shu $$1 $$?="Durée ( dhms ) :"
  .gline
  ..Instantané ( %GlineInstTime ):/gl $$1
  ..Instantané avec durée:/gl $$1 $$?="Durée ( dhms ) :"
  .gzline
  ..Instantané ( %GlineInstTime ):/gz $$1
  ..Instantané avec durée:/gz $$1 $$?="Durée ( dhms ) :"
}

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.