Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

!idle trigger and $getnickidle() identifier

Recommended Posts

  • Administrators
!idle trigger for bots.

 

takes input as follows:

 

!idle [channel]

 

returns idle time of nick on channel. if you don't specify a channel, it defaults to the channel where the event was triggered.

 

as usual: there's probably better/shorter/simpler/easier ways, but meh, I'm bored, so I thought I might as well code something.

 

 

 

 

 

instructions for the $getnickidle() identifier, in case you like to use that by itself for something...

 

$getnickidle takes 2 parameters: a nickname and a channel name, and returns the idle time for specified nickname on the specified channel.

 

format:

 

$getnickidle(nickname,channel)

 

on *:TEXT:!idle*:#: {

   if ($2 == $null) {

      /msg $chan you must supply a nickname and optionally a channel.

   }

   else {

      if ($3 == $null) {

         if ($2 ison $chan) {

            /msg $chan $2 has been idle on $chan for $getnickidle($2,$chan) $+ .

         }

         else {

            /msg $chan $2 is not on $chan $+ .

         }

      }

      elseif ($me ison $3) {

         if ($2 ison $3) {

            /msg $chan $2 has been idle on $3 for $getnickidle($2,$3) $+ .

         }

         else {

            /msg $chan $2 is not on $3

         }

      }

      else {

         /msg $chan I am not on $3 $+ .

      }

   }

}

 

 

 

alias getnickidle {

   /var %x 0

   :getnickidleloop

   /inc %x

   if (%x == $nick($2,$1)) {

      /return $duration($nick($2,%x).idle)

   }

   else {

      if (%x 

Link to comment
Share on other sites



×
×
  • Create New...