Queue bot

Contenu du snippet

Salut et bien voila vu que je n'ai jamais vu de source pour 1 Queue Bot
j'en profite pour la poster, je precise que cet source ne viens pas de moi je suis incapable de faire 1 autovoice... elle es vraiment cool mais j'ai 1 prob avec...
j'espere que cet source pourras peut-etre donner 1 exemple pour 1 autre

Source / Exemple :


;HelpServ

;Instructions
;To use the helpserv bot, you must first config the bot. To do this type /helpbot.config
;After the config is all setup, hit the start button to turn on the helpserv.
;Once the helpserv is turned on, and in the channel you want to use it in, type /helpbot.help #channel
;After that the helpserv should be activated, and to use the helpserv you, and the helpserv must be op.
;Then you type /msg <Bots Nick> next to get the next person in line.
;If you want to turn the bot off, type /helpbot.unhelp #channel
;To totally turn off the bot type /helpbot.stop #channel

alias helpbot  return $hget(helpbot, nick)

alias -l helpbot.chan return $hget(helpbot.helping, chan)

alias helpbot.config dialog -m helpbot helpbot

alias -l helpbot.error echo $color(Info text) -a * $$1 $+ : $$2-

alias helpbot.help {
  if (!$1) {
    helpbot.error /helpbot.help insufficient paramters (usage: /helpbot.help <channel>)
    return
  }
  elseif (!$helpbot.ison($1, $helpbot)) {
    helpbot.error /helpbot.help $iif(($helpbot), $helpbot, helpbot) is not on $1
    return
  }
  elseif ($hget(helpbot.helping)) {
    if ($2 == CONFIRM) {
      helpbot.msg $helpbot.chan  $+ $helpbot is no longer operational in $helpbot.chan $+ . (moved to $1 by $me $+ )
      hdel -w helpbot.helping *
    }
    else {
      helpbot.error /helpbot.help $helpbot is currently operational in $helpbot.chan (use /helpbot.help <channel> CONFIRM to continue anyway)
      return
    }
  }
  hmake helpbot.helping 50
  hadd helpbot.helping chan $gettok($hget(helpbot. $+ $1), 2, 46)
  hadd helpbot.helping settings.autocreate $helpbot.ini(settings, autocreate)
  hadd helpbot.helping settings.autovoice $helpbot.ini(settings, autovoice)
  hadd helpbot.helping settings.greeting $helpbot.ini(settings, greeting)
  hadd helpbot.helping settings.onotice $helpbot.ini(settings, onotice)
  hadd helpbot.helping reqid 1
  hadd helpbot.helping nextreqid 1
  if (!$helpbot.isop($1, $helpbot)) { helpbot.error /helpbot.help warning: $helpbot is not an op in $helpbot.chan }
  helpbot.msg $1  $+ $helpbot is now operational in $helpbot.chan $+ . If you need help, you can /msg $helpbot with a brief description of your problem.
}

