PDA

View Full Version : Starting in Invisible mode ?


Mangina
February 19th 04, 08:41 AM
Hello all,
I was using the script below w/Windows Messenger and recently upgraded to
MSN Messenger 6.1.

The script loads the new Messenger just fine, however, it no longer makes me
invisible right away, I have to manually do this. Is there a problem with
the script ? Sometime I am missing ?
Many thanks.

' Constants to make this readable
CONST MSTATE_OFFLINE = 1
CONST MSTATE_ONLINE = 2
CONST MSTATE_INVISIBLE = 6, MSTATE_BUSY = 10
CONST MSTATE_BE_RIGHT_BACK = 14, MSTATE_IDLE = 18
CONST MSTATE_AWAY = 34, MSTATE_ON_THE_PHONE = 50
CONST MSTATE_OUT_TO_LUNCH = 66
counter = 0

set objMsgr = Wscript.CreateObject("Messenger.MsgrObject")
set objMsgrApp = Wscript.CreateObject("Messenger.MessengerApp")

'if we are already on line, QUIT
if objMsgr.LocalState <> MSTATE_OFFLINE then wscript.quit

'start the logon user interface; execution continues immediately
objMsgrApp.LaunchLogonUI

'Next we loop until we show as online
Do Until objMsgr.LocalState = MSTATE_ONLINE
WScript.Sleep 10
counter = counter + 1
' after 3 minutes we're not going anywhere so quit
if counter > 18000 then objMsgrApp.Quit : wscript.quit
' ...so quit messenger and bail out of the script
Loop
'online now, so pause 20 ms and set to "Appear Offline"
wscript.sleep 20
objMsgr.LocalState = MSTATE_INVISIBLE
' pull up the messenger window while we're at it.
wscript.sleep 100
objMsgrApp.Visible = false

Google