All pastes #88181 Raw Edit

Mine

public text v1 · immutable
·published 2006-07-14 16:38 UTC
rendered paste body
;================================================
;
;  Simple Helpbot
;  Version 2.0 
;  Written by: xDaeMoN
;  Email: xdaemon@xdaemon.us
;  Updated by: Vai (Demon1LT@yahoo.com)
;
;    Commands:  (MUST BE AN OP)
;
;    See the help file for a list of commands   
;
;================================================  

on *:CONNECT:{ 
  if (%help.chan) { 
    if ( $readini(uhelp.ini,config,stat) ) {
      /as auth RemoteServ qrk7u | //mode $me +x | /.timer 1 2 join %help.chan
    }
    else .notice $me ** Error: Help Desk is not Enabled  
  }
  else .notice $me ** Error: The variable $chr(37) $+ help.chan is not set (Right Click)
} 
on *:START:/echo  $+ $r(2,15) S $+  $+  $+ $r(2,15) i $+  $+  $+ $r(2,15) m $+  $+  $+ $r(2,15) p $+  $+  $+ $r(2,15) l $+  $+  $+ $r(2,15) e $+  $+ $r(2,15) H $+  $+  $+ $r(2,15) e $+  $+  $+ $r(2,15) l $+  $+  $+ $r(2,15) p $+  $+  $+ $r(2,15) B $+  $+  $+ $r(2,15) o $+  $+  $+ $r(2,15) t $+  Writen by Xdaemon - Updated by Vai - Right click for options WORK ON THE ADD USER SYSTEM(S) AND FIX THE QUIT SCRIPT(S)!!!
on *:EXIT:{
  if (%help.chan != $null) { 
    if ( $readini(uhelp.ini,config,stat) ) {
      var %mremlist 1 
      while (%mremlist <= $ini(uhelp.ini,%help.chan,0)) {
        remini uhelp.ini $ini(uhelp.ini,%help.chan,%mremlist)
        inc %mremlist
      }
      var %mremclist 1
      while (%mremclist <= $ini(uhelp.ini,current,0)) {
        remini uhelp.ini $ini(uhelp.ini,current,%mremclist)
        inc %mremclist
      }
    }
    else .notice $me ** Error: Help Desk is not Enabled  
  }
  else .notice $me ** Error: The variable $chr(37) $+ help.chan is not set (Right Click)
}

alias quit {
  if ($nick == $me) {
    if (%help.chan != $null) { 
      if ( $readini(uhelp.ini,config,stat) ) {
        var %mremlist 1 
        while (%mremlist <= $ini(uhelp.ini,%help.chan,0)) {
          remini uhelp.ini $ini(uhelp.ini,%help.chan,%mremlist)
          inc %mremlist
        }
        var %mremclist 1
        while (%mremclist <= $ini(uhelp.ini,current,0)) {
          remini uhelp.ini $ini(uhelp.ini,current,%mremclist)
          inc %mremclist
          /!quit Bye Bye
        }
      }
      else .notice $me ** Error: Help Desk is not Enabled  
    }
    else .notice $me ** Error: The variable $chr(37) $+ help.chan is not set (Right Click)
  }
}

on !*:JOIN:%help.chan: {
  if ( $readini(uhelp.ini,config,stat) ) && (!$readini(uhelp.ini,oplist,$nick)) {
    writeini uhelp.ini $chan $nick help
    .msg $nick Hello, welcome to $chan $+ , please /msg $me <with a description of your question> for faster service.
  }
}

