PuNkTuReD commented on a Page, (v)Host getter  -  Jun 10, 2009

i know this can be alot neater with $iif's etc etc etc but so Kirbeh_Pr0nz could get a look at it, ive kept it simple.

menu * {
  Host Getter: dialog -dm vhost vhost
}
dialog vhost {
  title "Host Getter :)"
  size -1 -1 175 132
  option dbu
  list 1, 1 12 60 45, sort size vsbar
  text "Channels List:", 2, 3 5 48 7
  list 3, 114 12 60 45, sort size vsbar
  text "Nicks in selected channel:", 4, 108 5 64 7
  edit "", 5, 34 95 102 29, read multi
  text "Host of selected nick:", 6, 35 88 59 8
  button "Get Host", 7, 115 58 50 12
  button "Get Nicks ", 8, 2 58 50 12
  button "Done", 9, 140 116 31 12, flat multi ok cancel
}
on *:dialog:vhost:*:*: {
  var %a = $devent, %b = $did
  if (%a == INIT) { fill.chans }
  if (%a == SCLICK) {
    if (%b == 8) { $iif(($did(1).seltext),fill.nicks $did(1).seltext,echo -a ***** Please select a channel.) }
    if (%b == 7) { $iif(($did(3).seltext),did -ra vhost 5 $address($did(3).seltext,2),echo -a ***** Please select a nick.) }
    if (%b == 9) { dialog -x vhost vhost }
  }
}
alias fill.chans {
  did -r vhost 1
  var %a = $chan(0)
  while (%a) { did -a vhost 1 $chan(%a) | dec %a }
}
alias fill.nicks {
  did -r vhost 3
  var %a = 1, %b = $nick($$1,0)
  while (%a <= %b) { did -a vhost 3 $nick($$1,%a) | inc %a }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.