Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
MooNFisH
Newbie


Joined: 25 Apr 2007
Posts: 8

PostPosted: 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?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: 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
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Feb 09, 2011 1:36 pm   
 
Or even easier, just depend on the default Clickables package to create the clickable link for you.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net