alias -l helpbot.in.cmode {
  ;nick address channel modestring
  var %helpbot.in.mode.i = 1, %helpbot.in.mode.param = 4, %helpbot.in.mode.nick
  while ($mid($4, %helpbot.in.mode.i, 1)) {
    if (($mid($4, %helpbot.in.mode.i, 1) == +) || ($mid($4, %helpbot.in.mode.i, 1) == -)) {
      var %helpbot.in.mode = $mid($4, %helpbot.in.mode.i, 1)
    }
    elseif ($mid($4, %helpbot.in.mode.i, 1) == b) {
      inc %helpbot.in.mode.param
    }
    elseif ($mid($4, %helpbot.in.mode.i, l) == h) {
      inc %helpbot.in.mode.param
      var %helpbot.in.mode.nick = $ [ $+ [ %helpbot.in.mode.param ] ]
      if (%helpbot.in.mode == +) { helpbot.in.hop $1-3 %helpbot.in.mode.nick }
      elseif (%helpbot.in.mode == -) { helpbot.in.dehop $1-3 %helpbot.in.mode.nick }
      hadd helpbot. $+ $3 nick. $+ %helpbot.in.mode.nick $iif((%helpbot.in.mode == +), $+($iif($helpbot.isop($3, %helpbot.in.mode.nick), @), %, $iif($helpbot.isvoice($3, %helpbot.in.mode.nick), +), %helpbot.in.mode.nick), $+($iif($helpbot.isop($3, %helpbot.in.mode.nick), @), $iif($helpbot.isvoice($3, %helpbot.in.mode.nick), +), %helpbot.in.mode.nick))
    }
    elseif ($mid($4, %helpbot.in.mode.i, 1) == l) {
      ;+l only has a parameter when being set
      if (%helpbot.in.mode == +) {
        inc %helpbot.in.mode.param
        if (l !isin $hget(helpbot. $+ $3, modes)) { hadd helpbot. $+ $3 modes $hget(helpbot. $+ $3, modes) $+ l }
        hadd helpbot. $+ $3 modes.limit $ [ $+ [ %helpbot.in.mode.param ] ]
      }
      elseif (%helpbot.in.mode == -) {
        if (l isin $hget(helpbot. $+ $3, modes)) { hadd helpbot. $+ $3 modes $removecs($hget(helpbot. $+ $3, modes), l) }
        hdel helpbot. $+ $3 modes.limit
      }
    }
    elseif ($mid($4, %helpbot.in.mode.i, 1) == k) {
      ;+k has a paramter both when set and unset
      inc %helpbot.in.mode.param
      if (%helpbot.in.mode == +) {
        if (k !isin $hget(helpbot. $+ $3, modes)) { hadd helpbot. $+ $3 modes $hget(helpbot. $+ $3, modes) $+ k }
        hadd helpbot. $+ $3 modes.key $ [ $+ [ %helpbot.in.mode.param ] ]
      }
      elseif (%helpbot.in.mode == -) {
        if (k isin $hget(helpbot. $+ $3, modes)) { hadd helpbot. $+ $3 modes $removecs($hget(helpbot. $+ $3, modes), k) }
        hdel helpbot. $+ $3 modes.key
      }
    }
    elseif ($mid($4, %helpbot.in.mode.i, 1) == o) {
      inc %helpbot.in.mode.param
      var %helpbot.in.mode.nick = $ [ $+ [ %helpbot.in.mode.param ] ]
      if (%helpbot.in.mode == +) { helpbot.in.op $1-3 %helpbot.in.mode.nick }
      elseif (%helpbot.in.mode == -) { helpbot.in.deop $1-3 %helpbot.in.mode.nick }
      hadd helpbot. $+ $3 nick. $+ %helpbot.in.mode.nick $iif((%helpbot.in.mode == +), $+(@, $iif($helpbot.ishop($3, %helpbot.in.mode.nick), %), $iif($helpbot.isvoice($3, %helpbot.in.mode.nick), +), %helpbot.in.mode.nick), $+($iif($helpbot.ishop($3, %helpbot.in.mode.nick), %), $iif($helpbot.isvoice($3, %helpbot.in.mode.nick), +), %helpbot.in.mode.nick))
    }
    elseif ($mid($4, %helpbot.in.mode.i, 1) == v) {
      inc %helpbot.in.mode.param
      var %helpbot.in.mode.nick = $ [ $+ [ %helpbot.in.mode.param ] ]
      if (%helpbot.in.mode == +) { helpbot.in.voice $1-3 %helpbot.in.mode.nick }
      elseif (%helpbot.in.mode == -) { helpbot.in.devoice $1-3 %helpbot.in.mode.nick }
      hadd helpbot. $+ $3 nick. $+ %helpbot.in.mode.nick $iif((%helpbot.in.mode == +), $+($iif($helpbot.isop($3, %helpbot.in.mode.nick), @), $iif($helpbot.ishop($3, %helpbot.in.mode.nick), %), +, %helpbot.in.mode.nick), $+($iif($helpbot.isop($3, %helpbot.in.mode.nick), @), $iif($helpbot.ishop($3, %helpbot.in.mode.nick), %), %helpbot.in.mode.nick))
    }
    else {
      ;Anything here must be a channel mode that takes no parameter
      var %helpbot.in.mode.mode = $mid($4, %helpbot.in.mode.i, 1)
      if (%helpbot.in.mode == +) {
        if (%helpbot.in.mode.mode !isin $hget(helpbot. $+ $3, modes)) { hadd helpbot. $+ $3 modes $hget(helpbot. $+ $3, modes) $+ %helpbot.in.mode.mode }
      }
      elseif (%helpbot.in.mode == -) {
        if (%helpbot.in.mode.mode isin $hget(helpbot. $+ $3, modes)) { hadd helpbot. $+ $3 modes $removecs($hget(helpbot. $+ $3, modes), %helpbot.in.mode.mode) }
      }
    }
    inc %helpbot.in.mode.i
  }
}

alias -l helpbot.in.dehop {
  ;nick address channel hopnick
}

alias -l helpbot.in.deop {
  ;nick address channel opnick
}

alias -l helpbot.in.devoice {
  ;nick address channel vnick
}

alias -l helpot.in.hop {
  ;nick address channel hopnick
}

