View Single Post
  #3  
Old 09-30-2014, 02:18 AM
e2script e2script is offline
Registered User
 
Join Date: Sep 2014
Posts: 34
I can't seem to get that command to work properly.

Here's the first part of my script where the canceling of the script might be necessary.

Code:
crt.Screen.Synchronous = True

'This part dnstelnet's the hostname or ip-address you have copied to your clipboard. #######

crt.screen.Send "telnet "
crt.screen.SendSpecial "MENU_PASTE" 
crt.screen.Send "" & vbCr

result0 = crt.Screen.WaitForStrings("Name or service not known","Connected to")
'Name or service not known = when it doesn't work to telnet the host.
'Connected to = when it works to telnet the host.

'If it doesn't work to telnet the host try to dnstelnet the host.
if result0 = 1 Then
crt.screen.Send "dnstelnet "
crt.screen.SendSpecial "MENU_PASTE" 
crt.screen.Send "" & vbCr

result3 = crt.Screen.WaitForStrings("has address","$","Connected to")

'If it doesn't work to dnstelnet the host because there's severeal hosts matching the criteria then cancel the script.
On Error Resume Next
if result3 = 1 Then
crt.screen.SendSpecial "MENU_SCRIPT_CANCEL" 
end if
On Error Goto 0

'If it doesn't work to dnstelnet the host because there's no hosts matching the criteria then cancel the script.
On Error Resume Next
if result3 = 2 Then
crt.screen.SendSpecial "MENU_SCRIPT_CANCEL" 
end if
On Error Goto 0

'If it works to dnstelnet the host then continue with the login.
if result3 = 3 Then
end if
end if


'If it works to telnet the host then continue with the login.
if result0 = 2 Then
end if
I don't know if I'm doing it right or if I misunderstood your response.
The script is cancelled but I'm still receiving a dialogbox.
Reply With Quote