When I mud, I generally have other windows open and browse throughout them during some sleeping ticks and whatnot. Along with that - I have a cd in the player or something else using the audio channel. So, this is my question:
Is there some way to bring the MUSH window to the front?
For example, my character is asleep and I alt+tab to the MUSH forums :). I don't know that someone came in and woke me up as soon as I tabbed, though, and they're ripping my poor character into bits.
So, basically, it could operate off of a "You stand and wake up." trigger.
Gee.. MS strikes again. I just went looking to see if there was a WindowActivate command someplace in scripting too, since using GetFrame would tend to be more reliable, but there wasn't. I personally don't trust things that use the title bar contents to manipulate a window. If you have more than one of any application open, but don't know the *exact* text to use, then it opens the first one it finds, which isn't always the right window. Oh well, it was worth a look, even if it proved as pointless as usual.
Should be easy as a function. It is basically nothing more than a 'SetActiveWindow(whndl);' API call in user32.dll, which is itself nothing more than the same thing you pass to the GetFrame command.
AppActivate Method
Activates an application window.
object.AppActivate title
Arguments
object
WshShell object.
title
Specifies which application to activate. This can be a string containing the title of the application (as it appears in the title bar) or the application's Process ID.
How you retrieve the Process ID, though, is another matter :p
Yes. SetActiveWindow and AppActivate are entirely different. The first can activate any window, even child windows of an application, if they are loaded. The other one is specific to applications, but imho as useful as employing the title is, it is also unreliable, since you could concievably have 50 windows open that all have the same title.
Re: Poromenos - Why not sound?
Like I said, the audio channel is in use :).
Of course I could just turn media player off and use a triggered sound to tell me when to tab, but what fun would that be? In any case, you fellas are way ahead of me in programming department. I know enough to get around with VB, but it's a trial for me to say the least.
Re: Nick Gammon
When you say 'add as a script function' do you mean like in an update of MUSHclient? Or, something I can do on my end?
The code I gave you should work until the new feature is released... Oh, and, get a new soundcard :P It must be really really old if it doesn't support playing 2 sounds at once :)