mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Quote:
Your alias does the job that you wanted it to do, but it has nothing to do with the problem I've showed, which is: there is something wrong with $chan and $snicks.

You must mean with the problem you introduced. $chan and $snicks are out of scope if you don't call them from within a channel (with or without selected nicks). Presumably, $chan and $snicks do not get filled with data until an event happens in that channel, such as on INPUT (which internally also watches for <tab>, thus allowing you to tab-complete $snicks while in the editbox for that channel) or a popup event. on JOIN will not populate $snicks either.

Quote:
You can't access them directly from an ON DIALOG event

No surprise here, as on DIALOG does not take place within a channel. $chan and $snicks are out of scope.

Quote:
and you can't reproduce anything like them in this situation in a clean(IMO*) way.

This is incorrect. I can reproduce anything about that behaviour that I choose to include. Your statement here is your opinion, nothing more. I have no problems scripting this sort of activity. I would even venture to guess that there are others who have this same curious lack of a problem with this.

Quote:
But the very problem is why you can't access them. After all, you can access $active. $chan is not really needed, using the same $active.

Exactly the truth. There is no $chan in any dialog. There is always $active and and there is also $dialog().active, two different identifiers.

Quote:
$snicks sometimes is.. and you can't reproduce it.. you can't use it properly even with a timer - I'll explain this later.
Your code doesn't reproduce anything like these identifiers. It's not able to refresh that data, that's all. Then it doesn't do what's wanted.

No, you may not reuse $snicks if the event that checks it did not originate in that channel. If an alias is being used to check for its presence, then it must be triggered from within the channel with the selected nicks. /window -a will make another (channel) window active, but it will not refill $snicks in the new channel. This is true, even if you call an alias from a timer because $snicks is still out of scope.

No, you may not call $snicks at all if you do not do so from inside the channel itself. $snicks takes no ($chan) parameter like $snick() does. I can perhaps see your point about adding $snicks($chan) to return the $snicks from $chan. However, again we're back to identifiers not being filled with data simply because you /window -a to them.

Quote:
You should understand that, first of all, what I really want isn't a scripted solution, since I can handle that - I am interested, though, in any clean way to script it, and that's why I asked for it and modified yours anyway.

I assumed you could read script; that is why the majority of my second post was just code. I tried to anticipate what you wanted by including the timer to "follow" the channel you had selected. Obviously, I guessed your intentions incorrectly. For this, I do apologize.

My goal was to show you a common way in which you can rebuild your own $my_snicks for whatever channel was active, refreshable whenever you choose. It can, indeed be done...very easily.

alias -l my_snicks return $didtok(Frog,2,44)

Edit: qwerty has just pointed out to me that $snick(#channel) returns the comma-delimited list.

Last edited by Hammer; 25/08/03 12:10 PM.

DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Quote:

This is incorrect. I can reproduce anything about that behaviour that I choose to include. Your statement here is your opinion, nothing more. I have no problems scripting this sort of activity. I would even venture to guess that there are others who have this same curious lack of a problem with this.

Yes, that's why I said "IMO". You can reproduce it in any way that you think it's clean, but IMO it's not, so following my view of "clean" you can't. This shouldn't matter anymore, anyway.

Quote:
$chan and $snicks are out of scope.

I know, in my last reply I ended up seeing they're really out of their scope, but I thought this wouldn't apply to $snicks.. that's why I suggested some review. But I didn't know about $snick(#channel) (*sigh*, it's even in the help file) so I was wrong about it. That's the solution. Thanks.

I do, however, think that this shouldn't behave this way. Maybe $chan and $snicks should return $null if not called by the proper events.. no timers, aliases or anything like that. I hope this is a backwards compatibility, though. Maybe this behaviour should be better explained in the help file.


* cold edits his posts 24/7
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
the only way you could ever get $snicks to work like u want and $chan to also would be if mirc where able to dock a dialog and associate it with that specific window.


D3m0nnet.com
Page 2 of 2 1 2

Link Copied to Clipboard