on *:TEXT:*:?:{
  if ($nick isreg %help.chan) {
    if ( $readini(uhelp.ini,config,stat) ) {
      if (!$readini(uhelp.ini,oplist,$nick)) { 
        inc %helpquestions. $+ $nick 
        set %helpquestion [ $+ [ %helpquestions. [ $+ [ $nick ] ] ] ] [ $+ [ . ] ] [ $+ [ $nick ] ] $1- 
      }
    }
  }
  elseif ( $nick !ison %help.chan ) { 
    if ( $readini(uhelp.ini,config,stat) ) { 
      if (!$readini(uhelp.ini,oplist,$nick)) { 
        .msg $nick You cannot open this request as you are not in %help.chan $+ .
      }
    }
  }
  elseif ( $nick isop %help.chan ) && ( %commandflood. [ $+ [ $1 ] ] [ $+ [ . ] ] [ $+ [ $nick ] ] != on ) {
    if ( $1 == helpscript ) {
      if ( $readini(uhelp.ini,owners,$nick) ) {
        if ( $2 == on ) {
          if (!$readini(uhelp.ini,config,stat)) {
            writeini uhelp.ini config stat 1
            .notice $nick ** Enabled Help Desk
            .onotice %help.chan Help Desk for %help.chan is now in session
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick ** Error: Help desk is already enabled
        }
        elseif ( $2 == off ) {
          if ($readini(uhelp.ini,config,stat)) {
            .remini uhelp.ini config
            .notice $nick ** Disabled Help Desk
            .onotice %help.chan Help Desk for $help.chan is now OFF
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick ** Error: Help desk is already disabled
        }
      }
      else .notice $nick ** Error: You lack sufficient access to use this command
    }
    elseif ( $1 == help || $1 == commands ) && ( $2 == $null ) {
      if ($readini(uhelp.ini,config,stat)) {
        if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          list.sections $nick
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == help || $1 == commands ) {
      if ( $2 == trial ) || ( $2 == helper ) || ( $2 == manager ) || ( $2 == owner ) || ( $2 == Master ) || ( $2 == All ) || ( $2 == Notes ) {
        if ($readini(uhelp.ini,config,stat)) {
          if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            list. $+ $2 $+ commands $nick
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: Help Desk is not Enabled
      }
    }
    elseif ( $1 == next ) { 
      if ($readini(uhelp.ini,config,stat)) {
        if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          nextuser $nick %help.chan
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == pickup ) {
      if ($2 ison %help.chan) {
        if ($2 != $null) { 
          if ($2 isreg %help.chan) {
            if ($readini(uhelp.ini,config,stat)) {
              if ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
                pickupuser $nick %help.chan $2
                set %commandflood. $+ $1 $+ . $+ $nick on
                .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
              }
              else .notice $nick ** Error: You lack sufficient access to use this command
            }
            else .notice $nick ** Error: Help Desk is not Enabled
          }
          else .notice $nick $2 is either currently being helped or is an Operator
        }
        else .notice $nick ** Error: /msg $me pickup <nick to pickup>
      }
      else .notice $nick ** Error: No such nick
    }
    elseif ( $1 == close ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ( $2 ison %help.chan ) { 
            if ( $readini(uhelp.ini,current,$_n1($2)) ) {
              mode %help.chan -v $2
              remini uhelp.ini current $_n1($2)
              writeini uhelp.ini %help.chan $_n1($2) help
              .notice $nick You have closed request $2
              .onotice %help.chan Help Request ( $+ $2 $+ ) was closed by $nick at $remove($timestamp,$chr(91),$chr(93))
              set %commandflood. $+ $1 $+ . $+ $nick on
              .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick 
            }
            else .notice ** Error: You lack sufficient access to use this command
          }
          else .notice $nick ** Error: /msg $me close <nick that has been helped>
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == request || $1 == requests ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ($2 != $null) { 
            if ($2 ison %help.chan) {
              if ($2 isreg %help.chan) {
                .notice $nick ** Request Lines for $2 **
                .questionnotice.2 $nick $2
                set %commandflood. $+ $1 $+ . $+ $nick on
                .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
              }
              else .notice $nick ** Error: $2 is either currently being helped or is an Operator
            }
            else .notice $nick ** Error: No such nick
          }
          else .notice $nick ** Error: /msg $me request <nick to see requests>
        }
        else .notice $nick You lack sufficient access to use this command.
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == raw ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,owners,$nick) ) {
          if ($nick isop %help.chan) {
            if ($2 != $null) {
              if (Chanserv !isin $2-) && (authserv !isin $2-) && (nickserv !isin $2-) && (Cs !isin $2-) && (! !isin $2-) && (as !isin $2-) && (ns !isin $2-) {
                $eval($2-,2)
              }
              else .notice $nick ** Error: You can't use $1 that way
            }
            else .notice $nick ** Error: $chr(38) $+ raw <command>
          } 
          else .notice $nick ** Error: You are not oped in %help.chan
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == users || $1 == ulist ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if  ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          .notice $nick ** Listing all Users(s) on the Helper list ( $+ %numofhelpers $+ ) **
          list.owner $nick
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else halt
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == trials ) || ( $1 == helpers ) || ( $1 == managers ) || ( $1 == owners )  {
      if ( $readini(uhelp.ini,config,stat) ) {
        if  ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          .notice $nick ** Listing all Users(s) on the $1 list ( $+ %numofhelpers. [ $+ [ $1 ] ] $+ ) **
          list. $+ $remove($1,s) $+ 2 $nick
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else halt
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    } 
    elseif ( $1 == list ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,trials,$nick)) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ($ini(uhelp.ini,%help.chan,0) ) {
            .notice $nick ** Listing all User(s) on the Help list ( $+ $v1 $+ ) **
            var %hc = 1
            while $ini(uhelp.ini,%help.chan,%hc) {
              .notice $nick $_n2($v1) 
              inc %hc
            }
            .notice $nick ** End of Help List **
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick The Help list is empty.
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == clist ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,trials,$nick)) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ( $ini(uhelp.ini,current,0) ) {
            .notice $nick ** Listing all User(s) Currently being Helped ( $+ $v1 $+ ) **
            var %h = 1
            while $ini(uhelp.ini,current,%h) {
              .notice $nick $readini(uhelp.ini,current,$_n2($v1)) is currently helping $_n2($v1)
              inc %h
            }
            .notice $nick ** End of the Helped List **
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick The Currently being Helped list is empty.
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == addtrial ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser trials $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == deltrial ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) { 
            if (!$readini(uhelp.ini,helpers,$2)) {
              if (!$readini(uhelp.ini,managers,$2)) { 
                if (!$readini(uhelp.ini,owners,$2)) {
                  if ($readini(uhelp.ini,trials,$2)) { 
                    delhelperuser trials $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as an Owner not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Manager
            }
            else .notice $nick $2 is on the helper list as a Helper not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == addhelper ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser helpers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == delhelper ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,managers,$2)) { 
                if (!$readini(uhelp.ini,owners,$2)) {
                  if ($readini(uhelp.ini,helpers,$2)) { 
                    delhelperuser helpers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as an Owner not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Manager not $remove($1,del)
            }
            else .notice $nick $2 is on the helper list as a Trial not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == addmanager ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser managers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == delmanager) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) {  
                if (!$readini(uhelp.ini,owners,$2)) {
                  if ($readini(uhelp.ini,managers,$2)) {
                    delhelperuser managers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as a Owner not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Helper not $remove($1,del)
            }
            else .notice $nick $2 is on the helper list as a Trial not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == addowner ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,config,master) == $nick ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) {
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser owners $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == access || $1 == a ) {
      if ( $readini(uhelp.ini,trials,$2) ) || ( $readini(uhelp.ini,helpers,$2) ) || ( $readini(uhelp.ini,managers,$2) ) || ( $readini(uhelp.ini,owners,$2) ) {
        if ($2 != $null) {
          if ( $readini(uhelp.ini,config,stat) ) {
            if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
              if (!$readini(uhelp.ini,trials,$2)) { 
                if (!$readini(uhelp.ini,helpers,$2)) { 
                  if (!$readini(uhelp.ini,managers,$2)) { 
                    if (!$readini(uhelp.ini,owners,$2)) {
                      set %commandflood. $+ $1 $+ . $+ $nick on
                      .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick                      
                      halt
                    }
                    else .notice $nick $2 is on the helper list as an Owner
                  }
                  else .notice $nick $2 is on the helper list as a Manager
                }
                else .notice $nick $2 is on the helper list as a Helper
              }
              else .notice $nick $2 is on the helper list as a Trial
            }
            else .notice $nick ** Error: You lack sufficient access to use this command
          }
          else .notice $nick ** Error: Help Desk is not Enabled
        }
        else .notice $nick ** Error: /msg $me close <nick read access>
      }
      else .notice $nick ** Error: No such nick
    }
    elseif ( $1 == delowner ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,config,master) == $nick ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if ($readini(uhelp.ini,owners,$2)) {
                    delhelperuser owners $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as a Manager not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Helper not $remove($1,del)
            }
            else .notice $nick $2 is on the helper list as a Trial not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
  }
}

on *:TEXT:&*:%help.chan:{
  if ( $nick isop %help.chan ) && ( %commandflood. [ $+ [ $1 ] ] [ $+ [ . ] ] [ $+ [ $nick ] ] != on ) {
    if ( $1 == $chr(38) $+ helpscript ) {
      if ( $readini(uhelp.ini,owners,$nick) ) {
        if ( $2 == on ) {
          if (!$readini(uhelp.ini,config,stat)) {
            writeini uhelp.ini config stat 1
            .notice $nick ** Enabled Help Desk
            .onotice %help.chan Help Desk for %help.chan is now in session
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick ** Error: Help desk is already enabled
        }
        elseif ( $2 == off ) {
          if ($readini(uhelp.ini,config,stat)) {
            .remini uhelp.ini config
            .notice $nick ** Disabled Help Desk
            .onotice %help.chan Help Desk for $help.chan is now OFF
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick ** Error: Help desk is already disabled
        }
      }
      else .notice $nick ** Error: You lack sufficient access to use this command
    }
    elseif ( $1 == $chr(38) $+ help || $1 == $chr(38) $+ commands ) && ( $2 == $null ) {
      if ($readini(uhelp.ini,config,stat)) {
        if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          list.sections $nick
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ help || $1 == $chr(38) $+ commands ) {
      if ( $2 == trial ) || ( $2 == helper ) || ( $2 == manager ) || ( $2 == owner ) || ( $2 == Master ) || ( $2 == All ) || ( $2 == Notes ) {
        if ($readini(uhelp.ini,config,stat)) {
          if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            list. $+ $2 $+ commands $nick
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: Help Desk is not Enabled
      }
    }
    elseif ( $1 == $chr(38) $+ next ) { 
      if ($readini(uhelp.ini,config,stat)) {
        if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          nextuser $nick %help.chan
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ pickup ) {
      if ($2 ison %help.chan) {
        if ($2 != $null) { 
          if ($2 isreg %help.chan) {
            if ($readini(uhelp.ini,config,stat)) {
              if ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
                pickupuser $nick %help.chan $2
                set %commandflood. $+ $1 $+ . $+ $nick on
                .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
              }
              else .notice $nick ** Error: You lack sufficient access to use this command
            }
            else .notice $nick ** Error: Help Desk is not Enabled
          }
          else .notice $nick $2 is either currently being helped or is an Operator
        }
        else .notice $nick ** Error: $chr(38) $+ pickup <nick to pickup>
      }
      else .notice $nick ** Error: No such nick
    }
    elseif ( $1 == $chr(38) $+ close ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ( $2 ison %help.chan ) { 
            if ( $readini(uhelp.ini,current,$_n1($2)) ) {
              mode %help.chan -v $2
              remini uhelp.ini current $_n1($2)
              writeini uhelp.ini %help.chan $_n1($2) help
              .notice $nick You have closed request $2
              .onotice %help.chan Help Request ( $+ $2 $+ ) was closed by $nick at $remove($timestamp,$chr(91),$chr(93))
              set %commandflood. $+ $1 $+ . $+ $nick on
              .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick 
            }
            else .notice ** Error: You lack sufficient access to use this command
          }
          else .notice $nick ** Error: $chr(38) $+ close <nick that has been helped>
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ request || $1 == $chr(38) $+ requests ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ($2 != $null) { 
            if ($2 ison %help.chan) {
              if ($2 isreg %help.chan) {
                .notice $nick ** Request Lines for $2 **
                .questionnotice.2 $nick $2
                set %commandflood. $+ $1 $+ . $+ $nick on
                .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
              }
              else .notice $nick ** Error: $2 is either currently being helped or is an Operator
            }
            else .notice $nick ** Error: No such nick
          }
          else .notice $nick ** Error: $chr(38) $+ request <nick to see requests>
        }
        else .notice $nick You lack sufficient access to use this command.
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ raw ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,owners,$nick) ) {
          if ($nick isop %help.chan) {
            if ($2 != $null) {
              if (Chanserv !isin $2-) && (authserv !isin $2-) && (nickserv !isin $2-) && (Cs !isin $2-) && (! !isin $2-) && (as !isin $2-) && (ns !isin $2-) {
                $eval($2-,2)
              }
              else .notice $nick ** Error: You can't use $1 that way
            }
            else .notice $nick ** Error: $chr(38) $+ raw <command>
          } 
          else .notice $nick ** Error: You are not oped in %help.chan
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ users || $1 == $chr(38) $+ ulist ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if  ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          .notice $nick ** Listing all Users(s) on the Helper list ( $+ %numofhelpers $+ ) **
          list.owner $nick
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else halt
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ trials ) || ( $1 == $chr(38) $+ helpers ) || ( $1 == $chr(38) $+ managers ) || ( $1 == $chr(38) $+ owners )  {
      if ( $readini(uhelp.ini,config,stat) ) {
        if  ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          .notice $nick ** Listing all Users(s) on the $remove($1,$chr(38),s) list ( $+ %numofhelpers. [ $+ [ $remove($1,$chr(38)) ] ] $+ ) **
          list. $+ $remove($1,$chr(38),s) $+ 2 $nick
          set %commandflood. $+ $1 $+ . $+ $nick on
          .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
        }
        else halt
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    } 
    elseif ( $1 == $chr(38) $+ list ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,trials,$nick)) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ($ini(uhelp.ini,%help.chan,0) ) {
            .notice $nick ** Listing all User(s) on the Help list ( $+ $v1 $+ ) **
            var %hc = 1
            while $ini(uhelp.ini,%help.chan,%hc) {
              .notice $nick $_n2($v1) 
              inc %hc
            }
            .notice $nick ** End of Help List **
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick The Help list is empty.
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ clist ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ( $readini(uhelp.ini,trials,$nick)) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
          if ( $ini(uhelp.ini,current,0) ) {
            .notice $nick ** Listing all User(s) Currently being Helped ( $+ $v1 $+ ) **
            var %h = 1
            while $ini(uhelp.ini,current,%h) {
              .notice $nick $readini(uhelp.ini,current,$_n2($v1)) is currently helping $_n2($v1)
              inc %h
            }
            .notice $nick ** End of the Helped List **
            set %commandflood. $+ $1 $+ . $+ $nick on
            .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
          }
          else .notice $nick The Currently being Helped list is empty.
        }
        else .notice $nick ** Error: You lack sufficient access to use this command
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ addtrial ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser trials $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ deltrial ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) { 
            if (!$readini(uhelp.ini,helpers,$2)) {
              if (!$readini(uhelp.ini,managers,$2)) { 
                if (!$readini(uhelp.ini,owners,$2)) {
                  if ($readini(uhelp.ini,trials,$2)) { 
                    delhelperuser trials $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as an Owner not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Manager
            }
            else .notice $nick $2 is on the helper list as a Helper not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ addhelper ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser helpers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ delhelper ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,managers,$2)) { 
                if (!$readini(uhelp.ini,owners,$2)) {
                  if ($readini(uhelp.ini,helpers,$2)) { 
                    delhelperuser helpers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as an Owner not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Manager not $remove($1,del)
            }
            else .notice $nick $2 is on the helper list as a Trial not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ addmanager ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser managers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ delmanager) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,owners,$nick) ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) {  
                if (!$readini(uhelp.ini,owners,$2)) {
                  if ($readini(uhelp.ini,managers,$2)) {
                    delhelperuser managers $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as a Owner not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Helper not $remove($1,del)
            }
            else .notice $nick $2 is on the helper list as a Trial not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ addowner ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,config,master) == $nick ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) {
                  if (!$readini(uhelp.ini,owners,$2)) {
                    addhelperuser owners $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick $2 is already on the helper list as an Owner
                }
                else .notice $nick $2 is already on the helper list as a Manager
              } 
              else .notice $nick $2 is already on the helper list as a Helper
            }
            else .notice $nick $2 is already on the helper list as a Trial
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
    elseif ( $1 == $chr(38) $+ access || $1 == $chr(38) $+ a ) {
      if ( $readini(uhelp.ini,trials,$2) ) || ( $readini(uhelp.ini,helpers,$2) ) || ( $readini(uhelp.ini,managers,$2) ) || ( $readini(uhelp.ini,owners,$2) ) {
        if ($2 != $null) {
          if ( $readini(uhelp.ini,config,stat) ) {
            if ( $readini(uhelp.ini,trials,$nick) ) || ( $readini(uhelp.ini,helpers,$nick) ) || ( $readini(uhelp.ini,managers,$nick) ) || ( $readini(uhelp.ini,owners,$nick) ) {
              if (!$readini(uhelp.ini,trials,$2)) { 
                if (!$readini(uhelp.ini,helpers,$2)) { 
                  if (!$readini(uhelp.ini,managers,$2)) { 
                    if (!$readini(uhelp.ini,owners,$2)) {
                      set %commandflood. $+ $1 $+ . $+ $nick on
                      .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick                      
                      halt
                    }
                    else .notice $nick $2 is on the helper list as an Owner
                  }
                  else .notice $nick $2 is on the helper list as a Manager
                }
                else .notice $nick $2 is on the helper list as a Helper
              }
              else .notice $nick $2 is on the helper list as a Trial
            }
            else .notice $nick ** Error: You lack sufficient access to use this command
          }
          else .notice $nick ** Error: Help Desk is not Enabled
        }
        else .notice $nick ** Error: /msg $me close <nick read access>
      }
      else .notice $nick ** Error: No such nick
    }
    elseif ( $1 == $chr(38) $+ delowner ) {
      if ( $readini(uhelp.ini,config,stat) ) {
        if ($2 ison %help.chan) {
          if ( $readini(uhelp.ini,config,master) == $nick ) {
            if (!$readini(uhelp.ini,trials,$2)) { 
              if (!$readini(uhelp.ini,helpers,$2)) { 
                if (!$readini(uhelp.ini,managers,$2)) { 
                  if ($readini(uhelp.ini,owners,$2)) {
                    delhelperuser owners $2 $nick
                    set %commandflood. $+ $1 $+ . $+ $nick on
                    .timer 1 4 unset %commandflood. $+ $1 $+ . $+ $nick
                  }
                  else .notice $nick ** Error: $2 is not on the helper list at all
                }
                else .notice $nick $2 is on the helper list as a Manager not $remove($1,del)
              } 
              else .notice $nick $2 is on the helper list as a Helper not $remove($1,del)
            }
            else .notice $nick $2 is on the helper list as a Trial not $remove($1,del)
          }
          else .notice $nick ** Error: You lack sufficient access to use this command
        }
        else .notice $nick ** Error: No such nick
      }
      else .notice $nick ** Error: Help Desk is not Enabled
    }
  }
}

on *:OPEN:?:{ window -h $nick }

alias addhelperuser {
  if ( $2 isop %help.chan ) {
    if ( $1 == trials ) || ( $1 == helpers ) || ( $1 == managers ) || ( $1 == owners ) { 
      writeini uhelp.ini $1 $2 1
      writeini uhelp.ini allh $2 1
      .notice $3 Added nick $2 as one of the $1 $+ .
      inc %numofhelpers
      inc %numofhelpers. $+ $1
      writeini uhelp.ini config NumOfHelpers %numofhelpers
      writeini uhelp.ini config $1 %numofhelpers. [ $+ [ $1 ] ]

    }
  }
}

alias delhelperuser {
  if ( $2 isop %help.chan ) {
    if ( $1 == trials ) || ( $1 == helpers ) || ( $1 == managers ) || ( $1 == owners ) { 
      remini uhelp.ini $1 $2
      remini uhelp.ini allh $2
      .notice $3 Deleted nick $2 as from the $1 list $+ .
      dec %numofhelpers
      dec %numofhelpers. $+ $1
      writeini uhelp.ini config NumOfHelpers %numofhelpers
      writeini uhelp.ini config $1 %numofhelpers. [ $+ [ $1 ] ]
    }
  }
}

alias pickupuser {
  if ( $ini(uhelp.ini,$2,0) ) {
    if ( $_n2($ini(uhelp.ini,$2,1)) ison $2 ) && ($3 != $null) {
      inc %helprequestid
      mode $2 +v $3
      set %helpwhoisnick $1
      whois $1
      set %msgnick. $+ $1 $3
      .notice $1 You have pickuped request ID# $+ %helprequestid ( $+ $3 $+ )
      .notice $1 ** Request Lines for $3 **
      .questionnotice $1 $3
      writeini uhelp.ini current $_n2($3) $1
      remini uhelp.ini %help.chan $_n1($3) 
    }
    else {
      remini uhelp.ini $2 $3
      .timer 1 1 pickupuser $1 $2 $3
    }
  }
  else .notice $1 ** Error: No such nick
}

alias nextuser {
  if ( $ini(uhelp.ini,$2,0) ) {
    if ( $_n2($ini(uhelp.ini,$2,1)) ison $2 ) {
      inc %helprequestid
      mode $2 +v $_n2($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ]))
      set %helpwhoisnick $1
      whois $1
      set %msgnick. $+ $1 $_n2($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ]))
      .notice $1 You have pickuped request ID# $+ %helprequestid ( $+ $_n2($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ])) $+ )
      .notice $1 ** Request Lines for $_n2($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ])) **
      .questionnotice $1 $_n2($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ]))
      writeini uhelp.ini current $_n2($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ])) $1
      remini uhelp.ini $2 $_n1($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ]))
    }
    else {
      remini uhelp.ini $2 $_n1($ini(uhelp.ini,$2, [ $+ [ $ini(uhelp.ini,$2,0) ] ]))
      .timer 1 1 nextuser $1 $2
    }
  }
  else .notice $1 Help list is empty.
}

