dialog QueryBlocker {
title "Query Control"
size -1 -1 172 54
option dbu
button "Accept", 1, 24 37 37 12
button "Decline", 2, 67 37 37 12
button "Ignore", 3, 110 37 37 12
text "", 4, 24 5 123 28
text "V1.0", 5, 159 46 13 8, disable
}
menu Status,Channel,MenuBar,Query {
-
$iif($group(#qc) == on,$style(1)Disable,$style(0)Enable) Use Query Control: {
var %status = $iif($group(#qc) == on,Disable,Enable)
$+(.,%status) #qc
echo -ta 14Query control has been04 $+(%status,d,14.)
}
-
}
menu Query {
$iif($hget(QueryBlocker,$address($active,3)),$style(1),$style(0)) Auto-Accept queries from $active: {
var %status = $iif($hget(QueryBlocker,$address($active,3)) = 1,Del,Add)
$+(h,%status) QueryBlocker $address($active,3) 1
echo -ta $+(04,$active) 14 has been04 $iif(%status = del,deleted from,added to) 14Auto-Accept.
}
}
#qc on
on *:OPEN:?:{
%QC.nick.address = $address($nick,3)
%QC.nick = $nick
if ($hget(QueryBlocker,%QC.nick.address)) {
.msg $nick PM Auto-Accepted. $iif($away,I may not reply as I am currently away.)
echo -ta 14Query Control: 04Auto-Accept from ' $+ $nick $+ '.
}
elseif (!$hget(QueryBlocker,%QC.nick.address)) {
if ($dialog(QueryBlocker)) { .msg $nick I currently have a que of PMs. If this is important please try again later or send me a memo. /ms send $me yourmessage | halt }
window -h $nick
.msg $nick Please wait for your query to be accepted/declined.
dialog -mo QueryBlocker QueryBlocker
did -ra QueryBlocker 4 %QC.nick ( $+ %QC.nick.address $+ ) has PMed you. Do you want to accept, decline or ignore?
}
}
on *:exit:{
hsave -s QueryBlocker QueryBlocker.hsh
}
on *:start:{
hmake QueryBlocker 100
if ($exists(QueryBlocker.hsh)) {
hload -s QueryBlocker QueryBlocker.hsh
}
}
#qc end
on *:dialog:QueryBlocker:sclick:1:{
window -w %QC.nick
window -a %QC.nick
.msg %QC.nick I have accepted you PM. You do not have to repeat your last message as I can see it already. $iif($away,I may not reply as I am currently away.)
dialog -x QueryBlocker
if ($?!"Do you want to add this user ( $+ %QC.nick $+ ) to your auto-accept list?") addexc %QC.nick.address
unset %QC.nick
}
on *:dialog:QueryBlocker:sclick:2:{
.msg %QC.nick I have declined your Private Message. A 2 minute ignore has been put on your nick for private messages to prevent abuse.
.ignore -pu120 %QC.nick
close -m %QC.nick
dialog -x QueryBlocker
unset %QC.*
}
on *:dialog:QueryBlocker:sclick:3:{
msg %QC.nick Private Message Declined. You have been ignored.
.ignore -pu1200 %QC.nick.address
close -m %QC.nick
dialog -x QueryBlocker
unset %QC.*
}
alias addexc {
if (!$hget(QueryBlocker)) hmake QueryBlocker 100
hadd QueryBlocker %QC.nick.address 1
echo -ta 14Query Control:04 Added ' $+ $address(%QC.nick,3) $+ ' to auto-accept list.
}