Dim WshShell, WshAuto, result, temp
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshAuto = CreateObject("AutoItX.Control")
WshAuto.SetTitleMatchMode 2
'return = WshShell.Run("notepad " & WScript.ScriptFullName, 7, FALSE)
WshAuto.sleep 240
'0 hides the window
'7 mins and background
'1 normal open and active
'Script made by Ian Reid -- al916@ncf.ca
'v1.0 basic script works with Netscape and explorer using standard install
'V1.1 made changes for new v1.32 (May 5, 2k)
'In order to use, simply rename the file name from getonline_vbs.txt to AltaVista.vbs
'you also must have registered the autoItX.Dll file with windows first
' to do that you need to downloaded from the web then extract from autoItx.zip the file autoItx.DLL
' place the file autoItx.DLL into the folder c:\windows\system\
' then type 'regsvr32 c:\windows\system\autoitx.dll' at the command line or into a Run window
'then double click AltaVista.vbs to run and let the script press all the keys.
'Note: script will minimize if altavista is already running in any state, provided browser question is answered No.
'WshAuto.WinMinimizeAll
result = WshAuto.IfWinExist("My Home","")
if result = 0 then
WshShell.run "C:\Progra~1\FreeAV\FreeAV.EXE", 1, FALSE
WshAuto.sleep 5000
'WshAuto.sleep 5000
'WshShell.Popup "Connect to AltaVista", 5, "Closing -- 5 seconds", 64
end if
Do
result = WshAuto.IfWinExist("My Home","")
if result = 1 then Exit Do
result = WshAuto.IfWinExist("Connect To AltaVista","")
if result = 1 then
WshAuto.WinWait "Connect To AltaVista",""
' WshShell.Popup "Connect to AltaVista FOUND", 5, "Closing -- 5 seconds", 64
WshAuto.sleep 500
WshAuto.WinActivate "Connect To AltaVista",""
result = WshAuto.WinWaitActive("Connect To AltaVista","")
WshAuto.Send "{tab 6}{space}"
WshAuto.sleep 500
'Changed for Windows98
' WshShell.SendKeys "{tab 6}~"
' WshAuto.sleep 5000
'removed for v1.23
' result = WshAuto.WinWait("Connecting to Internet","")
' result = WshAuto.WinMinimize("Connecting to Internet","")
' WshAuto.WinWaitClose "Connecting to Internet",""
' WshAuto.sleep 500
end if
'Fix added for version 1.32
result = WshAuto.IfWinExist("","Connect")
if result = 1 then
WshAuto.WinWait "","Connect"
' WshShell.Popup "Connect to AltaVista FOUND", 5, "Closing -- 5 seconds", 64
WshAuto.sleep 500
WshAuto.WinActivate "","Connect"
result = WshAuto.WinWaitActive("","Connect")
WshAuto.Send "{tab 6}{space}"
WshAuto.sleep 500
'Changed for Windows98
' WshShell.SendKeys "{tab 6}~"
end if
result = WshAuto.IfWinExist("AltaVista FreeAccess","Retry")
if result = 1 then
result = WshAuto.WinActivate("AltaVista FreeAccess","Retry")
WshAuto.Send "{right}{space}"
WshAuto.sleep 500
WshShell.Popup "Closing Alta-Vista Free-Access Error window", 3, "Closing -- 3 seconds", 64
end if
'line 50??
WshAuto.sleep 5000
result = WshAuto.IfWinExist("Connecting to Internet","")
if result = 1 then
WshAuto.sleep 5000
WshAuto.WinMinimize "Connecting to Internet",""
WshAuto.WinWaitClose "Connecting to Internet",""
WshAuto.sleep 500
end if
'Fix for new version 1.32
result = WshAuto.IfWinExist("","Try Next Number")
if result = 1 then
WshAuto.sleep 5000
WshAuto.WinMinimize "","Try Next Number"
WshAuto.WinWaitClose "","Try Next Number"
WshAuto.sleep 500
end if
result = WshAuto.IfWinExist("Message","OK")
if result = 1 then
result = WshAuto.WinActivate("Message","OK")
WshAuto.Send "{space}"
WshAuto.sleep 500
WshShell.Popup "Closing Mess-age Error window", 3, "Closing -- 3 seconds", 64
end if
result = WshAuto.IfWinExist("Confirm Logoff","OK")
if result = 1 then
result = WshAuto.WinActivate("Confirm Logoff","OK")
WshAuto.Send "{right}{space}"
WshAuto.sleep 500
WshShell.Popup "Closing Con-firm Log-off Error window", 3, "Closing -- 3 seconds", 64
end if
result = WshAuto.IfWinExist("1stUp","OK")
if result = 1 then
result = WshAuto.WinActivate("1stUp","OK")
WshAuto.Send "{space}"
WshAuto.sleep 500
WshShell.Popup "Closing 1st-Up Error window", 3, "Closing -- 3 seconds", 64
end if
loop while result = result
'Hide My Home window next
result = WshAuto.WinWait("My Home","")
result = WshAuto.WinMinimize("My Home","")
WshAuto.sleep 500
result = WshShell.PopUp("Do you want the Browser closed?", 5, "Default Yes -- 5 seconds", 4)
' if result is no (= 7) then don't close
if result <> 7 then
temp = 0
do
' if Wait for explorer to open then close
result = WshAuto.IfWinExist(" - Microsoft Internet Explorer","")
if result = 1 then
result = WshAuto.WinWait(" - Microsoft Internet Explorer","")
result = WshAuto.WinClose(" - Microsoft Internet Explorer","")
temp = 1
end if
' if Wait for netscape to open then close
result = WshAuto.IfWinExist("Profile Manager","Start Communicator")
if result = 1 then
result = WshAuto.WinWait("Profile Manager","Start Communicator")
result = WshAuto.WinClose("Profile Manager","Start Communicator")
temp = 1
end if
' if netscape is open then don't close and exit loop
result = WshAuto.IfWinExist(" - Netscape","")
if result = 1 then
temp = 1
Exit Do
end if
WshAuto.sleep 5000
loop while temp = 0
end if
WshShell.Popup "Connected Script Done", 3, "Closing -- 3 seconds", 64
WScript.DisconnectObject WshShell
WScript.DisconnectObject WshAuto
WScript.Quit Text file Source (historic): geocities.com/x_xet/data
geocities.com/x_xet(to report bad content: archivehelp @ gmail)
|
|
|
|
|