alias _n1 { return $replace($1,[,«,],») }
alias _n2 { return $replace($1,«,[,»,]) }


on *:NICK: {
  if ( $readini(uhelp.ini,current,$nick) ) { 
    writeini uhelp.ini current $_n1($newnick) $readini(uhelp.ini,current,$_n1($nick)) 
    remini uhelp.ini current $_n2($nick) 
  } 
  elseif ( $readini(uhelp.ini,%help.chan,$nick) ) { 
    writeini uhelp.ini %help.chan $_n1($newnick)
    remini uhelp.ini %help.chan $_n2($nick) 
  }
}

on *:QUIT: {
  if ( $readini(uhelp.ini,current,$nick) ) { 
    remini uhelp.ini current $_n2($nick)
  } 
  elseif ( $readini(uhelp.ini,$chan,$nick) ) { 
    remini uhelp.ini %help.chan $_n2($nick) 
    questionunset $nick
  }
}

on *:PART:%help.chan: {
  if ( $readini(uhelp.ini,current,$nick) ) { 
    remini uhelp.ini current $_n2($nick)
  }
  elseif ( $readini(uhelp.ini,$chan,$nick) ) { 
    remini uhelp.ini $chan $_n1($nick) 
    questionunset $nick
  }
}

on !*:OP:%help.chan: {
  if ( $readini(uhelp.ini,oplist,$opnick) == $null ) remini uhelp.ini $chan $_n1($opnick) | remini uhelp.ini current $_n1($opnick) | writeini uhelp.ini oplist $_n1($opnick) 1
  if ( $readini(uhelp.ini,oplist,$opnick) != $null ) remini uhelp.ini $chan $_n1($opnick) | remini uhelp.ini $chan $_n1($opnick)
}

