
;--------ON START--------------------------------


;-------------------------------------------
;------        IRC OP Scan         ------  
;-------------------------------------------

alias ircop.scan { if $dialog(ircop.s) == $null) { unset %cbd | dialog -m ircop.s ircop.s } }
dialog ircop.s {
  title ""
  size -1 -1 270 300
  text "", 5, 5 40 190 20
  text "IRCop(s) sur un salon", 6, 145 40 190 20
  text "Salon à scanner", 7, 158 195 130 100
  combo 10, 158 210 100 100, drop
  box "", 140, 5 50 120 210
  list 9, 10 70 110 140,autohs
  box "", 141, 145 50 120 210
  list 8, 150 70 110 140, autohs
  button "Parler en privé", 18, 10 210 108 20
  button "Rafraichir", 19, 10 230 108 20,default
  button "Scanner", 16, 187 235 70 20
  button "Fermer", 2, 5 267 70 25, ok
}
on *:dialog:ircop.s:edit:*:{ if ($did == 10) { set %cbd $did(ircop.s,10).text } }
on *:dialog:ircop.s:init:*:{ dialog -t ircop.s $network IRCop Scan par Dj Dgé | did -o ircop.s 5 1 IRCop(s) sur $server | chan.l | ircop.s1 | did -c ircop.s 10 1 }
on *:dialog:ircop.s:sclick:*:{ if ($did == 1) unset %cbd | if ($did == 16) ircops.chan | if ($did == 18) if ($did(9,$did(9).sel) != $null) query $did(9,$did(9).sel) | if ($did == 19) { ircop.s1 } }
on *:dialog:ircop.s:dclick:*:{ if ($did == 9) { query $did(9,$did(9).sel) } } 
alias ircop.s1 { did -r ircop.s 9 | .disable #ircopscan.chan | .enable #ircop-scan.net |  who 0 o }
#ircopscan.chan off
raw 315:*: .disable #ircopscan.chan | halt 
raw 352:*: if (* isin $7) did -a ircop.s 8 $6 | halt
#ircopscan.chan end
#ircop-scan.net off
raw 315:*: .disable #ircop-scan.net | halt 
raw 352:*: if ($dialog(ircop.s) != $null) { did -a ircop.s 9 $6 | halt }
#ircop-scan.net end
alias ircops.chan { did -r ircop.s 8 | .who $did(ircop.s,10).text | .enable #ircopscan.chan }
alias chan.l { var %channum = 0 | :findchan | inc %channum 1 | var %chan = $chan(%channum) | if (%chan == $null) { goto end } | did -i ircop.s 10 1 %chan | goto findchan | :end }
