Coders-IRC


IRC for Coders

Query Ison Checker


image

This script checks to see if the person you have a query open with is still online. When someone you have a query open with goes offline a message will appear in that window alerting you of that. If the person comes back online it will also notify you in that case.

Details:
The script checks every 30 seconds to see if nicks are online
When a nick is offline it will only echo to the query window once every 30 minutes if they are still offline
This script will work for as many nicks as the particular network supports with the ison command, Rizon supports at least 8


By PBall

[Addon]
Script=Checks if Query nick is still online
Version=1
Author=pball
Desc=This script echos a message to a query window if that nick goes offline while the window is open
For=Mirc
Date=3-25-11

[script]
*/
on *:open:?:*:{
  set $+(%,ison_,$network) $addtok($($+(%,ison_,$network),2),$nick,5)
  if (!$timer($network)) .timerison_ $+ $network 0 30 isonchk
}

on *:ACTIVE:?:{
  set $+(%,ison_,$network) $addtok($($+(%,ison_,$network),2),$target,5)
  if (!$timer($network)) .timerison_ $+ $network 0 30 isonchk
}

alias isonchk {
  set -l %num 1
  while ($gettok($($+(%,ison_,$network),2),%num,5)) {
    if (!$query($gettok($($+(%,ison_,$network),2),%num,5))) set $+(%,ison_,$network) $remtok($($+(%,ison_,$network),2),$gettok($($+(%,ison_,$network),2),%num,5),1,5)
    inc %num
  }
  if (!$($+(%,ison_,$network),2)) { .timerison_ $+ $network off | halt }
  set $+(%,isonchk_,$network) 1
  ison $replace($($+(%,ison_,$network),2),$chr(5),$chr(32))
}

on *:close:?: {
  set $+(%,ison_,$network) $remtok($($+(%,ison_,$network),2),$nick,1,5)
  if ($($+(%,ison_,$network),2) == $null) .timerison_ $+ $network off
  if ($($+(%,ison_,$network,$nick),2)) unset $+(%,ison_,$network,$nick)
}

raw 303:*:{
  if ($($+(%,isonchk_,$network),2)) {
    set -l %num 1
    while ($gettok($($+(%,ison_,$network),2),%num,5)) {
      if (!$istok($1-,$gettok($($+(%,ison_,$network),2),%num,5),32)) && (!$($+(%,ison_,$network,_,$gettok($($+(%,ison_,$network),2),%num,5)),2)) { echo 4 -t $gettok($($+(%,ison_,$network),2),%num,5) $gettok($($+(%,ison_,$network),2),%num,5) is offline | set -u1800 $+(%,ison_,$network,_,$gettok($($+(%,ison_,$network),2),%num,5)) off }
      if ($istok($1-,$gettok($($+(%,ison_,$network),2),%num,5),32)) && ($($+(%,ison_,$network,_,$gettok($($+(%,ison_,$network),2),%num,5)),2)) { echo 11 -t $gettok($($+(%,ison_,$network),2),%num,5) $gettok($($+(%,ison_,$network),2),%num,5) is online | unset $($+(%,ison_,$network,_,$gettok($($+(%,ison_,$network),2),%num,5))) }
      inc %num
    }
    unset $+(%,isonchk_,$network)
    halt
  }
}

Comments 0