Query Dialog
Page 1 of 1
Query Dialog
Has features such ass
- Ignore list
- Auto accept list
- Flood control
- Message Viewing
- Common channel Viewer
- 1 time flood message
- Code:
menu c* {
-
Query Settings:qset
-
}
alias qset dialog -mo Querys Querys
dialog Querys {
title "Query Settings V1.0"
size -1 -1 117 106
option dbu
radio "Query Control On", 1, 2 9 55 10
radio "Query Control Off", 2, 2 22 55 10
box "Query Control", 3, 0 0 60 35
list 4, 5 55 50 50, size
list 5, 63 55 50 50, size
text "Auto Accept List", 6, 9 46 41 8
text "Query Ignore List", 7, 66 46 44 8
button "Open Query Manager", 8, 61 3 55 10
edit "Nick", 9, 24 36 70 10, autohs center
button "Add to AutoAccept", 10, 61 14 55 10
button "Add to AutoIgnore", 11, 61 25 55 10
}
alias qup {
var %x 1
did -r Querys 4
while ($gettok(%aa,%x,32)) {
did -a Querys 4 $v1
inc %x
}
if (%queryon) did -c Querys 1
else did -c Querys 2
var %x 1
did -r Querys 5
while ($ignore(%x)) {
if (private == $ignore(%x).type) did -a Querys 5 $bef(!,$ignore(%x)) $iif($ignore(%x).secs,$duration($v1))
inc %x
}
}
alias bef {
tokenize $asc($1) $2-
return $1
}
on *:dialog:Querys:*:*: {
tokenize 32 $did(9).text
if ($devent == init) qup
if ($devent == sclick) {
if ($did == 4) { $iif($?!"Do you want to delete this item?",remqur $did(4).seltext aa) | qup }
if ($did == 5) { $iif($?!"Do you want to delete this item?",.ignore -r $bef($chr(32),$did(5).seltext)) | qup }
if ($did == 1) set %queryon on
elseif ($did == 2) unset %queryon
if ($did == 8) { dialog -mo Query Query | rfs }
if ($did == 10) {
if (!$ignore($1)) .ignore -r $1
remqur $1 aa
set %aa %aa $1
qup
}
if ($did == 11) {
if ($1 isin %aa) remqur $1 aa
.ignore -p $1
qup
}
}
}
dialog Query {
option dbu
title "Query Manager"
size -l -l 151 100
list 1, 5 50 140 40,hsbar
button "Accept" 2, 1 5 50 10,disabled
button "Deny" 3, 51 5 50 10,disabled
Button "Ignore" 4, 101 5 50 10, disabled
Button "Add to auto accept list" 6, 30 15 90 10, disabled
Button "Deny All" 7, 5 80 70 10
Button "Accept All" 8, 75 80 74 10
text "", 10, 5 30 140 20
}
alias rfs {
if (!%query) did -ra Query 1
var %x $gettok(%query,0,32)
while (%x) {
did $+(-,$iif(%x == $gettok(%query,0,32),r),a) Query 1 $gettok(%query,%x,32) $iif($remove($address($gettok(%query,%x,32),0),*,!),$+($chr(40),$v1,$chr(41)),$+($chr(40),No Address Found,$chr(41)))
dec %x
}
}
alias qupdate {
allch b
did -f Query 1
rfs
did -ra Query 10
}
alias remqur {
var %x 1
tokenize 32 $1 $iif($2,$remove($v1,$chr(37)),query)
while ($gettok($eval(% $+ $2,3),%x,32)) {
if ($v1 != $1) var %newq %newq $v1
inc %x
}
set $eval(% $+ $2,1) %newq
}
on *:dialog:Query:*:*: {
if ($devent == sclick) {
tokenize 32 $did(1).seltext
if ($did == 1) && ($1) { allch e | .timer 1 1 noop $tip(Message,Information: $1,14Message:7 $hget(truemsg,$1) $crlf 14Common Channels:2 $comchan($1,0) $iif($comchan($1,1),- $v1) $iif($comchan($1,2),- $v1) $iif($comchan($1,3),- $v1) ) }
if ($did == 8) {
var %x $gettok(%query,0,32)
while (%x) {
tokenize 32 $gettok(%query,%x,32)
Query $1 Your request for a query has been accepted!
remqur $1
qupdate
dec %x
}
}
if ($did == 7) {
var %x $gettok(%query,0,32)
while (%x) {
tokenize 32 $gettok(%query,%x,32)
.msg $1 Your request for a query has been denied! Please try again in 5 minutes.
remqur $1
.ignore -u300p $1
qupdate
dec %x
}
}
if ($did == 6) {
Query $1 Your request for a query has been accepted!
remqur $1
qupdate
Set %aa %aa $1 $address($1,0)
}
if ($did == 4) {
remqur $1
.ignore -p $1
qupdate
}
if ($did == 2) {
Query $1 Your request for a query has been accepted!
remqur $1
qupdate
}
if ($did == 3) {
.msg $1 Your request for a query has been denied! Please try again in 5 minutes.
remqur $1
.ignore -p $1 300
qupdate
}
}
}
alias -l allch {
var %x 1
while (%x <= 4) {
did $+(-,$1) $dname $gettok(2 3 4 6,%x,32)
inc %x
}
}
alias nquery {
if (!$dialog(Query)) dialog -mo Query Query
if ($gettok(%query,0,32) < 5) || (!$gettok(%query,0,32)) {
set %query %query $1
rfs
.msg $1 Please wait while i decide to accept your query! $iif($away,I am currently away so it may take a while. My current idle time is: $duration($idle))
}
else {
did -ra Query 10 Emergency flood query control has been triggered, Please accept or deny some of your queries before you may accept any others!
rfs
}
}
on ^*:open:?:*: {
if (%Queryon) {
hadd -m Truemsg $nick $1-
if ($istok(%aa,$nick,32)) || ($istok(%aa,$iif($address($nick,0),$v1,all),32)) { query $nick Your query has been auto accepted! | goto finish }
if ($nick !isin %query) || (!%Query) { nquery $nick | hadd -m Truemsg $nick $1- }
halt
}
:finish
}
Termz- Posts : 11
Join date : 2010-02-17
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|