alias -l helpbot.in.join {
  ;nick address channel
  if ($1 == $helpbot)  {
    helpbot.out MODE $3
    hadd helpbot chans $hget(helpbot, chans) $3
    hmake helpbot. $+ $3 50
  }
  elseif ($hget(helpbot. $+ $3)) {
    hadd helpbot. $+ $3 nick. $+ $1 $1
    hinc helpbot. $+ $3 users
  }
  if (($3 == $helpbot.chan) && ($hget(helpbot.helping, settings.autocreate))) {
    var %helpbot.reqid = $hget(helpbot.helping, reqid)
    hadd helpbot.helping nickid. $+ $1 %helpbot.reqid
    hadd helpbot.helping %helpbot.reqid $+ .nick $1
    hadd helpbot.helping %helpbot.reqid $+ .opened $ctime
    hadd helpbot.helping %helpbot.reqid $+ .message (none)
    .timerhelpbot.greet. $+ $1 1 3 helpbot.notice $1 $hget(helpbot.helping, settings.greeting) (You have been assigned Request ID# $+ %helpbot.reqid $+ )
    .timerhelpbot.joincreate. $+ $1 1 3 helpbot.onotice $helpbot.chan New $helpbot request (ID# $+ %helpbot.reqid $+ ) received from $1 $+ .
    hinc helpbot.helping reqid
  }
  elseif (($3 == $helpbot.chan) && ($hget(helpbot.helping, settings.greeting))) {
    .timerhelpbot.greet. $+ $1 1 3 helpbot.notice $1 $hget(helpbot.helping, settings.greeting)
  }
}

alias -l helpbot.in.jtopic {
  ;channel topic
  if ($hget(helpbot. $+ $1)) { hadd helpbot. $+ $1 topic $2- }
}

alias -l helpbot.in.jtopicsetter {
  ;channel topic-setter (time)
  if ($hget(helpbot. $+ $1)) {
    hadd helpbot. $+ $1 topic.setter $2
    if ($3) { hadd helpbot. $+ $1 topic.set $3 }
  }
}

alias -l helpbot.in.kick {
  ;nick address channel knick reason
  if ($4 == $helpbot) {
    hfree helpbot. $+ $3
  }
  elseif ($hget(helpbot. $+ $3)) {
    hdel helpbot. $+ $3 nick. $+ $3
    hdec helpbot. $+ $3 users
  }
}

alias -l helpbot.in.modes {
  ;channel modestring
  if (!$hget(helpbot. $+ $1)) {
    return
  }
  hadd helpbot. $+ $1 modes $2
  var %helpbot.in.modes, %helpbot.in.modes.i = 1, %helpbot.in.modes.param = 2
  while $mid($2, %helpbot.in.modes.i, 1) {
    if (($mid($2, %helpbot.in.modes.i, 1) == +) || ($mid($2, %helpbot.in.modes.i, 1) == -)) {
      var %helpbot.in.modes = $mid($2, %helpbot.in.modes.i, 1)
    }
    elseif ($mid($2, %helpbot.in.modes.i, 1) == l) {
      if (%helpbot.in.modes == +) {
        inc %helpbot.in.modes.param
        hadd helpbot. $+ $1 modes.limit $ [ $+ [ %helpbot.in.modes.param ] ]
      }
      elseif (%helpbot.in.modes == -) {
        hdel helpbot. $+ $1 modes.limit
      }
    }
    elseif ($mid($2, %helpbot.in.modes.i, 1) == k) {
      inc %helpbot.in.modes.param
      if (%helpbot.in.modes == +) {
        hadd helpbot. $+ $1 modes.key $ [ $+ [ %helpbot.in.modes.param ] ]
      }
      elseif (%helpbot.in.mode == -) {
        hdel helpbot. $+ $1 modes.key
      }
    }
    inc %helpbot.in.modes.i
  }
}

alias -l helpbot.in.names {
  ;channel names
  var %helpbot.in.names.chan = $1
  if ($hget(helpbot. $+ $1)) {
    while ($2) {
      tokenize 32 $2-
      if (!$helpbot.ison(%helpbot.in.names.chan, $remove($1, @, +))) {
        hadd helpbot. $+ %helpbot.in.names.chan nick. $+ $remove($1, @, +) $1
        hinc helpbot. $+ %helpbot.in.names.chan users
      }
    }
  }
}

alias -l helpbot.in.nick {
  ;nick address newnick
  if ($helpbot == $1) {
    hadd helpbot nick $3
  }
  elseif ($hget(helpbot.helping, nickid. $+ $1)) {
    var %helpbot.reqid = $hget(helpbot.helping, nickid. $+ $1)
    if ($hget(helpbot.helping, %helpbot.reqid $+ .helper)) {
      helpbot.notice $hget(helpbot.helping, %helpbot.reqid $+ .helper) $1 (Request ID# $+ %helpbot.reqid $+ ) just changed their nick to $3 $+ .
    }
    hadd helpbot.helping %helpbot.reqid $+ .nick $3
    hadd helpbot.helping nickid. $+ $3 %helpbot.reqid
    hdel helpbot.helping nickid. $+ $1
  }
  elseif ($hget(helpbot.helping, helper. $+ $1)) {
    var %helpbot.in.nick.helped = $hget(helpbot.helping, helper. $+ $1)
    var %helpbot.i = 1
    while ($gettok(%helpbot.in.nick.helped, %helpbot.i, 32)) {
      var %helpbot.reqid = $gettok(%helpbot.in.nick.helped, %helpbot.i, 32)
      hadd helpbot.helping %helpbot.reqid $+ .helper $3
      inc %helpbot.i
    }
    hadd helpbot.helping helper. $+ $3 %helpbot.in.nick.helped
    hdel helpbot.helping helper. $+ $1
  }
  var %helpbot.in.nick.oldnick = $1
  var %helpbot.in.nick.newnick = $3
  tokenize 32 $hget(helpbot, chans)
  while ($1) {
    if ($helpbot.ison($1, %helpbot.in.nick.oldnick)) {
      hadd helpbot. $+ $1 nick. $+ %helpbot.in.nick.newnick $replace($hget(helpbot. $+ $1, nick. $+ %helpbot.in.nick.oldnick), %helpbot.in.nick.oldnick, %helpbot.in.nick.newnick)
      hdel helpbot. $+ $1 nick. $+ %helpbot.in.nick.oldnick
    }
    tokenize 32 $2-
  }
}

alias -l helpbot.in.notice {
  ;nick address target message
}

alias -l helpbot.in.op {
  ;nick address channel opnick
  if ($timer(helpbot.greet. $+ $1)) { timerhelpbot.greet. $+ $1 off }
  if ($timer(helpbot.joincreate. $+ $1)) { timerhelpbot.joincreate. $+ $1 off }
  if (($3 == $helpbot.chan) && ($hget(helpbot.helping, nickid. $+ $1))) {
    hdel helpbot.helping $hget(helpbot.helping, nickid. $+ $1) $+ .*
    hdel helpbot.helping nickid. $+ $1
  }
}

alias -l helpbot.in.part {
  ;nick address channel (message)
  if ($helpbot == $1) {
    hfree helpbot. $+ $3
    hadd helpbot chans $remtok($hget(helpbot, chans), $3, 1, 32)
  }
  elseif ($helpbot.ison($3, $1)) {
    if ($hget(helpbot.helping, nickid. $+ $1)) {
      var %helpbot.in.part.helper = $hget(helpbot.helping, $hget(helpbot.helping, nickid. $+ $1) $+ .helper)
      if $helpbot.ison($3, %helpbot.in.part.helper) {
        helpbot.notice %helpbot.in.part.helper Request ID# $+ $hget(helpbot.helping, nickid. $+ $1) from $1 has been closed because they left the help channel.
      }
      if ($hget(helpbot.helping, helper. $+ %helpbot.in.part.helper)) {
        hadd helpbot.helping helper. $+ %helpbot.in.part.helper $remtok($hget(helpbot.helping, helper. $+ %helpbot.in.part.helper), $hget(helpbot.helping, nickid. $+ $1), 1, 32)
      }
      if ($hget(helpbot.helping, nextreqid) == $hget(helpbot.helping, nickid. $+ $1)) {
        while ($hget(helpbot.helping, nextreqid) < $hget(helpbot.helping, reqid)) {
          hinc helpbot.helping nextreqid
          if (($hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .nick)) && (!$hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .helper))) { break }
        }
      }
      helpbot.onotice $helpbot.chan Request ID# $+ $hget(helpbot.helping, nickid. $+ $1) from $1 has been closed because they left the help channel.
      hdel -w helpbot.helping $hget(helpbot.helping, nickid. $+ $1) $+ .*
      hdel helpbot.helping nickid. $+ $1
    }
    elseif ($hget(helpbot.helping, helper. $+ $1)) {
      var %helpbot.in.part.helped = $hget(helpbot.helping, helper. $+ $1)
      hadd helpbot.helping nextreqid $calc($gettok(%helpbot.in.part.helped, 1, 32) - 1)
      while ($gettok(%helpbot.in.part.helped, 1, 32)) {
        helpbot.notice $hget(helpbot.helping, $gettok(%helpbot.in.part.helped, 1, 32) $+ .nick) Your helper, $1 $+ , has left the help channel. Please wait while a new helper is assigned to you.
        helpbot.onotice $helpbot.chan Request ID# $+ $gettok(%helpbot.in.part.helped, 1, 32) has been unassigned, because its helper, $1 $+ , has parted the help channel.
        hdel helpbot.helping $gettok(%helpbot.in.part.helped, 1, 32) $+ .helper
        hadd helpbot.helping $gettok(%helpbot.in.part.helped, 1, 32) $+ .message $hget(helpbot.helping, $gettok(%helpbot.in.part.helped, 1, 32) $+ .message) (Unassigned by $1 $+ )
        var %helpbot.in.part.helped = $gettok(%helpbot.in.part.helped, 2-, 32)
      }
      while ($hget(helpbot.helping, nextreqid) < $hget(helpbot.helping, reqid)) {
        hinc helpbot.helping nextreqid
        if (($hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .nick)) && (!$hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .helper))) { break }
      }
      hdel helpbot.helping helper. $+ $1
    }
    hdel -w helpbot. $+ $3 nick. $+ $1
    hdec helpbot. $+ $3 users
  }
}

