mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 154
B
BoredNL Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Jan 2003
Posts: 154
I have all ips of a certain channel I'm on recorded using "on join" and "on part", recording the ip using $address, but sometimes $address simply returns $null, and I don't know why. The address is shown, and it isn't nick/ip specific, it just simply doesn't return a value sometimes for some reason.


- Wherever you go there you are.[color:lightgreen]
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Again, a simple example of code where $address isn't working for you would be helpful.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jan 2003
Posts: 154
B
BoredNL Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Jan 2003
Posts: 154
uh, as I said, I was using "on join" and "on part", and it doesn't work like 1% of the time for some reason.

Do you really a literal code example??

Here one is.. even though you don't need it, but mkay:

Code:
on *:JOIN:#:{ window @ips | echo @ips (Joining) Channel: $chan Nickname: $nick Address: $address }


(guess what the part script example would look like..)


- Wherever you go there you are.[color:lightgreen]
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
From the help file:
Quote:
$address(nickname,type)
Searches the Internal Address List for the address associated with the specified nickname.

$address(nick,1) returns *!*user@host

If the Internal Address List doesn't contain a matching nickname, the identifier returns $null.

$Address isn't meant to be used without nickname and type, you really should pay more attention to the help file.

Code:
on *:JOIN:#:{ window @ips | echo @ips (Joining) Channel: $chan Nickname: $nick Address: $address($nick,5) }


- cF
Dedicated helper for rent.
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
But in another part of the help file it says:
$address
Returns the address of the user associated with an event in the form [email][/email]user@host.

It doesn't specify a need for any parameters there...

Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Always works for me in channel events.

Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
On 1:TEXT:*:#:echo $chan Nick: $nick Address: $address

(07:57:22) (+chris01) hey
Nick: chris01 Address: [email]blah@=vWj841-eaa6.adl.ihug.com.au[/email]


Seems to work just as fine.


- cF
Dedicated helper for rent.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Yes I did need to see example code (which is why I asked for it), otherwise there could have been any number of things wrong with your code not related to $address not working, meanwhile we're wasting our time trying to find a reason and a solution. I very much expected the problem to be related to your previous bug report since $address doesn't return a nickname segment. Does $fulladdress work properly in the same code?


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jan 2003
Posts: 154
B
BoredNL Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Jan 2003
Posts: 154
Actually, it turns out that I was using $address( $nick, 2) anyways.

Btw, are you even reading what I'm saying??

I said it doesn't work about 1% of the time..

1 test (or even multiple tests not in a busy channel) will not be recreating the situation..


- Wherever you go there you are.[color:lightgreen]
Joined: Jan 2003
Posts: 154
B
BoredNL Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Jan 2003
Posts: 154
My guess would be that it takes a little time for the address to be stored, and every great once in a while, it tries to write to the file before the address appears. (The real script writes to a file and optionally echos to a custom window @ips) I know it isn't the way the script is written, I am sure of that. I can just stick the write on a 1 second timer or something.. it'll be ok. smile


- Wherever you go there you are.[color:lightgreen]
Joined: Dec 2002
Posts: 266
Z
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
It smiply doesn't work because your IAL isn't been updated quick enough, as you said with "takes a little time for the address to be stored". When you join a channel, without any fancy stuff like a /who or massive whois', and a user doesn't talk, or quit, or join, just idling there, and you go to kick ban that user, it will only kick but not ban because his/her address isn't in the IAL (this is just an example of why $address doesn't work sometimes).

If worst comes to worst you can just add error checking...

on *:JOIN:#:{ aline -p @window Nick: $nick Address: $iif($address,$ifmatch,N/A) } Or something...

And so on...


You won't like it when I get angry.
Joined: Dec 2002
Posts: 46
Z
zac Offline
Ameglian cow
Offline
Ameglian cow
Z
Joined: Dec 2002
Posts: 46
Impossible. JOIN includes their [email]user@host[/email] (:nick!user@host JOIN <channel>), so the IAL for that entry is updated immediately, assuming IAL is not off.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
In the event that the IAL wasn't updated in time (honestly I doubt that's the problem) I'm sure $address (without parentheses) and $fulladdress would be filled since they aren't retrieving data from the IAL. So you should still be able to use $mask($fulladdress, 2) to get the script working 100% of the time.

And by the way yes I did read what you said. I tried approximately 180 joins/parts using the code you listed on various servers and every one returned correctly. Obviously there's still a fair chance that that wouldn't have caught the bug if it was literally a 1% possibility of it occurring, but I assumed you were exaggerating a bit with that figure. Seeing as you were actually using $address() and not $address though it seems my efforts were a waste - entirely what I was trying to avoid by asking you to paste exact code with which the bug had occurred.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 266
Z
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
For some strange reason, in #Scripting on DALnet, today we got around 3 queries regarding why $address doesn't work sometimes.

One of our operators said to use $mask with $fulladdress, eg: $mask($fulladdress,3), not sure why, but it seems to fix the issue.


You won't like it when I get angry.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Technically it's better to use $mask and $fulladdress anyway since it doesn't require the IAL to be switched on. Maybe this apparent bug will help some people make their code more compatible :tongue:


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Mar 2003
Posts: 5
L
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
L
Joined: Mar 2003
Posts: 5
I have a similar problem:
if i write //echo 4 -a *** $address(Someone,0), it writes notihing many times, but if I whois the nick before using $address, it always works. Why is this?

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$address(Someone,0) only works if mIRC knows the address of "Someone". mIRC will recieve and store the address when "Someone" joins a channel you are in, "Someone" messages a channel you are in, when you /whois "Someone", etc. If none of these have happened then it will naturally return $null.


Link Copied to Clipboard