|
MooNFisH Newbie
Joined: 25 Apr 2007 Posts: 8
|
Posted: Sun Feb 06, 2011 10:38 pm
auto-open browser window in background |
Some of my triggers and timer-based functions use the #url function. Problem is that they pop up in front of my mud window, sometimes at the worst times. I'm looking to do one of the following:
- make the window pop up in the background;
- make the browser wait until I'm not typing for at least a few seconds.
The second is more of a backup plan, since there also are plenty of occasions where I wouldn't want a browser window popping up in front of me. I'm hoping any of you could tell me some more about the possibilities on the first option. Is DDE a solution here, and where would I have to go to learn more about it? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Feb 07, 2011 2:21 pm |
I don't believe there is a convenient way to do either of these things in Cmud. A new window will always pop up in front. For the latter, Cmud does not have any way of detecting in code that you are typing. An alternative would be to have a trigger of type Command Input that catches (*), resets the alarm time, and executes the command, but I'm not sure if this could be done without an infinite loop while still allowing it to be caught by other alias and command input triggers. It would also be a slight burden on your processor, but possibly not significant. That method would at least reset the alarm when you hit a carriage return.
|
|
|
|
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Mon Feb 07, 2011 11:13 pm |
There's a small scripting program called AutoIt that you can download for free and use in combination with CMUD to do what you want. With it you can write a script that should wait till the browser window opens, then put it in the background or minimize it, and give focus back to CMUD. Using CMUD 3.33a and Firefox as my default browser, the script below does just that. When it's time to look at the browser simply click the AutoIt icon on the task bar to pause the script, do what you need, then click the AutoIt icon again to restart the script.
Code: |
#Include <WinAPI.au3>
$CMUDhWnd = WinGetHandle ("CMUD 3.33a")
While 1
If WinExists ("[CLASS:MozillaUIWindowClass]") Then
WinSetState ("[CLASS:MozillaUIWindowClass]", "", @SW_MINIMIZE)
_WinAPI_SetFocus($CMUDhWnd)
EndIf
WEnd |
If you keep your browser window open while this script is running there should only be a quick half second or so flash on the screen when the #url command is used. During the flash the browser has focus so your typing will be interrupted but only briefly. |
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34 |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Feb 09, 2011 11:41 am |
You could always have your scripts print a link to the screen that you can click after you are done typing, instead of directly issuing #URL.
$url=www.zuggsoft.com
#PRINT {<send '#URL $url'>Click me!</send>} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Feb 09, 2011 1:36 pm |
Or even easier, just depend on the default Clickables package to create the clickable link for you.
|
|
|
|
|
|