alias -l helpbot.in.quit {
  ;nick address (message)
  if ($hget(helpbot.helping, nickid. $+ $1)) {
    var %helpbot.in.part.helper = $hget(helpbot.helping, $hget(helpbot.helping, nickid. $+ $1) $+ .helper)
    if $helpbot.ison($helpbot.chan, %helpbot.in.part.helper) {
      helpbot.notice %helpbot.in.part.helper Request ID# $+ $hget(helpbot.helping, nickid. $+ $1) from $1 has been closed because they left the help channel.
    }
    if ($hget(helpbot.helping, helper. $+ %helpbot.in.part.helper)) {
      hadd helpbot.helping helper. $+ %helpbot.in.part.helper $remtok($hget(helpbot.helping, helper. $+ %helpbot.in.part.helper), $hget(helpbot.helping, nickid. $+ $1), 1, 32)
    }
    if ($hget(helpbot.helping, nextreqid) == $hget(helpbot.helping, nickid. $+ $1)) {
      while ($hget(helpbot.helping, nextreqid) < $hget(helpbot.helping, reqid)) {
        hinc helpbot.helping nextreqid
        if (($hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .nick)) && (!$hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .helper))) { break }
      }
    }
    helpbot.onotice $helpbot.chan Request ID# $+ $hget(helpbot.helping, nickid. $+ $1) from $1 has been closed because they left the help channel.
    hdel -w helpbot.helping $hget(helpbot.helping, nickid. $+ $1) $+ .*
    hdel helpbot.helping nickid. $+ $1
  }
  elseif ($hget(helpbot.helping, helper. $+ $1)) {
    var %helpbot.in.part.helped = $hget(helpbot.helping, helper. $+ $1)
    hadd helpbot.helping nextreqid $calc($gettok(%helpbot.in.part.helped, 1, 32) - 1)
    while ($gettok(%helpbot.in.part.helped, 1, 32)) {
      helpbot.notice $hget(helpbot.helping, $gettok(%helpbot.in.part.helped, 1, 32) $+ .nick) Your helper, $1 $+ , has left the help channel. Please wait while a new helper is assigned to you.
      helpbot.onotice $helpbot.chan Request ID# $+ $gettok(%helpbot.in.part.helped, 1, 32) has been unassigned, because its helper, $1 $+ , has parted the help channel.
      hdel helpbot.helping $gettok(%helpbot.in.part.helped, 1, 32) $+ .helper
      hadd helpbot.helping $gettok(%helpbot.in.part.helped, 1, 32) $+ .message $hget(helpbot.helping, $gettok(%helpbot.in.part.helped, 1, 32) $+ .message) (Unassigned by $1 $+ )
      var %helpbot.in.part.helped = $gettok(%helpbot.in.part.helped, 2-, 32)
    }
    while ($hget(helpbot.helping, nextreqid) < $hget(helpbot.helping, reqid)) {
      hinc helpbot.helping nextreqid
      if (($hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .nick)) && (!$hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .helper))) { break }
    }
    hdel helpbot.helping helper. $+ $1
  }
  if ($helpbot == $1) {
    hfree -w helpbot*
  }
  else {
    var %helpbot.in.quit.nick = $1
    tokenize 32 $hget(helpbot, chans)
    while ($1) {
      if ($helpbot.ison($1, %helpbot.in.quit.nick)) {
        hdel -w helpbot. $+ $1 nick. $+ %helpbot.in.quit.nick
        hdec helpbot. $+ $1 users
      }
      tokenize 32 $2-
    }
  }
}

