Query Responder

By CadetAndrew on Nov 27, 2009

This script is very simple, it will respond to someone after they query you.

No commands to it, again it's real simple, but effective, it even includes flood protection!

Enjoy.

on *:OPEN:?:*: {
  if ($nick != $me) {
    if (!%flood) {
      var -u6 %flood flood 
      msg $nick Hey12 $nick $+ ! You have reached4 $me $+ .
      msg $nick I have5 $query(0) $+  query/ies open, and have been idle for10 $duration($idle) $+ . 
      if ($away == $false) { msg $nick I am not currently away now, so I will try to get back with you as soon as possible. }
      elseif ($away == $true) { msg $nick 4I am currently away at the moment, but I will see your query as soon as I return and try to get back to you. }
      msg $nick 4REMINDER: If this is urgent you can always send me a memo by typing /msg MemoServ SEND $me <message>
      msg $nick 4NOTE: This was an automated query message.
    }
  }
}

Comments

Sign in to comment.
sunslayer   -  Nov 28, 2009

I fail to see your flood protection.

var -u6 %flood flood

sets %flood for 6 seconds before it is unset and

if (!%flood) {

prevents the code from processing if %flood is $true

if ($nick !== $me)

you can simply use the ! event prefix instead of the /if
and @Master-Of-Death

on *:OPEN:?:*:{ if ($away == $true) {
.halt
.msg $nick I am away, I'll respond when I can. [amsg]
}
elseif ($away == $false) {
.msg $nick I have been idle for $duration($idle) i'll respond when I return. [amsg]
}
}

will only trigger if the person is not away, /halt stops all processing of the script so

.msg $nick I am away, I'll respond when I can. [amsg]

will never trigger.
there is no need to silince /halt either as it doesn't output anything anyways
also instead of using

if ($away == $true)

and

($away == $false)

you can shorten it with the '!' to negate it

if ($away)

and

if (!$away)
 Respond  
Master-Of-Death   -  Nov 28, 2009

I fail to see your flood protection.

why have you got

if ($nick !== $me)

seems rather pointless, who queries themselves?
also why do they need to know how many query windows you have open?
this would have been better.

on *:OPEN:?:*:{ if ($away == $true) { 
.halt
.msg $nick I am away, I'll respond when I can. [amsg]
}
elseif ($away == $false) { 
.msg $nick I have been idle for $duration($idle) i'll respond when I return. [amsg]
}
}

Sorry but 1/10

 Respond  
Hamed Crow   -  Nov 27, 2009

This is not code related:
What's the point of telling the user to send you a memo if you're going to see the query?

Code related (Improvement?):

You could have used this instead:

if ($away) { ;if $away == $true
;code
}

else { ;else $away == false
;code
}


I like it! ^^

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.