;Ircop scan by _method_
alias scanircops.dialog { dialog -m ircop ircop }
dialog ircop {
title "IRCop Scan by _MeThOd_"
size 201 105 321 287
list 71, 10 210 150 37, size
list 45, 10 20 145 177, size,vsbar
list 35, 165 45 145 152, size,vsbar
list 81, 160 210 150 37, size
box "Scan In Network:", 14, 6 5 155 195
box "Scan In Channel:", 13, 161 5 155 195
button "Scan", 19, 10 250 70 25,default
button "Scan", 16, 240 250 70 25,default
button "Close", 2, 125 247 70 28,ok
text "Chan:", 6, 165 25 30 15
combo 5, 195 20 115 100, drop, size
box "", 12, 6 200 310 80
}
on *:dialog:ircop:*:*:{
if $devent == sclick {
if $did == 2 { dialog -x ircop }
if $did == 19 { scan-ircops.net }
if $did == 16 { scan-ircops.chan }
if $did == 5 {
set %scan.chan $did(5).text
}
}
if $devent == init {
getchans
chk.connection
}
}
alias chk.connection {
if $server == $null {
did -r ircop 81,71
did -a ircop 71,81 Status: Not Connected
}
}
alias scan-ircops.net {
if $server == $null { echo -s 14-»» 4Y14ou 4A14re 4N14ot 4C14onnected 4T14o 4A 4S14erver | halt }
did -r ircop 45
did -r ircop 71
set %chk.cops 0
.disable #ircop-scan.chan
.enable #ircop-scan.net
did -ra ircop 71 Status: Scanning...
who 0 o
}
alias scan-ircops.chan {
if $server == $null { echo -s 14-»» 4Y14ou 4A14re 4N14ot 4C14onnected 4T14o 4A 4S14erver | halt }
did -r ircop 35
did -r ircop 81
set %chk.cops 0
who %scan.chan *
.disable #ircop-scan.net
.enable #ircop-scan.chan
}
#ircop-scan.chan off
raw 352:* {
did -ra ircop 81 Status: Scanning...
if (* isin $7) { did -a ircop 35 $6
inc %chk.cops
}
}
raw 315:* {
dialog -t ircop IRCop Scan ( %chk.cops IRCop's Found )
if %chk.cops == 0 { did -a IRCop 35 Status: No IRCop's Found | set %copsfound none }
.disable #ircop-scan.chan
unset %scan.chan
unset %chk.cops
if %copsfound == none { did -a ircop 81 Status: No IRCop's Found }
if %copsfound != none {
did -ra ircop 81 Status: End Of Scan
}
unset %copsfound
halt
}
#ircop-scan.chan end
#ircop-scan.net off
raw 352:* {
did -a ircop 45 $6
inc %chk.cops
halt
}
raw 315:* {
dialog -t ircop IRCop Scan ( %chk.cops IRCop's Found )
if %chk.cops == 0 { did -a IRCop 45 Status: No IRCop's Found | set %copsfound none }
unset %chk.cops
if %copsfound == none { did -a ircop 71 Status: No IRCop's Found }
if %copsfound != none {
did -ra ircop 71 Status: End Of Scan
}
unset %copsfound
.disable #ircop-scan.net
halt
}
#ircop-scan.net end
alias getchans {
set %num.chans 0
:start
inc %num.chans
if ($comchan($me,%num.chans)) {
/did -a ircop 5 $comchan($me,%num.chans)
goto start
}
unset %num.chans
if $comchan($me,0) == 0 nonechanz
}
alias nonechanz { did -b ircop 5 | did -b ircop 6 | did -r ircop 81 | did -a ircop 81 Status: Not In A Channel! }