Simple Idle Command

By Dicaste on Jul 02, 2011

Add this snippets to your bot then write "!idle [NICK]" in channel and bot say it :d

on ^*:TEXT:!idle*:#:{
if ( $Nick isop $chan ) {
    set %Channel $chan
    set %Nick $strip($2)
    if ( %Nick != $Null ) {
      .whois %Nick
    }
  }
}

RAW 317:*:{ 
  msg %Channel %Nick idling for $round($calc($gettok($1-,3,32) /60),0) min(s) $gettok($round($calc($gettok($1-,3,32) /60),2),2,46) second(s) 
}

Comments

Sign in to comment.
napa182   -  Jul 03, 2011

well if you wanted to use the $nick(#,nick_here).idle then you could do something like this i guess...
client that is running the code needs to be +o in the chan an users need to be either +o or +h to use it
This is only an example:

on $@*:text:/^@idle\s(\S+)$/iS:#:{ 
  if (!%f && $nick(#,$nick,oh)) { inc -u5 %f
    msg # $iif($regml(1) ison #,$+($v1,'s) Idle time in # is$&
      $duration($nick(#,$v1).idle,1),Sorry $v1 is not in this room) 
  }
}

or if you want to do the whois way you could do this..
example only

on $@*:text:/^@idle\s(\S+)$/iS:#:{ 
  if (!%f && $nick(#,$nick,oh)) { set -u5 %f #
    if ($regml(1) ison #) {
      .enable #idle
      whois $v1
    }
    else { msg # Sorry but $v1 is not on this channel. }
  }
}
#idle off
raw *:*: {
  if ($numeric = 317) {
    msg %f $2's idle time is $duration($3,1) 
    haltdef
    .disable #idle
  }
  else { haltdef } 
}
#idle end
 Respond  
Fuzionx   -  Jul 03, 2011

Yeah, I mentioned that. Perhaps it's even better for a script like this.

 Respond  
napa182   -  Jul 03, 2011

well using a whois gives the idle time of a nick from the server an using $nick(#,nick_here).idle will return the nicks idle in a room from when you joined it. 2 different things tbh.

 Respond  
Fuzionx   -  Jul 03, 2011

You can use

$duration($nick($chan,NICKNAME).idle)

To get the idle time of a person, in this case, replace NICKNAME with $2.
Although, this will return the idle time in the active channel.

 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.