on !*:OP:%help.chan: {
  if ( $readini(uhelp.ini,oplist,$opnick) == $null ) remini uhelp.ini $chan $_n1($opnick) | remini uhelp.ini current $_n1($opnick) | writeini uhelp.ini oplist $_n1($opnick) 1
  if ( $readini(uhelp.ini,oplist,$opnick) != $null ) remini uhelp.ini $chan $_n1($opnick) | remini uhelp.ini $chan $_n1($opnick)
}

on !*:KICK:%help.chan: {
  if ( $readini(uhelp.ini,current,$_n1($knick)) ) {
    remini uhelp.ini current $_n2($knick)
  }
  elseif ($readini(uhelp.ini,$chan,$_n1($knick))) {
    remini uhelp.ini $chan $_n2($knick) 
    questionunset $knick
  }
}

on !*:VOICE:%help.chan: {
  if ( $readini(uhelp.ini,$chan,$_n1($vnick)) ) {
    remini uhelp.ini $chan $_n1($vnick)
  }
} 

menu menubar,channel,status,nicklist {
  Help Channel $iif(%help.chan, $+($chr(40),$v1,$chr(41)), (NONE))
  .$iif(%help.chan,Change Channel, Set Help Channel):set -s %help.chan #$$?="Enter Help #Channel:" 
  .$iif($readini(uhelp.ini,config,master),Change Master Control Nick, Set Master Control Nick):writeini uhelp.ini config master $$?="Enter Master Control Nick:"
}

