Coders-IRC
IRC for Coders
Query Ison Checker
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
}
}Access control in Chat, how to keep an eye on JOIN and PART
Being part of the user support of the ircIRCgate.it network and being simultaneously present in many chan, I often happen to "not" notice when some user enters the support channel #IRChelp, to overcome this inconvenience I used two simple but effective stratagems, the first consists of a script that, when a user joins in the support chan, it says me in echo (so I read it only me, in any channel or pvt I find ..) " IRChelp records a JOIN by TIZIO and the second, if I am not physically in front of the PC, and then there was the possibility that deto message escapes me, brings me back in a separate @ window, all the JOIN on the support channel with a lot of nick time and user address .. (also useful as "access statistics".. but let's come to the code:
on *:JOIN:#irchelp: {
window @irchelp
/echo @irchelp [ 9 $asctime(HH:nn:ss) ] [ 9 #IRChelp ] Register a [ 9 JOIN ] by [ 9 $nick - $address($nick,2) ]
}
on *:P ART:#irchelp: {
window @irchelp
/echo @irchelp [ 9 $asctime(HH:nn:ss) ] [ 4 #IRChelp ] Record a [ 4 PART ] by [ 4 $nick - $address($nick,2) }
on *:JOIN:#IRChelp: {
/echo -a [ 9 $asctime(HH:nn:ss) ] [ 9 #IRChelp ] Register a [ 9 JOIN ] by [ 9 $nick - $address($nick,2) ]
}
on *:P ART:#IRCHelp: {
/echo -a [ 9 $asctime(HH:nn:ss) ] [ 4 #IRChelp ] Records a [ 4 PART ] by [ 4 $nick - $address($nick,2) ]
}Query Manager - Accept or Reject messages in private!
on 1:OPEN:?:*:{
set %query.nick $nick
set %query.address $address($nick,1)
set %query.text $1-
close -m $nick
.msg $nick Query Manager: Wait, I have to decide whether or not to accept your Pvt...
query.decide
}
alias -l query.decide {
dialog -m Query Query
}
dialog Query {
title "Query"
size 300 250 200 50
option dbu
text "Nick:", 2, 5 12 12 10, nowrap
text "Text:", 3, 5 22 12 10, nowrap
edit %query.nick %query.address, 4, 20 10 170 10, read
edit %query.text, 5, 20 20 170 10, read
button "Accept", 6, 25 32 40 15
button "Reject", 7, 75 32 40 15
button "Ignore", 8, 125 32 40 15
}
on 1:dialog:Query:*:* {
if ($devent == sclick) {
if ($did == 6) {
dialog -x Query Query
query %query.nick
echo -t %query.nick < $+ %query.nick $+ > %query.text
.msg %query.nick Query Manager : Your Pvt Has Been Accepted!
unset %query.*
}
if ($did == 7) {
dialog -x Query Query
.msg %query.nick Query Manager : Your Pvt Was Rejected!
unset %query.*
}
if ($did == 8) {
dialog -x Query Query
ignore -p %query.nick
.msg %query.nick Query Manager : Your Pvt was Rejected and I Put You in Ignore!
unset %query.*
}
}
}