online/offline checker
Added by Q Steinberg almost 5 years ago
You have this brilliant option on AdiIRC that displays a message alert when the person I'm chatting with (in private) goes offline.
However, there's a script that shows an alert when the user I'm chatting with goes offline and another alert message when they come back online (also displays in private window). But it's not working with AdiIRC.
All I need from this script is the "online message alert" when the user is back on chat. Hope there's a way to make it work.
/*
[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,ison_,$network),2),%num,5)) {
while ($gettok($($+(
if (!$istok($1,$gettok($($+(,ison_,$network),2),%num,5),32)) &x%x (!$($+(,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 },$gettok($($+(,ison_,$network),2),%num,5),32)) &x%x ($($+(,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))) }
if ($istok($1
inc num
}
unset $+(,isonchk_,$network)
halt
}
}
Replies (12)
RE: online/offline checker - Added by Paul Janson almost 5 years ago
It's a beast trying to read your code because it's not formatted. For example, I see a lot of lines with strike-out.
When you click 'reply', the editbox has several icons, and one of them says "PRE". Click on that, and you get a couple bracked symbols. Paste your code between the open/close PRE symbols, then click on "preview", and you can see it's much easier to read.
RE: online/offline checker - Added by Q Steinberg almost 5 years ago
/* [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 } }
RE: online/offline checker - Added by Paul Janson almost 5 years ago
It's a minor bug that I'm sure will be fixed soon. In the meantime, you can sanitize the $1- to behave like mIRC does. The server sends a colon touching the nick being checked, and mirc removes it, so this script is checking for 'othernick' but the 303 is returning :othernick
so can change the raw 303 handler section to be like:
raw 303:*:{ if ($($+(%,isonchk_,$network),2)) { var %num 1 , %1- $remove($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 } }
RE: online/offline checker - Added by Q Steinberg almost 5 years ago
After I updated my AdiIRC today, I keep getting this notice (on the server window) whenever I receive a new private message.
The notice says: * Unset %query.flood
What is it, and is there a way to stop receiving it?
RE: online/offline checker - Added by Q Steinberg almost 5 years ago
No solution for the (* Unset %query.flood) issue?
RE: online/offline checker - Added by Per Amundsen almost 5 years ago
I am not seeing that variable being unset in this script, but look for something like unset -s %query in your other scripts.. and remove the -s part.
RE: online/offline checker - Added by Q Steinberg almost 5 years ago
Couldn't find anything with -s %query in any of my scripts
RE: online/offline checker - Added by Per Amundsen almost 5 years ago
That message comes from a /unset command with the -s parameter, so remove -s from any unset you find.
RE: online/offline checker - Added by Q Steinberg almost 5 years ago
I did, but I still get this disturbing notice.
It only started to happen when I updated my adiirc
RE: online/offline checker - Added by Per Amundsen almost 5 years ago
Forgot there is also /set -u, check if you have any /set -us and remove the -s part.
Edit: Try remove -s from any /set command.
RE: online/offline checker - Added by Q Steinberg almost 5 years ago
I don't have any script with this command