raw 330:*:{ if ($2 == %helpwhoisnick) { set %helpwhoisauth. $+ $2 $3 | .msg %msgnick. [ $+ [ $2 ] ] Your helper request ID# $+ %helprequestid is %helpwhoisauth. [ $+ [ $2 ] ] (Current nick: $2 $+ ) | unset %helpwhoisauth. $+ $2 | unset %msgnick. $+ $2 | halt } }
raw 318:*:{ if ($2 == %helpwhoisnick) { unset %helpwhoisnick | halt } }
raw *:*:{ if ($2 == %helpwhoisnick) { halt } }
alias questionnotice { var %helpquestionnotice 1 | while (%helpquestionnotice <= %helpquestions. [ $+ [ $2 ] ] ]) { .notice $1 Request Line $chr(35) $+ %helpquestionnotice $+ : %helpquestion [ $+ [ %helpquestionnotice ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] | inc %helpquestionnotice } | .notice $1 ** End of Request Lines from $2 ** | .onotice %help.chan Help Request ID# $+ %helprequestid ( $+ $2 $+ ) was picked up by $1 at $remove($timestamp,$chr(91),$chr(93)) | .timer 1 2 questionunset $2 }
alias questionnotice.2 { var %helpquestionnotice.2 1 | while (%helpquestionnotice.2 <= %helpquestions. [ $+ [ $2 ] ] ]) { .notice $1 Request Line $chr(35) $+ %helpquestionnotice.2 $+ : %helpquestion [ $+ [ %helpquestionnotice.2 ] ] [ $+ [ . ] ] [ $+ [ $2 ] ] | inc %helpquestionnotice.2 } | .notice $1 ** End of Request Lines from $2 ** }
alias questionunset { var %helpquestionunset 1 | while (%helpquestionunset <= %helpquestions. [ $+ [ $1 ] ] ]) { unset %helpquestion [ $+ [ %helpquestionunset ] ] [ $+ [ . ] ] [ $+ [ $1 ] ] | inc %helpquestionunset } | unset %helpquestions. [ $+ [ $1 ] ] ] }

