Contributed By: Richard Heaton [email protected]
Submitted On: 05/08/97
This macro connects/disconnects to the internet using Turnpike v3.05 and
checks for incoming mail and opens Turnpike Offline if any is received.
You may prefer to use only part of this macro but it is a good example
of all the different things that can be done.
First it checks to see if you are connected. If you are it jumps to
Label "Stop" and disconnects either using Turnpike or if it isn't open
by disconnecting the MSDUN connection directly.
If not already connected it looks to see if Turnpike Connect is open
already. If so it jumps to "Go" and connects. If not it first edits
connect.ini (change the path as appropriate) to select the dialup name
you want to use. If you always use the same connection you could delete
this line but if you use more than one it gives you the opportunity to
select which connection is to be used before Connect opens. You should
replace with the bit after Connection= in the connect.ini section
below.
[CONNECTION]
Connection=NER ROMP
Once this is done, connect runs (change the path as appropriate) and
then presses the connect button.
Then it goes to "check" which is a 2 minute loop to check that the
connection is made. Once you are connected the macro jumps out of the
loop to "TP" which is a 1 minute loop to check for incoming emails. If
any are received during this time the macro jumps out of the loop to
"Open". This checks to see if Turnpike Offline is open and if it isn't
opens it so you can read your email.
There are also various error traps which breakout of loops if the
connection isn't made or is disconnected and the loops are all finite in
length so they shouldn't get stuck forever!
NB. This macro can be run from a desktop icon....
Path... "C:\PROGRAM FILES\SCHEDULER\MSCHED.EXE" DIAL
or a connect toolbar icon.....
Program: C:\PROGRAM FILES\SCHEDULER\MSCHED.EXE
Parameters: DIAL
Amend path and macro name (DIAL in this example) as necessary.
Any problems please email me.
-----------------------------------------------------------------------
IfWindowOpen>Connected to*,Stop
IfWindowOpen>Connect to the Internet,Go
IfWindowOpen>Turnpike Connect,Start
Message>Opening Connect
EditIniFile>C:\Turnpike\Connect.ini,CONNECTION,Connection,
Run Program>C:\comms\Turnpike\Connect.exe
WaitWindowOpen>Connect to the Internet
Wait>5
Goto>Go
Label>Go
SetFocus>Connect to the Internet
Wait>0.5
SetFocus>Connect to the Internet
Press Enter
Goto>Check
Label>Start
SetFocus>Turnpike Connect
Wait>0.5
SetFocus>Turnpike Connect
Press ALT
Release ALT
Send Character/Text>uc
Wait>1
SetFocus>Connect to the Internet
Press Enter
Goto>Check
Label>Check
Message>Dialing
Let>Cnt=0
Label>Cnt1
IfWindowOpen>Connected to*,TP
IfWindowOpen>Disconnect,brk2
If>Cnt=120,brk
Wait>1
Add>Cnt,1
Goto>Cnt1
Label>TP
Message>Connected
Wait>2
Message>Checking for emails
Let>Count=0
Label>Mail
IfWindowOpen>Incoming*,Open
IfWindowOpen>Disconnect,brk2
If>Count=30,brk1
Wait>1
Add>Count,1
Goto>Mail
Label>Open
Message>Incoming email detected
IfWindowOpen>Turnpike Offline*,End
WaitWindowClosed>Incoming*
Message>Opening Turnpike
SetFocus>Turnpike Connect
Wait>1
SetFocus>Turnpike Connect
Press ALT
Release ALT
Send Character/Text>um
Wait>5
SetFocus>Turnpike Connect
Goto>End
Label>Stop
Message>Disconnecting
Wait>1
IfWindowOpen>Turnpike Connect,Disc
Goto>Discon
Label>Disc
SetFocus>Turnpike Connect
Press ALT
Release ALT
Send Character/Text>ud
WaitWindowOpen>Disconnect
WaitWindowClosed>Disconnect
Goto>brk2
Label>Discon
Wait>5
SetFocus>Connected to*
Press ALT
Send Character/Text>c
Release ALT
WaitWindowClosed>Connected to*
Goto>brk2
Label>brk
Message>Connection not made
Wait>1
Goto>End
Label>brk1
Message>No mail received
Wait>1
Goto>End
Label>brk2
Message>DISCONNECTED
Wait>1
Goto>End
Label>End
Automating Turnpike & Microsoft DUN
Moderators: JRL, Dorian (MJT support), Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact: