mIRC Home    About    Download    Register    News    Help

Print Thread
#217150 02/01/10 08:41 AM
Joined: Jan 2010
Posts: 9
L
Litch Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Jan 2010
Posts: 9
I created a simple dialog which shows me the ident/host of a user and I came across something, mIRC refuses to evaluate unless I have previously whois'd the user or have seen them join the channel. It doesn't evaluate outside of the script via //echo. After I whois that specific user, mIRC evaluates the command.

Copy of the part of the script that refuses to work:

Code:
dialog cpa {
  title ""
  size -1 -1 351 94
  option pixels
  box "Nick", 11, 2 2 223 30
  edit "Nick", 12, 44 10 179 20, disable autohs
  box "Ident", 21, 2 32 223 30
  edit "Ident", 22, 44 40 179 20, autohs
  box "Host", 31, 2 62 223 30
  edit "Host", 32, 44 70 179 20, autohs
  combo 51, 228 2 120 90, size vsbar
}
alias cpa {
  dialog -m cpa cpa
}
on *:dialog:cpa:init:*: {
  nlst
}
on *:dialog:cpa:sclick:51: {
  did -r $dname 12
  did -r $dname 22
  did -r $dname 32
  did -a $dname 12 $did(51).text
  did -a $dname 22 $gettok($gettok($address($did(12).text,5),1,$asc(@)),2,$asc(!))
  did -a $dname 32 $address($did(12),2).text

}
alias nlst {
  did -r cpa 51
  var %nl 1
  while (%nl <= $nick($active,0)) {
    did -a cpa 51 $nick($active,%nl)
    inc %nl
  }
}


Any ideas why? or whether Ive done something wrong? Thanks in advance smile

Regards Litch

Joined: Dec 2002
Posts: 252
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 252
not all networks send the names with the full address when you join a channel, thus if those names that were delivered just as nicknames do not perform some action, like talk,describe,change a mode, etc... they are not in your internal address list thus $address will fail. Servers that deliver full names list usually have in the connection something about using NAMESX and UHNAMES I believe, those give you in a names raw nick!user@host rather than just nick. A simple solution to this problem is to upon joining the room yourself, perform a /who #channel

Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
Best way to work around this is generally to /who channels as you join them:

Code:
on 1:JOIN:*: {
  if ($nick == $me) {
    who $chan
  }
}


and if you want to include the people who query you:

Code:
on 1:OPEN:?:*: whois $nick


Of course the most common problem with this would be query blockers. You could add callback-like functionality where-by, if a fulladdress doesn't exist for the user, add the nickname to a hashtable, send a /WHOIS, and hook the response. If a /WHOIS response arrives and the nickname is on the hashtable, perform your did -a in your nlist alias and remove the nickname from the hashtable...

That's about as humble as you can get with these things -- unfortunately there are always things that could (but rarely will, if you take the initiative to get all the info) go wrong.

Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
You may /who a nick or channel

I haven't checked but probably
don't need to do it for a query
but I include the code below
along with how to block all
the who lines you gonna get
when you join channels

Code:
on *:OPEN:?:who $nick
on me:*:Join:#:who #
raw 352:*:!
raw 315:*:!


After some testing and rereading help
there is no way to enter a user into
internal address list if they query
you while not in any of your channels.

mIRC maintains an internal address list of all users who are currently on the same channels as you.
The reason why only addresses for users on the same channels as you are stored is because this guarantees the integrity of the list.


Link Copied to Clipboard