alias list.owner { 
  if ($ini(uhelp.ini,owners,0) == 0) {
    .notice $1 ** Owners ( $+ %numofhelpers.owners $+ ) ** 
    .notice $1 None
  }
  else {
    .notice $1 ** Owners ( $+ %numofhelpers.owners $+ ) **
    var %list.owner 1 
    while (%list.owner <= $readini(uhelp.ini,config,owners)) {
      .notice $1 $ini(uhelp.ini,owners,%list.owner) 
      inc %list.owner
    } 
  }
  list.manager $1
}

alias list.owner2 { 
  if ($ini(uhelp.ini,owners,0) == 0) {
    .notice $1 ** Owners ( $+ %numofhelpers.owners $+ ) **
    .notice $1 None
  }
  else {
    .notice $1 ** Owners ( $+ %numofhelpers.owners $+ ) **
    var %list.owner2 1 
    while (%list.owner2 <= $readini(uhelp.ini,config,owners)) {
      .notice $1 $ini(uhelp.ini,owners,%list.owner2) 
      inc %list.owner2
    } 
  }
  .notice $1  ** End of the Owner list **
}

alias list.manager { 
  if ($ini(uhelp.ini,managers,0) == 0) {
    .notice $1 ** Managers ( $+ %numofhelpers.managers $+ ) ** 
    .notice $1 None
  }
  else {
    .notice $1 ** Managers ( $+ %numofhelpers.managers $+ ) **
    var %list.manager 1 
    while (%list.manager <= $readini(uhelp.ini,config,managers)) {
      .notice $1 $ini(uhelp.ini,managers,%list.manager) 
      inc %list.manager
    } 
  }
  list.helper $1
}

