Proffesionel HelpDesk

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

Re: Proffesionel HelpDesk

Postby Cristian » Tue May 12, 2009 2:41 pm

I have decided to use English commands, just change them into what you like.

Commands:
Administrators
    .online
    .offline
    .status <on>/<off> (turns off the .help function)
    .next <number> (default 1)
    .done <nickname>
    .queue
All
    .help <message>
    .remove
    .admins
Change:

    alias -l ::helpdesk::channel { return #channel }
    alias -l ::helpdesk::file { return helpdesk.ini }
    alias -l ::helpdesk::nospam::channel { return 10 }
    alias -l ::helpdesk::nospam::nick { return 10 }
    alias -l ::helpdesk::tag { return [Helpdesk] }
    alias -l ::helpdesk::alternatemessage { return Sorry, no one is online at this moment, please send us a mail on mail@mail.org }

Alternatemessage is used when no one is online using the .online/.offline

If you have ideas to new improvements please post them here.



Code: Select all
;# 
;# visit http://sp00fed.org for updates or support.
;# script by Sumsar
;#

;# Setup
alias -l ::helpdesk::channel { return #channel }
alias -l ::helpdesk::file { return helpdesk.ini }
alias -l ::helpdesk::nospam::channel { return 1 }
alias -l ::helpdesk::nospam::nick { return 1 }
alias -l ::helpdesk::tag { return [Helpdesk] }
alias -l ::helpdesk::alternatemessage { return Sorry, no one is online at this moment, please send us a mail on mail@mail.org }


;# Code

on *:TEXT:*:$($::helpdesk::channel):{
  set %hostname $gettok($address($nick,5),2,33)
  if ($istok($+($chr(43),.,$chr(64)),$left($nick($chan,$nick).pnick,1),46)) {
    if ($1 == .online) {
      if (!$readini($::helpdesk::file,administrators,online)) { var %online } | else { var %online = $readini($::helpdesk::file,administrators,online) }
      if (!$readini($::helpdesk::file,administrators,offline)) { var %offline } | else { var %offline = $readini($::helpdesk::file,administrators,offline) }

      if (!$matchtok(%online,%hostname,0,32)) {
        writeini -n $::helpdesk::file administrators online $+($readini($::helpdesk::file,administrators,online),$chr(32),%hostname)

        if ($matchtok(%offline,%hostname,0,32)) {
          var %offline = $remtok($readini($::helpdesk::file,administrators,offline),%hostname,32)
          if (%offline) {
            writeini -n $::helpdesk::file administrators offline %offline
          }
          else {
            remini $::helpdesk::file administrators offline
          }
        }
        msg $chan Administrator: $nick is now online.
      }
      else {
        notice $nick You are already online
      }
    }
    if ($1 == .offline) {
      if (!$readini($::helpdesk::file,administrators,online)) { var %online } | else { var %online = $readini($::helpdesk::file,administrators,online) }
      if (!$readini($::helpdesk::file,administrators,offline)) { var %offline } | else { var %offline = $readini($::helpdesk::file,administrators,offline) }

      if (!$matchtok(%offline,%hostname,0,32)) {
        writeini -n $::helpdesk::file administrators offline $+($readini($::helpdesk::file,administrators,offline),$chr(32),%hostname)
        if ($matchtok(%online,%hostname,0,32)) {
          var %online = $remtok($readini($::helpdesk::file,administrators,online),%hostname,32)
          if (%online) {
            writeini -n $::helpdesk::file administrators online %online
          }
          else {
            remini $::helpdesk::file administrators online
          }
        }
        msg $chan Administrator: $nick is now offline
      }
      else {
        notice $nick You are already offline
      }
    }
    if ($1 == .next) {
      if ($ini($::helpdesk::file,queue,0) > 0) {
        var %num = 1, %x = 1, %output, %remove
        if ($2 isnum) { if ($2 > $ini($::helpdesk::file,queue,0)) { var %num = $ini($::helpdesk::file,queue,0) } | else { var %num = $2 } }

        while (%x <= %num) {

          var %hostname = $ini($::helpdesk::file,queue,%x)
          var %message = $readini($::helpdesk::file,queue,%hostname)
          var %nickname = $ialchan($+(*!*,%hostname),$chan,1).nick
          var %remove = $addtok(%remove,%hostname,32)

          set %output %output $+($chr(2),%x,$chr(2),.) %nickname needs help with $+($chr(91),%message,$chr(93))

          if (!$readini($::helpdesk::file,next,%hostname)) {
            writeini -n $::helpdesk::file next %hostname %message
          }
          inc %x
        }
        var %x = $numtok(%remove,32)
        while (%x) {
          remini $::helpdesk::file queue $gettok(%remove,%x,32)
          dec %x
        }
        msg $chan $::helpdesk::tag $nick is available to help you.
        msg $chan $::helpdesk::tag %output
        unset %output
      }
    }
    if ($1 == .done) && ($2) {
      set %hostname $gettok($address($2,5),2,33)

      if ($readini($::helpdesk::file,next,%hostname)) {
        remini $::helpdesk::file next %hostname
        msg $chan $::helpdesk::tag $2 is done - users in queue $ini($::helpdesk::file,queue,0)
      }
    }
    if ($1 == .queue) {
      msg $chan $::helpdesk::tag Users getting help $ini($::helpdesk::file,next,0) - Users in queue $ini($::helpdesk::file,queue,0)
    }
    if ($1 == .status) {
      if ($istok(on.off,$2,46)) {
        writeini -n $::helpdesk::file status helpdesk $2
        msg $chan $::helpdesk::tag Status changed to $2
      }
      else {
        msg $chan $::helpdesk::tag Status is $readini($::helpdesk::file,status,helpdesk)
      }
    }
  }
  if (!%::helpdesk::variable::nospam:: [ $+ [ $wildsite ] ] && !%::helpdesk::variable::nospam:: [ $+ [ $chan ] ]) {
    set $+(-u,$::helpdesk::nospam::nick) %::helpdesk::variable::nospam:: [ $+ [ $wildsite ] ] 1
    set $+(-u,$::helpdesk::nospam::channel) %::helpdesk::variable::nospam:: [ $+ [ $chan ] ] 1

    if ($1 == .help) && ($readini($::helpdesk::file,status,helpdesk) == on) {
      if ($numtok($readini($::helpdesk::file,administrators,online),32) > 0) {
        if (!$readini($::helpdesk::file,queue,%hostname)) && (!$readini($::helpdesk::file,next,%hostname)) {
          if ($2) { var %message = $2- }
          writeini -n $::helpdesk::file queue %hostname %message
          msg $chan $::helpdesk::tag adding $nick to queue, users in queue $ini($::helpdesk::file,queue,0)
        }
      }
      else {
        msg $chan $::helpdesk::tag $::helpdesk::alternatemessage
      }
    }
    if ($1 == .remove) {
      set %result $::helpdesk::remove(%hostname,$chan,$nick)
    }
    if ($1 == .admins) {
      var %online, %offline

      var %z = $ini($::helpdesk::file,administrators,0)
      while (%z) {
        var %status = $ini($::helpdesk::file,administrators,%z)
        var %hostnames = $readini($::helpdesk::file,administrators,%status)
        var %x = $numtok(%hostnames,32)

        while (%x) {

          set %h $gettok(%hostnames,%x,32)
          set %n $ialchan($+(*!*,%h),$chan,1).nick
          set $+($chr(37),%status) $eval($+($chr(37),%status),2) %n
          dec %x
        }
        dec %z
      }
      if ($numtok(%online,32) == 0) {
        msg $chan $::helpdesk::tag $::helpdesk::alternatemessage
      }
      else {
        msg $chan $::helpdesk::tag Administrators: Online %online - Offline %offline
      }
    }
  }
}

on *:QUIT: { set %result $::helpdesk::remove($gettok($address($nick,5),2,33)) }
on *:PART:#: { set %result $::helpdesk::remove($gettok($address($nick,5),2,33)) }
on *:KICK:#: { set %result $::helpdesk::remove($gettok($address($knick,5),2,33)) }

alias -l ::helpdesk::remove {
  var %hostname = $1, %channel = $2, %nick = $3, %x = 0
  if ($readini($::helpdesk::file,queue,%hostname)) {
    remini $::helpdesk::file queue %hostname
    var %x = 1
  }
  if ($readini($::helpdesk::file,next,%hostname)) {
    remini $::helpdesk::file next %hostname
    var %x = 1
  }
  if (%x == 1) && ($3) {
    msg %channel $::helpdesk::tag removing %nick from queue, users in queue $ini($::helpdesk::file,queue,0)
  }
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Proffesionel HelpDesk

Postby Jerzy » Tue May 12, 2009 3:09 pm

if the file is a .mrc file im going to change:
alias -l ::helpdesk::file { return helpdesk.ini }
and call it:
alias -l ::helpdesk::file { return helpdesk.mrc }
right?
Jerzy
 

Re: Proffesionel HelpDesk

Postby zNigel- » Tue May 12, 2009 3:11 pm

Nope.. U shouldnt change that filetype.. Just change channel and it should work properly
zNigel-
 

Re: Proffesionel HelpDesk

Postby Zodac0de » Tue May 12, 2009 3:20 pm

Nice script Sumsar :)
Zodac0de
 

Re: Proffesionel HelpDesk

Postby Jerzy » Tue May 12, 2009 3:36 pm

1. got it to work, but when you're typing .queue its says example:
Users getting help 0 - Users in queue 2
it was mean it should say example: Users getting help: 1. Jerzy (I need help) - 2. Arctic^ (i need help too) Users waiting for help: 3. [JerzyBot] (i got a problem)
but if im typing .Next it says:
[17:23:51] <@[Jerzy]Bot> Jerzy is available to help you.
[17:23:51] <@[Jerzy]Bot> 1. Jerzy needs help with [hej]
wich is good, but i should do it in .queue too. and extra point in .queue is that only admin can type .Queue it was the meaning that users could type it too..

2. When you typing: .Next 2 it takes two to help, not the man who is number 2. you can see what it do:
[17:15:57] <@Jerzy> .next 2
[17:15:58] <@[Jerzy]Bot> Jerzy is available to help you.
[17:15:58] <@[Jerzy]Bot> 1. Jerzy needs help with [Hej] 2. panga-com needs help with [hej]

3. Maybe make .Done to number and nick. example: .Done <nick/number> the same with the command .Next

4. Please make a new command that just named: .Done that restarts the queue, and all is going to type .Help <problem> again (:

But all the functions works, and it's a very nice script. TY mate (:

// Jerzy
Jerzy
 

Re: Proffesionel HelpDesk

Postby Jerzy » Sat May 16, 2009 2:42 pm

you're working on it?
Jerzy
 

Re: Proffesionel HelpDesk

Postby Cristian » Sat May 16, 2009 3:42 pm

Not right now, but I have it on a to-do list.
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Proffesionel HelpDesk

Postby Lukemob » Sat May 16, 2009 3:54 pm

Hey. Rather of asking if Sumsar is working on it, pay him, and get yourself to the top at his TO-DO list.

Being professional takes a lot of time!
Lukemob
 

Re: Proffesionel HelpDesk

Postby Jerzy » Sat May 16, 2009 4:10 pm

thanks Sumsar (:
i will only pay Sumsar if he wanted money for it.
Jerzy
 

Re: Proffesionel HelpDesk

Postby Cristian » Mon Jun 01, 2009 12:07 pm

I have made some changes, not all of them.

I have made so you can type .done <nickname1> <nickname2> <nickname3>
and added .clearqueue, which clears everything.

These are the only changes I have made.

Code: Select all
;# 
;# visit http://sp00fed.org for updates or support.
;# script by Sumsar
;#


;# Commands
;#
;# Helpers
;#
;# .online
;# .offline
;# .status on/off
;# .next <number>
;# .done <nickname(s)>
;# .queue
;# .clearqueue

;# Users
;#
;# .help <message>
;# .remove
;# .admins



;# Setup
alias -l ::helpdesk::channel { return #channel }
alias -l ::helpdesk::file { return helpdesk.ini }
alias -l ::helpdesk::nospam::channel { return 1 }
alias -l ::helpdesk::nospam::nick { return 1 }
alias -l ::helpdesk::tag { return [Helpdesk] }
alias -l ::helpdesk::alternatemessage { return Sorry, no one is online at this moment, please send us a mail on mail@mail.org }


;# Code

on *:TEXT:*:$($::helpdesk::channel):{
  set %hostname $gettok($address($nick,5),2,33)
  if ($istok($+($chr(43),.,$chr(64)),$left($nick($chan,$nick).pnick,1),46)) {
    if ($1 == .online) {
      if (!$readini($::helpdesk::file,administrators,online)) { var %online } | else { var %online = $readini($::helpdesk::file,administrators,online) }
      if (!$readini($::helpdesk::file,administrators,offline)) { var %offline } | else { var %offline = $readini($::helpdesk::file,administrators,offline) }

      if (!$matchtok(%online,%hostname,0,32)) {
        writeini -n $::helpdesk::file administrators online $+($readini($::helpdesk::file,administrators,online),$chr(32),%hostname)

        if ($matchtok(%offline,%hostname,0,32)) {
          var %offline = $remtok($readini($::helpdesk::file,administrators,offline),%hostname,32)
          if (%offline) {
            writeini -n $::helpdesk::file administrators offline %offline
          }
          else {
            remini $::helpdesk::file administrators offline
          }
        }
        msg $chan Administrator: $nick is now online.
      }
      else {
        notice $nick You are already online
      }
    }
    if ($1 == .offline) {
      if (!$readini($::helpdesk::file,administrators,online)) { var %online } | else { var %online = $readini($::helpdesk::file,administrators,online) }
      if (!$readini($::helpdesk::file,administrators,offline)) { var %offline } | else { var %offline = $readini($::helpdesk::file,administrators,offline) }

      if (!$matchtok(%offline,%hostname,0,32)) {
        writeini -n $::helpdesk::file administrators offline $+($readini($::helpdesk::file,administrators,offline),$chr(32),%hostname)
        if ($matchtok(%online,%hostname,0,32)) {
          var %online = $remtok($readini($::helpdesk::file,administrators,online),%hostname,32)
          if (%online) {
            writeini -n $::helpdesk::file administrators online %online
          }
          else {
            remini $::helpdesk::file administrators online
          }
        }
        msg $chan Administrator: $nick is now offline
      }
      else {
        notice $nick You are already offline
      }
    }
    if ($1 == .next) {
      if ($ini($::helpdesk::file,queue,0) > 0) {
        var %num = 1, %x = 1, %output, %remove
        if ($2 isnum) { if ($2 > $ini($::helpdesk::file,queue,0)) { var %num = $ini($::helpdesk::file,queue,0) } | else { var %num = $2 } }

        while (%x <= %num) {

          var %hostname = $ini($::helpdesk::file,queue,%x)
          var %message = $readini($::helpdesk::file,queue,%hostname)
          var %nickname = $ialchan($+(*!*,%hostname),$chan,1).nick
          var %remove = $addtok(%remove,%hostname,32)

          set %output %output $+($chr(2),%x,$chr(2),.) %nickname needs help with $+($chr(91),%message,$chr(93))

          if (!$readini($::helpdesk::file,next,%hostname)) {
            writeini -n $::helpdesk::file next %hostname %message
          }
          inc %x
        }
        var %x = $numtok(%remove,32)
        while (%x) {
          remini $::helpdesk::file queue $gettok(%remove,%x,32)
          dec %x
        }
        msg $chan $::helpdesk::tag $nick is available to help you.
        msg $chan $::helpdesk::tag %output
        unset %output
      }
    }
    if ($1 == .done) && ($2) {
      if ($numtok($2-,32) > 1) {
        var %x = $numtok($2-,32), %n
        while (%x) {
          var %nickname = $gettok($2-,%x,32)
          if (%nickname ison $chan) {
            set %hostname $gettok($address(%nickname,5),2,33)
            if ($readini($::helpdesk::file,next,%hostname)) {
              remini $::helpdesk::file next %hostname
              var %n = $addtok(%n,%nickname,32)
            }
          }
          dec %x
        }
        msg $chan $::helpdesk::tag %n is done - users in queue $ini($::helpdesk::file,queue,0)
      }
      else {
        set %hostname $gettok($address($2,5),2,33)
        if ($readini($::helpdesk::file,next,%hostname)) {
          remini $::helpdesk::file next %hostname
          msg $chan $::helpdesk::tag $2 is done - users in queue $ini($::helpdesk::file,queue,0)
        }
      }
    }
    if ($1 == .queue) {
      msg $chan $::helpdesk::tag Users getting help $ini($::helpdesk::file,next,0) - Users in queue $ini($::helpdesk::file,queue,0)
    }
    if ($1 == .clearqueue) {
      msg $chan $::helpdesk::tag Clearing queue
      remini $::helpdesk::file next
      remini $::helpdesk::file queue
      msg $chan $::helpdesk::tag Users getting help $ini($::helpdesk::file,next,0) - Users in queue $ini($::helpdesk::file,queue,0)
    }

    if ($1 == .status) {
      if ($istok(on.off,$2,46)) {
        writeini -n $::helpdesk::file status helpdesk $2
        msg $chan $::helpdesk::tag Status changed to $2
      }
      else {
        msg $chan $::helpdesk::tag Status is $readini($::helpdesk::file,status,helpdesk)
      }
    }
  }


  if (!%::helpdesk::variable::nospam:: [ $+ [ $wildsite ] ] && !%::helpdesk::variable::nospam:: [ $+ [ $chan ] ]) && ($readini($::helpdesk::file,status,helpdesk) == on) {
    set $+(-u,$::helpdesk::nospam::nick) %::helpdesk::variable::nospam:: [ $+ [ $wildsite ] ] 1
    set $+(-u,$::helpdesk::nospam::channel) %::helpdesk::variable::nospam:: [ $+ [ $chan ] ] 1

    if ($1 == .help) {
      if ($numtok($readini($::helpdesk::file,administrators,online),32) > 0) {
        if (!$readini($::helpdesk::file,queue,%hostname)) && (!$readini($::helpdesk::file,next,%hostname)) {
          if ($2) { var %message = $2- }
          writeini -n $::helpdesk::file queue %hostname %message
          msg $chan $::helpdesk::tag adding $nick to queue, users in queue $ini($::helpdesk::file,queue,0)
        }
      }
      else {
        msg $chan $::helpdesk::tag $::helpdesk::alternatemessage
      }
    }
   if ($1 == .version) {
      msg $chan $::helpdesk::tag Script created by the sp00fed community
    }
    if ($1 == .remove) {
      set %result $::helpdesk::remove(%hostname)
      msg $chan $::helpdesk::tag removing $nick from queue, users in queue $ini($::helpdesk::file,queue,0)
    }
    if ($1 == .admins) {
      var %online, %offline

      var %z = $ini($::helpdesk::file,administrators,0)
      while (%z) {
        var %status = $ini($::helpdesk::file,administrators,%z)
        var %hostnames = $readini($::helpdesk::file,administrators,%status)
        var %x = $numtok(%hostnames,32)

        while (%x) {

          set %h $gettok(%hostnames,%x,32)
          set %n $ialchan($+(*!*,%h),$chan,1).nick
          set $+($chr(37),%status) $eval($+($chr(37),%status),2) %n
          dec %x
        }
        dec %z
      }
      if ($numtok(%online,32) == 0) {
        msg $chan $::helpdesk::tag $::helpdesk::alternatemessage
      }
      else {
        msg $chan $::helpdesk::tag Administrators: Online %online - Offline %offline
      }
    }
  }
}

on *:QUIT: { set %result $::helpdesk::remove($gettok($address($nick,5),2,33)) }
on *:PART:#: { set %result $::helpdesk::remove($gettok($address($nick,5),2,33)) }
on *:KICK:#: { set %result $::helpdesk::remove($gettok($address($knick,5),2,33)) }

alias -l ::helpdesk::remove {
  set %hostname $1
  if ($readini($::helpdesk::file,queue,%hostname)) {
    remini $::helpdesk::file queue %hostname
  }
  if ($readini($::helpdesk::file,next,%hostname)) {
    remini $::helpdesk::file next %hostname
  }
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

PreviousNext

Return to Mirc Scripting Request

Who is online

Users browsing this forum: No registered users and 0 guests

cron