alias -l helpbot.in.text {
  ;nick address target text
  if (($1 == $me) && ($4 == .raw) && ($5-)) {
    helpbot.out $5-
  }
  elseif ($3 == $helpbot) {
    if ($helpbot.isreg($helpbot.chan, $1)) {
      if ($hget(helpbot.helping, nickid. $+ $1)) {
        hadd helpbot.helping $hget(helpbot.helping, nickid. $+ $1)) $+ .message $4-
        helpbot.notice $1 Your updated request for help (request ID# $+ $hget(helpbot.helping, nickid. $+ $1) $+ ) has been received.
        var %helpbot.in.text.helper = $hget(helpbot.helping, $hget(helpbot.helping, nickid. $+ $1) $+ .helper)
        if (%helpbot.in.text.helper) {
          helpbot.notice %helpbot.in.text.helper The user for request ID# $+ $hget(helpbot.helping, nickid. $+ $1) $+ , $1 $+ , just updated their request: $hget(helpbot.helping, $hget(helpbot.helping, nickid. $+ $1) $+ .message)
        }
      }
      else {
        var %helpbot.reqid = $hget(helpbot.helping, reqid)
        hadd helpbot.helping nickid. $+ $1 %helpbot.reqid
        hadd helpbot.helping %helpbot.reqid $+ .nick $1
        hadd helpbot.helping %helpbot.reqid $+ .opened $ctime
        hadd helpbot.helping %helpbot.reqid $+ .message $4-
        helpbot.notice $1 Your request for help on $helpbot.chan has been received. You have been assigned request ID# $+ %helpbot.reqid $+ . Please wait for a helper to help you.
        helpbot.onotice $helpbot.chan New $helpbot request (ID# $+ %helpbot.reqid $+ ) received from $1 $+ .
        hinc helpbot.helping reqid
      }
    }
    elseif ($helpbot.isop($helpbot.chan, $1)) {
      if ($4- == NEXT) {
        if ($hget(helpbot.helping, reqid) == $hget(helpbot.helping, nextreqid)) {
          helpbot.notice $1 There are currently no unassigned requests.
        }
        elseif ($hget(helpbot.helping, reqid) > $hget(helpbot.helping, nextreqid)) {
          var %helpbot.reqid = $hget(helpbot.helping, nextreqid)
          while ($hget(helpbot.helping, nextreqid) < $hget(helpbot.helping, reqid)) {
            hinc helpbot.helping nextreqid
            if (($hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .nick)) && (!$hget(helpbot.helping, $hget(helpbot.helping, nextreqid) $+ .helper))) { break }
          }
          hadd helpbot.helping %helpbot.reqid $+ .helper $1
          hadd helpbot.helping helper. $+ $1 $sorttok($hget(helpbot.helping, helper. $+ $1) %helpbot.reqid, 32, n)
          helpbot.notice $1 You have been assigned request ID# $+ %helpbot.reqid / Nick: $hget(helpbot.helping, %helpbot.reqid $+ .nick) / Opened: $duration($calc($ctime - $hget(helpbot.helping, %helpbot.reqid $+ .opened))) ago / Message: $hget(helpbot.helping, %helpbot.reqid $+ .message)
          helpbot.notice $hget(helpbot.helping, %helpbot.reqid $+ .nick) $1 has been assigned as your helper. Please discuss your question with him. (Your wait time was: $duration($calc($ctime - $hget(helpbot.helping, %helpbot.reqid $+ .opened))) $+ )
          helpbot.onotice $helpbot.chan Request ID# $+ %helpbot.reqid ( $+ $hget(helpbot.helping, %helpbot.reqid $+ .nick) $+ ) has been assigned to $1 $+  :: problem is: $hget(helpbot.helping, %helpbot.reqid $+ .message)
          if (($hget(helpbot.helping, settings.autovoice) == 2) && (m isin $hget(helpbot. $+ $helpbot.chan, modes)) && ($helpbot.isreg($helpbot.chan, $hget(helpbot.helping nick. $+ %helpbot.reqid)))) {
            helpbot.out MODE $helpbot.chan +v $hget(helpbot.helping, %helpbot.reqid $+ .nick)
          }
          elseif (($hget(helpbot.helping, settings.autovoice) == 1) && ($helpbot.isreg($helpbot.chan, $hget(helpbot.helping nick. $+ %helpbot.reqid)))) {
            helpbot.out MODE $helpbot.chan +v $hget(helpbot.helping, %helpbot.reqid $+ .nick)
          }
        }
      }
      elseif (PICKUP * iswm $4-) {
        if (($int($5) != $5) || ($5 >= $hget(helpbot.helping, reqid)) || ($5 < 1)) {
          helpbot.notice $1 $5 is an invalid request ID.
        }
        elseif (!$hget(helpbot.helping, $5 $+ .nick)) {
          helpbot.notice $1 Request ID# $+ $5 has already been closed.
        }
        elseif ($hget(helpbot.helping, $5 $+ .helper)) {
          helpbot.notice $1 Request ID# $+ $5 ($hget(helpbot.helping, $5 $+ .nick)) already has a helper ( $+ $hget(helpbot.helping, $5 $+ .helper)) $+ ) assigned.
        }

      }
      elseif (CLOSE * iswm $4-) {
        if (($5 !isnum) || ($5 >= $hget(helpbot.helping, reqid)) || ($5 < 1)) {
          helpbot.notice $1 $5 is an invalid request ID.
        }
        elseif (!$hget(helpbot.helping, $5 $+ .nick)) {
          helpbot.notice $1 Request ID# $+ $5 has already been closed.
        }
        elseif ($1 != $hget(helpbot.helping, $5 $+ .helper)) {
          helpbot.notice $1 You are not $hget(helpbot.helping, $5 $+ .nick) $+ 's helper. (If you have sufficient access, you can instead use /msg $helpbot DESTROY <request ID>)
        }
        else {
          helpbot.notice $hget(helpbot.helping, $5 $+ .nick) Your $helpbot request ID# $+ $5 has been closed by $1 $+ .
          helpbot.notice $1 You have closed request ID# $+ $5 ( $+ $hget(helpbot.helping, $5 $+ .nick) $+ ).
          helpbot.onotice $helpbot.chan Request ID# $+ $5 ( $+ $hget(helpbot.helping, $5 $+ .nick) $+ ) has been closed by $1 $+ .
          hadd helpbot.helping helper. $+ $1 $remtok($hget(helpbot.helping, helper. $+ $1), $5, 1, 32)
          hdel helpbot.helping nickid. $+ $hget(helpbot.helping, $5 $+ .nick)
          hdel -w helpbot.helping $5 $+ .*
        }
      }
      else {
        helpbot.notice $1 The following commands are available for $helpbot.chan ops: $chr(160) CLOSE $chr(160) NEXT $chr(160) PICKUP
      }
    }
  }
}

