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 =)
You might need to set a variable %wid as the active wid then perform a loop ...
var %wid = $window($scid($activecid).active).wid
*shrugs*
Unfortunately that doesn't work since it is basically the same as $window($active).wid
What does it matter if the windows have the same name or not? $active returns the active window, irrelevant as to the window name
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...
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.
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.
$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.
Yeah... it's really a pity.
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?
The RSS reader is working great
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.
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...
Channels are not the problem, it's mainly about DCCs.
$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
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.
This isn't mentioned in versions.txt or the help file but $wid now works from remote.
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
I didn't try it in an event but it works from the menubar..
menu menubar {
Wid: echo -a $wid
}