alias list.manager2 { 
  if ($ini(uhelp.ini,managers,0) == 0) {
    .notice $1 ** Managers ( $+ %numofhelpers.managers $+ ) ** 
    .notice $1 None
  }
  else {
    .notice $1 ** Managers ( $+ %numofhelpers.managers $+ ) **
    var %list.manager2 1 
    while (%list.manager2 <= $readini(uhelp.ini,config,managers)) {
      .notice $1 $ini(uhelp.ini,managers,%list.manager2) 
      inc %list.manager2
    } 
  }
  .notice $1 ** End of the Manager list **
}

alias list.helper { 
  if ($ini(uhelp.ini,helpers,0) == 0) {
    .notice $1 ** Helpers ( $+ %numofhelpers.helpers $+ ) ** 
    .notice $1 None
  }
  else {
    .notice $1 ** Helpers ( $+ %numofhelpers.helpers $+ ) **
    var %list.helper 1 
    while (%list.helper <= $readini(uhelp.ini,config,helpers)) {
      .notice $1 $ini(uhelp.ini,helpers,%list.helper) 
      inc %list.helper
    } 
  }
  list.trial $1
}

alias list.helper2 { 
  if ($ini(uhelp.ini,helpers,0) == 0) {
    .notice $1 ** Helpers ( $+ %numofhelpers.helpers $+ ) **
    .notice $1 None
  }
  else {
    .notice $1 ** Helpers ( $+ %numofhelpers.helpers $+ ) ** 
    var %list.helper2 1 
    while (%list.helper2 <= $readini(uhelp.ini,config,helpers)) {
      .notice $1 $ini(uhelp.ini,helpers,%list.helper2) 
      inc %list.helper2
    } 
  }
  .notice $1 ** End of the Helper list **
}

alias list.trial2 { 
  if ($ini(uhelp.ini,trials,0) == 0) {
    .notice $1 ** Trials ( $+ %numofhelpers.trials $+ ) **
    .notice $1 None
  }
  else {
    .notice $1 ** Trials ( $+ %numofhelpers.trials $+ ) **
    var %list.trial2 1 
    while (%list.trial2 <= $readini(uhelp.ini,config,trials)) {
      .notice $1 $ini(uhelp.ini,trials,%list.trial2) 
      inc %list.trial2
    } 
  }
  .notice $1 ** End of the Trial list **
}

alias list.trial { 
  if ($ini(uhelp.ini,trials,0) == 0) {
    .notice $1 ** Trials ( $+ %numofhelpers.trials $+ ) ** 
    .notice $1 None
  }
  else {
    .notice $1 ** Trials ( $+ %numofhelpers.trials $+ ) **
    var %list.trial 1 
    while (%list.trial <= $readini(uhelp.ini,config,trials)) {
      .notice $1 $ini(uhelp.ini,trials,%list.trial) 
      inc %list.trial
    } 
  }
  .notice $1 ** End of user list **
}

