|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
Is it possible to get the window id of the currently active window? $wid only works when entering a command into the editbox. I don't want to use $window($active).wid, as there can be multiple windows with the same name.
If you have any idea, please tell me =)
|
|
|
|
Joined: Nov 2004
Posts: 842
Hoopy frood
|
Hoopy frood
Joined: Nov 2004
Posts: 842 |
You might need to set a variable %wid as the active wid then perform a loop ...
var %wid = $window($scid($activecid).active).wid
*shrugs*
Last edited by Jigsy; 11/01/06 01:21 AM.
What do you do at the end of the world? Are you busy? Will you save us?
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
Unfortunately that doesn't work since it is basically the same as $window($active).wid
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
What does it matter if the windows have the same name or not? $active returns the active window, irrelevant as to the window name
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
Granted you have 2 windows called =greeny, and the second one of those is active.
If now you call $window($active).wid, it will only return the window ID for the first =greeny window, even though the second one is active.
I need it to return the correct window ID of the active window, which isn't possible it seems to me...
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
Oh yeah, there's not even a possibility to activate the second dcc chat window it seems... as /window -a only works on the first window too.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
I don't think it's possible, and I think it is a design mistake that we can't know exactly which hwnd or wid the current window has.
There should be an $activewid or something.
Gone.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
$active returns the name of the active window, and when you have multiple windows with the same name then you are basically screwed.
When you have 3 dcc chat windows with the same person, then all of them return =<nick> for $active, so when doing $window($active).wid, it transforms to $window(=<nick>), which will always return the first of those 3 windows, even though the actually active one may be the third.
Gone.
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
Yeah... it's really a pity.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
I guess the only thing you could do is rename the dcc windows when one is initiated, putting an index in the name of the window, using a character in between the nick and the number that can't be part of a nick. You can use $window(=<nick><char>*,0) to distinguish between how many there are already with that nickname that you indexed to find the right number to add.
I know it's (very) crappy, but that's all I can think of. Besides coding a DLL perhaps.
I guess we could start by making it a feature suggestion, who knows, it might even be implemented in the next version.
EDIT: How's the RSS thing working out?
Gone.
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
The RSS reader is working great
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
This is really a real bad cludge, but assuming your script isnt overly concerned about anything else (lol)
in your script end it with... editbox -an //getwid $!wid $1-
alias getwid { var %wid = $1 tokenize 32 $2- ..carry on your code here.. }
There are other things to look ouit for of course like, now you have lost $nick & $active etc etc, but you got the $wid, well you could sort out all the other bits you need by passing them to the script as i passed $1-, but assign them to vars instead.
OK OK its a crappy solution, but it is a solution.
|
|
|
|
Joined: Nov 2004
Posts: 842
Hoopy frood
|
Hoopy frood
Joined: Nov 2004
Posts: 842 |
What do you do at the end of the world? Are you busy? Will you save us?
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
This is really a real bad cludge, but assuming your script isnt overly concerned about anything else (lol)
in your script end it with... editbox -an //getwid $!wid $1-
alias getwid { var %wid = $1 tokenize 32 $2- ..carry on your code here.. }
There are other things to look ouit for of course like, now you have lost $nick & $active etc etc, but you got the $wid, well you could sort out all the other bits you need by passing them to the script as i passed $1-, but assign them to vars instead.
OK OK its a crappy solution, but it is a solution. Hehe, I already had that Idea, but I was hoping there was a better solution...
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
Channels are not the problem, it's mainly about DCCs.
|
|
|
|
Joined: Nov 2004
Posts: 842
Hoopy frood
|
Hoopy frood
Joined: Nov 2004
Posts: 842 |
$send(N/nick[,N]).wid & $chat(N/nick[,N]).wid
Little test I did:
$chat($me,0) -> 4 $chat($me,1).wid -> 20 $chat($me,2).wid -> 21 $chat($me,3).wid -> 22 $chat($me,4).wid -> 24
Last edited by Jigsy; 11/01/06 04:31 PM.
What do you do at the end of the world? Are you busy? Will you save us?
|
|
|
|
Joined: Dec 2002
Posts: 230
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 230 |
I know. That doesn't help me though, since I want to get the wid of the active window, not a list of wids or something.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
This isn't mentioned in versions.txt or the help file but $wid now works from remote.
|
|
|
|
Joined: Nov 2004
Posts: 842
Hoopy frood
|
Hoopy frood
Joined: Nov 2004
Posts: 842 |
Doesn't work for me ... on *:open:=:{ echo -at $wid } just returns the connection id ... DCC Chat session - Client: JigsWithoutWoodstock (****) Time: Sat Feb 18 19:24:39 2006 - Acknowledging chat request... [19:24:39] 2 DCC Chat connection established - [19:24:39] 2
What do you do at the end of the world? Are you busy? Will you save us?
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
I didn't try it in an event but it works from the menubar.. menu menubar {
Wid: echo -a $wid
}
|
|
|
|
|