(v)Host getter

By Kirbeh_Pr0nz on Jun 10, 2009

Simple (v)Host retriever in dialog form. i made the dialog, PunkTuReD coded everything else, cuz im kinda newbish still at that part.
put in remotes.
enjoi

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 = $dname, %b = $devent, %c = $did
  if (%b == INIT) { fill.chans }
  if (%b == SCLICK) {
    if (%c == 8) { 
      if ($did(1).seltext) { fill.nicks $did(1).seltext }
      else { echo -a ***** Please select a channel. }
    }
    if (%c == 7) { 
      if ($did(3).seltext) { fill.host $did(3).seltext }
      else { echo -a ***** Please select a nick. }
    }
    if (%c == 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 {
  var %a = 1
  var %b = $nick($$1,0)
  did -r vhost 3
  while (%a <= %b) { did -a vhost 3 $nick($$1,%a) | inc %a }
}
alias fill.host { did -ra vhost 5 $address($$1,2) }

Comments

Sign in to comment.
blitzz   -  Jun 13, 2009

Just what i thought.

 Respond  
PuNkTuReD   -  Jun 13, 2009

this is how it works.

open the dialog.
choose a channel and click Get Nicks.
choose a nick and click Get vHost.

so, yes it does not get offline users info, only online users.
and only those who are in he rooms your in.

 Respond  
blitzz   -  Jun 12, 2009

Ermm am i mistake or not i dont know. when i try it, it just show (v)host from online users. DALnet, nusantaraku, kampungchat,... i compare with online nick and offline nick and only host from online nick were appear.

 Respond  
PuNkTuReD   -  Jun 12, 2009

the only 3 identifiers it uses are
$nick $chan and $address
most servers support them, so there is no need to say where it works because we would have to list almost every server out there.

we never said what server it was made on, so how do you know you tried it on "another" server? what server did you try it on?

ill look into it.

 Respond  
blitzz   -  Jun 11, 2009

yes. but maybe add some note there that this only works in blablabla. i've try it in another server and not working.

 Respond  
PuNkTuReD   -  Jun 11, 2009

yea but with whois, you get a whole pile of unwanted info if all your after is the vhost.

 Respond  
blitzz   -  Jun 10, 2009

no different between /whois

 Respond  
PuNkTuReD   -  Jun 10, 2009

lol i did Kirbeh_Pr0nz, but this is your snippet to udate m8.

 Respond  
Kirbeh_Pr0nz   -  Jun 10, 2009

got that punktured? :P
btw WorldDMT, why do you always

post comments like

4 enter spaces for each line

of comments?

 Respond  
WorldDMT   -  Jun 10, 2009

hi

better dont use "menu *" une "menu nicklist,menubar,channel,status" because if any one use this code and he have a game picwin he will get "Host Getter" and that is not in place

menu nicklist,menubar,channel,status {
  Host Getter: dialog $iif($dialog(vhost),-v,-dm vhost) vhost
}

what is that ?

button "Done", 9, 140 116 31 12, flat multi ok cancel

u need only that

button Done, 9, 140 116 31 12, ok

and remove if (%b == 9) { dialog -x vhost vhost }

and u can do this if u want remove the alias fill.chans and do this

if (%b == init) didtok %a 1 32 $regsubex($str(.,$chan(0)),/./g,$chan(\n) $+ $chr(32))

but you dont need for all that u can only dou this

alias hostnick if ($1 ison #) echo -a $address($v1,2)

type /hostnick

 Respond  
napa182   -  Jun 10, 2009

for them 2 alias you can do this as well

alias -l fill.nicks { did -r vhost 3 | didtok vhost 3 32 $regsubex($str(-,$nick($1,0)),/(.)/g,$+($nick($1,\n),$chr(32))) }

and

alias -l fill.chans { did -r vhost 1 | didtok vhost 1 32 $regsubex($str(-,$chan(0)),/(.)/g,$+($chan(\n),$chr(32))) }

just a diff way to do them.

 Respond  
PuNkTuReD   -  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.