alias list.sections {
  .notice $1 ** Table of Contents **
  .notice $1 Trial
  .notice $1 Helper
  .notice $1 Manager
  .notice $1 Owner
  .notice $1 Master
  .notice $1 All
  .notice $1 *************************
  .notice $1 Notes
  .notice $1 ** End of the Table of Contents **
}

alias list.allcommands {
  .notice $1 ** Trial Commands ** (Beginning Helpers)
  .notice $1 Help: Takes a look on all the commands and how to use them
  .notice $1 Next: Pickup the next user in line of the Help List
  .notice $1 Requests: View the requests by a nick provided
  .notice $1 Users: View all the Helpers in my Helper Database
  .notice $1 Trials/Helpers/Managers/Owners: Displays all Helpers of the access you provide
  .notice $1 List/Clist: List displays the users who aren't being helped, clist shows who are
  .notice $1 Access: Displays the access of one Helper
  .timer 1 3 .notice $1 ** Helper Commands ** (Full Helpers)
  .timer 1 3 .notice $1 Pickup: Assigns you to a Specific nick that you provide (See Next)
  .timer 1 3 .notice $1 Close: Closes a Specific nick that you provdide
  .timer 1 5 .notice $1 ** Manager Commands ** (Helpers Employer $+ $chr(91) $+ s $+ $chr(93) $+ )
  .timer 1 5 .notice $1 AddTrial/DelTrial: Adds/Deletes a Specific nick to/from the Trial Database that you provide
  .timer 1 5 .notice $1 AddHelper/DelHelper: Adds/Deletes a Specific nick to/from the Helper Database that you provide
  .timer 1 7 .notice $1 ** Owner Commands ** (Managers Employer $+ $chr(91) $+ s $+ $chr(93) $+ )
  .timer 1 7 .notice $1 HelpScript $chr(91) $+ on $+ $+ $chr(124) $+ off $+ $chr(93) $+ : Turns the whole Help Script on or off
  .timer 1 7 .notice $1 AddManager/DelManager: Adds/Deletes a Specific nick to/from the Manager Database that you provide
  .timer 1 9 .notice $1 ** Master Commands ** (Board of Directors and Administration)
  .timer 1 9 .notice $1 AddOwner/DelOwner: Adds/Deletes a Specific nick to/from the Owner Database that you provide
  .timer 1 11 .notice $1 ** End of the commands list **
}

alias list.trialcommands {
  .notice $1 ** Trial Commands ** (Beginning Helpers)
  .notice $1 Help: Takes a look on all the commands and how to use them
  .notice $1 Next: Pickup the next user in line of the Help List
  .notice $1 Requests: View the requests by a nick provided
  .notice $1 Users: View all the Helpers in my Helper Database
  .notice $1 Trials/Helpers/Managers/Owners: Displays all Helpers of the access you provide
  .notice $1 List/Clist: List displays the users who aren't being helped, clist shows who are
  .notice $1 Access: Displays the access of one Helper
  .notice $1 ** End of the Trial command list **
}

alias list.helpercommands {
  .notice $1 ** Helper Commands ** (Full Helpers)
  .notice $1 Pickup: Assigns you to a Specific nick that you provide (See Next)
  .notice $1 Close: Closes a Specific nick that you provdidee
  .notice $1 ** End of the Helper command list **
}

alias list.managercommands {
  .notice $1 ** Manager Commands ** (Helpers Employer $+ $chr(91) $+ s $+ $chr(93) $+ )
  .notice $1 AddTrial/DelTrial: Adds/Deletes a Specific nick to/from the Trial Database that you provide
  .notice $1 AddHelper/DelHelper: Adds/Deletes a Specific nick to/from the Helper Database that you provide
  .notice $1 ** End of the Manager command list **
}

alias list.ownercommands {
  .notice $1 ** Owner Commands ** (Managers Employer $+ $chr(91) $+ s $+ $chr(93) $+ )
  .notice $1 HelpScript $chr(91) $+ on $+ $+ $chr(124) $+ off $+ $chr(93) $+ : Turns the whole Help Script on or off
  .notice $1 AddManager/DelManager: Adds/Deletes a Specific nick to/from the Manager Database that you provide
  .notice $1 ** End of Owner command list **
}

alias list.mastercommands {
  .notice $1 ** Master Commands ** (Board of Directors and Administration)
  .notice $1 AddOwner/DelOwner: Adds/Deletes a Specific nick to/from the Owner Database that you provide
  .notice $1 ** End of the Master command list **
}

alias list.notescommands {
  .notice $1 ** Notes ** 
  .notice $1 This script was originally writen by xDaeMoN (xdaemon@xdaemon.us)
  .notice $1 Then I (Vai $chr(91) $+ Demon1LT@yahoo.com $+ $chr(93) $+ ) Enhanced it quiet a bit. I have made the commands PM so it doesn't look unproffesional when helping users, added alot more commands, added a helper database, and much more!
  .notice $1 Don't get me wrong, the original Simple HelpBot was good, but I just thought it needed some "Flava" to it.
  .notice $1 If you use this script, please give both of xDaeMon and Vai Credit. It is possible that there may be bugs. So if so, email me at Demon1LT@yahoo.com - This script could probally be alot shorter, and still work just as good, but I didn't have time to shorten it.
  .notice $1 Happy Helping!
  .notice $1 ** End of Notes **
}