SOLUTION: Reset Netscape to HomePage Timer

Alejandro Garza Gonzalez agarza at ci.mty.itesm.mx
Fri Feb 2 14:04:33 EST 1996


I already mailed this to one person, questions coming in from other 
members of the list motivated me to "finish" my trial period and have 
a working solution I'd be glad to share.

For those people with Windows public machines, here is my solution:

I am using a Programming language called "Flute" which also doubles as 
a macro recorder-- it can handle windows, type in text automatically, etc.
You can get it from these sites:

Host ftp.sunet.se

    Location: /pub/pc/windows/mirror-cica/win3/programr
           FILE -r--r--r--    1272833  May  1 1995  flute.zip
    Location: /pub/pc/windows/mirror-cica/win3/uploads
           FILE -r--r--r--        760  Aug 13 08:55  flute.txt
           FILE -r--r--r--     707906  Aug 13 09:03  flute.zip
    Location: /pub/pc/windows/mirror-cica/win95/programr
           FILE -r--r--r--     707906  Aug 13 08:54  flute.zip

Host micros.hensa.ac.uk

    Location: /mirrors/cica/win3/programr
           FILE -rw-r--r--    1272833  May  1 1995  flute.zip

-----

You'll need pkunzip to dezip the file. Just place it in a new 
subdirectory. The macro I wrote is this: (comments translated from 
spanish, excuse any errors)

----
main{
  /* This program runs until you place the mouse pointer in the top-left
     corner, hold down SHIFT, and wait a few seconds */

  pause:=5;	/* Time between mouse checks */
  timeout:=120;	/* Both in seconds */
  
  numintervals:=timeout/pause;
  hidewindow({"Program Manager"});
  hidewindow({"Trumpet Winsock"});
  hidewindow({"WinQVT/Net v3.9"});

  wait(pause*1000);
  
 while ( !(shiftkey & pos={0,0}) ) /* Top-left corner is Magic Zone */
  {	i:=0;
  	pos:=mousepos;
  	pos_ant:=pos;
  	while (pos=pos_ant & pos!={0,0} & i<numintervals)
  	{	pos_ant:=pos;
     		pos:=mousepos;
     		i:=i+1;
     		wait(pause*1000);

		/* Always make netscape occupy the whole screen, if the user quit, */
                /*   run it again. */
     		if (! (maxwindow({"Netscape - "}) ) )
     			execute{"c:\internet\netscape\netscape.exe","http://www-cib/"};

		/* Make the active telnet window (if any) the topmost window) */
     		if (findwindow({"telnet"}) )
     		{ 	bringwindowtotopmost({"telnet"});
			/* don't let the user iconize telnet windows */
     			if (isiconic({"telnet"}) )
     				restorewindow("telnet"); 
     		};
  	};
  	if (i=numintervals) 
  	{	/* run Netscape*/	
  		execute{"c:\internet\netscape\netscape.exe","http://www-cib/"};
  		/* tell it to 'go home'*/
  		typetext{{"Netscape",">afxmdiframe",">afx:302b:0:aca:0"},17,"l"};
		typetext{{"Open Location",">edit"},-17,"http://www-cib/",13};
			/* The '17' means "press ALT", so 17,l == ALT-l */
			/* '-17' is "release ALT"; the '13' means "press return". */
			/* You can insert these codes by using a menu option which */
			/*   records your mouse and keyboard actions */
	 };
  };
  showwindow({"Program Manager"});
  showwindow({"Trumpet Winsock"});
  showwindow({"WinQVT/Net v3.9"});

}
----
Copy this text and paste it into the Flute editor window.

While it IS a mouthful, it's not that complex. I had previous
experience with 'C' programming so it wasn't too much of a fuss to come
up with it... read the comments to see what it's doing. 

In order to make this script startup automatically, you can make a 
program icon that goes in the startup group, which contains the path to 
FLUTE.EXE, along with "-h -r macroname.flu", so FLUTE knows to hide the 
window and run the macro called "macroname.flu". It's explained in 
Flute's help section...

The only downside to this macro is that I have no way to gauge user
activity other than by mouse movements. I can't check for keypresses,
but since I'm not shutting down telnets (anymore), there's not much
problem. Telnet windows are always shoved to the front, so the user
doesn't forget they're there-- I'll let normal timeouts log the user
out.  

Hope this helps!

_alex
+-------------------------------------+------------------------------------+
| Ing. Alejandro Garza Gonzalez       | E-MAIL: agarza at campus.mty.itesm.mx |
| ITESM University, Monterrey, Mexico | "Ok bye!"                 // Solo  |
+- http://www-cib.mty.itesm.mx/ ------+-------------------------\X/-Amiga!-+


More information about the Web4lib mailing list