alias -l helpbot.in.topic {
  ;nick address channel (topic)
  if ($hget(helpbot. $+ $3)) {
    if (!$4) {
      hdel -w helpbot. $+ $3 topic*
      return
    }
    hadd helpbot. $+ $3 topic $4-
    hadd helpbot. $+ $3 topic.setter $1
    hadd helpbot. $+ $3 topic.set $ctime
  }
}

alias -l helpbot.in.umode {
  ;nick address nick modestring
}

alias -l helpbot.in.voice {
  ;nick address channel vnick
  if $timer(helpbot.greet. $+ $1) { timerhelpbot.greet. $+ $1 off }
}

alias -l helpbot.ini {
  if (!$isid) {
    if ($3) { writeini -n $+(", $scriptdir, helpbot.ini, ") $1- }
    elseif ($2) { remini $+(", $scriptdir, helpbot.ini, ") $1- }
  }
  else {
    return $readini($+(", $scriptdir, helpbot.ini, "), n, $1, $2)
  }
}

alias -l helpbot.ishop {
  if (% isin $hget(helpbot. $+ $1, nick. $+ $2)) {
    return $true
  }
  else {
    return $false
  }
}

alias -l helpbot.ison {
  if ($hget(helpbot. $+ $1, nick. $+ $2)) {
    return $true
  }
  else {
    return $false
  }
}

alias -l helpbot.isop {
  if (@ isin $hget(helpbot. $+ $1, nick. $+ $2)) {
    return $true
  }
  else {
    return $false
  }
}

alias -l helpbot.isreg {
  if ($hget(helpbot. $+ $1, nick. $+ $2) == $2) {
    return $true
  }
  else {
    return $false
  }
}

alias -l helpbot.isvoice {
  if (+ isin $hget(helpbot. $+ $1, nick. $+ $2)) {
    return $true
  }
  else {
    return $false
  }
}

alias helpbot.join {
  if (!$hget(helpbot)) {
    helpbot.error /helpbot.join helpbot not started (use /helpbot.start)
  }
  elseif (#* !iswm $1) {
    helpbot.error /helpot.join please specify a valid channel (usage: /helpbot.join <channel>)
  }
  else {
    helpbot.out JOIN $1
  }
}

alias -l helpbot.msg {
  helpbot.out PRIVMSG $1 : $+ $2-
}

alias -l helpbot.nickhost {
  ;convert :nick!user@host into nick user@host
  return $remove($gettok($1, 1, 33), :) $gettok($1, 2-, 33)
}

alias -l helpbot.notice {
  helpbot.out NOTICE $1 : $+ $2-
}

alias -l helpbot.onotice {
  if ($helpbot.ison($1, $helpbot)) && ($hget(helpbot.helping, settings.onotice)) {
    helpbot.notice @ $+ $1-
  }
}

alias -l helpbot.out {
  if (!$sock(helpbot)) {
    helpbot.error /helpbot.out helpbot socket does not exist
    return
  }
  if (!$window(@helpbot)) { window -ek0 @helpbot }
  echo 12 @helpbot OUT $1-
  sockwrite -n helpbot $1-
}

alias helpbot.part {
  if ($helpbot.ison($1, $helpbot)) {
    helpbot.out PART $1 : $+ $helpbot removed from $1 by $me at $ctime
  }
}

alias -l helpbot.perform {
  helpbot.out MODE $helpbot +ix
  if ($hget(helpbot, authserv.account)) {
    helpbot.out AUTHSERV AUTH $hget(helpbot, authserv.account) $hget(helpbot, authserv.pass)
  }
  if ($hget(helpbot, autojoin)) {
    helpbot.out JOIN $hget(helpbot, autojoin)
  }
}

alias helpbot.start {
  if ($sock(helpbot)) {
    helpbot.error /helpbot.start already started
    return
  }
  if ($hget(helpbot)) { hfree helpbot }
  hmake helpbot 50
  hadd helpbot nick $helpbot.ini(basics, nick)
  hadd helpbot address $helpbot.ini(basics, server)
  hadd helpbot port 6667
  if ($helpbot.ini(basics, account)) {
    hadd helpbot authserv.account $helpbot.ini(basics, account)
    hadd helpbot authserv.pass $decode($helpbot.ini(basics, pass), m)
  }
  hadd helpbot autojoin $helpbot.ini(channels, join)
  if ($portfree(113)) { socklisten helpbot.identd 113 }
  sockopen helpbot $hget(helpbot, address) $hget(helpbot, port)
}

alias helpbot.stop {
  if (($hget(helpbot.helping)) && ($1 == CONFIRM)) {
    helpbot.out QUIT : $+ $helpbot stopped by $me at $ctime whilst operational in $helpbot.chan
    hfree -w helpbot*
  }
  elseif ($hget(helpbot.helping)) {
    helpbot.error /helbot.stop $helpbot is currently operational in $helpbot.chan (use /helpbot.stop CONFIRM to continue anyway)
  }
  elseif ($hget(helpbot)) {
    helpbot.out QUIT : $+ $helpbot stopped by $me at $ctime
  }
}

alias -l helpbot.strip return $iif(($left($1, 1) == :), $right($1-, -1), $1-)

alias helpbot.unhelp {
  if (!$hget(helpbot.helping)) {
    helpbot.error /helpbot.unhelp $iif(($helpbot), $helpbot, helpbot) is not currently helping in any channels
  }
  else {
    helpbot.msg $helpbot.chan  $+ $helpbot is no longer operational in $helpbot.chan $+ . (stopped by $me $+ )
    hfree helpbot.helping
  }
}

dialog helpbot {
  title "HelpBot Setup"
  size -1 -1 160 118
  option dbu
  tab "&Basics", 1, 5 4 148 93
  box "Connect", 10, 10 21 140 40, tab 1
  box "AuthServ", 11, 10 57 140 37, tab 1
  text "S&erver:", 12, 15 32 25 8, tab 1 right
  edit "", 13, 45 31 100 10, tab 1
  text "&Nick:", 14, 15 45 25 8, tab 1 right
  edit "", 15, 45 44 100 10, tab 1
  text "&Account:", 16, 15 67 25 8, tab 1 right
  edit "", 17, 45 66 100 10, tab 1
  text "&Password:", 18, 15 80 25 8, tab 1 right
  edit "", 19, 45 79 100 10, tab 1 pass
  tab "&Channels", 2
  box "Auto-Join", 20, 10 21 140 73, tab 2
  text "Enter in the list to the right the channels to autmoatically join on connect. In practice, this will just be the channel you want HelpBot to help in, although the option remains to have it passively join other channels.", 21, 15 34 70 54, tab 2
  combo 22, 90 33 55 40, tab 2 size
  button "Add", 23, 90 76 25 12, tab 2
  button "Del", 24, 120 76 25 12, tab 2
  tab "Se&ttings", 3
  box "HelpBot Usage Settings", 30, 10 21 140 73, tab 3
  text "Greeting:", 31, 15 33 23 8, tab 3
  edit "", 32, 43 32 102 10, tab 3 autohs
  check "Auto-voice on pickup?", 33, 15 47 65 10, tab 3
  check "Only if channel is +m", 34, 20 57 60 10, tab 3
  check "Create requests for all joiners", 35, 15 72 85 10, tab 3
  check "/onotice request creation/deletion", 36, 15 82 95 10, tab 3
  button "&Save Settings", 7, 60 102 50 12, ok
  button "Cance&l", 8, 115 102 39 12, cancel
  button "Start &HelpBot", 9, 5 102 50 12
}

on *:dialog:helpbot:edit:22: did -t helpbot 23

on *:dialog:helpbot:init:0: {
  if ($sock(helpbot)) { did -a helpbot 9 Stop &HelpBot }
  did -a helpbot 13 $helpbot.ini(basics, server)
  did -a helpbot 15 $helpbot.ini(basics, nick)
  did -a helpbot 17 $helpbot.ini(basics, account)
  did -a helpbot 19 $decode($helpbot.ini(basics, pass), m)
  var %dialog.helpbot.out = $sorttok($helpbot.ini(channels, join), 44), %dialog.helpbot.i = 1
  while ($gettok(%dialog.helpbot.out, %dialog.helpbot.i, 44)) {
    did -a helpbot 22 $gettok(%dialog.helpbot.out, %dialog.helpbot.i, 44)
    inc %dialog.helpbot.i
  }
  did -a helpbot 32 $helpbot.ini(settings, greeting)
  if ($helpbot.ini(settings, autovoice) >= 1) { did -c helpbot 33 }
  if ($helpbot.ini(settings, autovoice) >= 2) { did -c helpbot 34 }
  elseif ($helpbot.ini(settings, autovoice) < 1) { did -b helpbot 34 }
  if ($helpbot.ini(settings, autocreate)) { did -c helpbot 35 }
  if ($helpbot.ini(settings, onotice)) { did -c helpbot 36 }
}

on *:dialog:helpbot:sclick:1,3: did -t helpbot 7

on *:dialog:helpbot:sclick:7: {
  helpbot.ini basics server $did(helpbot, 13)
  helpbot.ini basics nick $did(helpbot, 15)
  helpbot.ini basics account $did(helpbot, 17)
  helpbot.ini basics pass $encode($did(helpbot, 19), m)
  helpbot.ini settings greeting $did(helpbot, 32)
  helpbot.ini settings autovoice $iif(($did(helpbot, 33).state == 1), $iif(($did(helpbot, 34).state == 1), 2, 1))
  helpbot.ini settings autocreate $did(helpbot, 35).state
  helpbot.ini settings onotice $did(helpbot, 36).state
}

on *:dialog:helpbot:sclick:9: {
  if ($did(helpbot, 9) == Start &HelpBot) {
    helpbot.ini basics server $did(helpbot, 13)
    helpbot.ini basics nick $did(helpbot, 15)
    helpbot.ini basics account $did(helpbot, 17)
    helpbot.ini basics pass $encode($did(helpbot, 19), m)
    helpbot.ini settings greeting $did(helpbot, 32)
    helpbot.ini settings autovoice $iif(($did(helpbot, 33).state == 1), $iif(($did(helpbot, 34).state == 1), 2, 1))
    helpbot.ini settings autocreate $did(helpbot, 35).state
    helpbot.ini settings onotice $did(helpbot, 36).state
    helpbot.start
  }
  elseif ($did(helpbot, 9) == Stop &HelpBot) { helpbot.stop }
}

on *:dialog:helpbot:sclick:23, 24: {
  if ((#* !iswm $did(helpbot, 22)) && (&* !iswm $did(helpbot, 22)) && (+* !iswm $did(helpbot, 22))) { return }
  var %dialog.helpbot.in = $helpbot.ini(channels, join)
  if ($did == 23) { var %dialog.helpbot.out = $sorttok($addtok(%dialog.helpbot.in, $did(helpbot, 22), 44), 44) }
  elseif ($did == 24) { var %dialog.helpbot.out = $sorttok($remtok(%dialog.helpbot.in, $did(helpbot, 22), 44), 44) }
  did -r helpbot 22
  var %dialog.helpbot.i = 1
  while ($gettok(%dialog.helpbot.out, %dialog.helpbot.i, 44)) {
    did -a helpbot 22 $gettok(%dialog.helpbot.out, %dialog.helpbot.i, 44)
    inc %dialog.helpbot.i
  }
  helpbot.ini channels join %dialog.helpbot.out
}

on *:dialog:helpbot:sclick:33: {
  if ($did(helpbot, 33).state == 0) {
    did -bu helpbot 34
  }
  elseif ($did(helpbot, 33).state == 1) {
    did -e helpbot 34
  }
}

on *:input:@helpbot: {
  helpbot.out $1-
}

on *:sockclose:helpbot: {
  if ($sockerr) {
    helpbot.error /helpbot.start socket error $+($chr(40),$sock(helpbot).wsmsg,$chr(41))
  }
  hfree -w helpbot*
}

on *:socklisten:helpbot.identd: {
  if (!$sockerr)  {
    sockaccept helpbot.identd2
  }
}

on *:sockopen:helpbot: {
  if ($sockerr) {
    helpbot.error /helpbot.start socket error whilst opening socket $sockname $+ : $+($chr(40), $sock($sockname).wsmsg, $chr(41))
    sockclose helpbot*
    return
  }
  helpbot.out NICK $hget(helpbot, nick)
  if ($hget(helpbot, pass)) { sockwrite -n helpbot PASS $hget(helpbot, pass) }
  helpbot.out USER HelpBot * * HelpBot
}

on *:sockread:helpbot:{
  if ($sockerr) {
    helpbot.error /helpbot.start socket error whilst reading from socket $sockname $+ : $+($chr(40), $sock($sockname).wsmsg, $chr(41))
    sockclose helpbot*
    return
  }
  var %helpbot.in
  sockread %helpbot.in
  tokenize 32 %helpbot.in
  if (001 == $2) {
    hadd helpbot server $helpbot.strip($1)
    sockclose helpbot.identd*
    helpbot.perform
  }
  elseif (324 == $2) {
    helpbot.in.modes $4 $5-
  }
  elseif (332 == $2) {
    helpbot.in.jtopic $4 $helpbot.strip($5-)
  }
  elseif (333 == $2) {
    helpbot.in.jtopicsetter $4-
  }
  elseif (353 == $2) {
    helpbot.in.names $5 $helpbot.strip($6-)
  }
  elseif (433 == $2) {
    hadd helpbot nick $hget(helpbot, nick) $+ `
    helpbot.out NICK $hget(helpbot, nick)
  }
  elseif (JOIN == $2) {
    helpbot.in.join $helpbot.nickhost($1) $helpbot.strip($3-)
  }
  elseif (KICK == $2) {
    helpbot.in.kick $helpbot.nickhost($1) $3-4 $helpbot.strip($5-)
  }
  elseif ((MODE == $2) && (#* iswm $3)) {
    helpbot.in.cmode $helpbot.nickhost($1) $helpbot.strip($3-)
  }
  elseif (MODE == $2) {
    helpbot.in.umode $helpbot.nickhost($1) $helpbot.strip($3-)
  }
  elseif (NICK == $2) {
    helpbot.in.nick $helpbot.nickhost($1) $helpbot.strip($3-)
  }
  elseif (NOTICE == $2) {
    helpbot.in.notice $helpbot.nickhost($1) $3 $helpbot.strip($4-)
  }
  elseif (PART == $2) {
    helpbot.in.part $helpbot.nickhost($1) $helpbot.strip($3) $iif(($4), $helpbot.strip($4-))
  }
  elseif (PING == $1) {
    helpbot.out PONG $2-
  }
  elseif (PRIVMSG == $2) {
    if (:ACTION * iswm $4-) {
    }
    elseif (:* iswm $4-) {
    }
    else {
      helpbot.in.text $helpbot.nickhost($1) $3 $helpbot.strip($4-)
    }
  }
  elseif (QUIT == $2) {
    helpbot.in.quit $helpbot.nickhost($1) $helpbot.strip($3-)
  }
  elseif (TOPIC == $2) {
    helpbot.in.topic $helpbot.nickhost($1) $3 $helpbot.strip($4-)
  }
  if (!$window(@helpbot)) { window -ek0 @helpbot }
  echo 2 @helpbot IN $1-
}

on *:sockread:helpbot.identd2: {
  if ($sockerr) {
    helpbot.error /helpbot.start socket error whilst reading from socket $sockname $+ : $+($chr(40), $sock($sockname).wsmsg, $chr(41))
    sockclose helpbot.identd*
    return
  }
  ;sockclose helpbot.identd
  var %helpbot.identd2.in
  sockread %helpbot.identd2.in
  linesep -s
  echo $color(Other text) -s * Identd request from $sock($sockname).ip $+($chr(40), %helpbot.identd2.in, $chr(41))
  sockwrite -n $sockname %helpbot.identd2.in : USERID : Identd : HelpBot
  echo $color(Other text) -s * Identd replied: %helpbot.identd2.in : USERID : Identd : HelpBot
  linesep -s
}

on *:sockwrite:helpbot.identd2: {
  sockclose helpbot.identd*
}

Conclusion :


voila le prob c'est que quand je dit "next" il voice la personne dont je donne l'ID mais quand je dit "close ID" il ne la devoice pas
si vous pouviez m'aider

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.