View Single Post
  #1  
Old 06-02-2020, 01:43 AM
js11o9 js11o9 is offline
Registered User
 
Join Date: Jun 2020
Posts: 4
Exclamation Waitforstring doesn't work

Code:
#$language = "VBScript"
#$interface = "1.0"

crt.Screen.Synchronous = True

' This automatically generated script may need to be
' edited in order to work correctly.

Sub Main
	crt.Screen.Send "show run | grep hostname" & chr(13)
	crt.Sleep 100
	dd = crt.Screen.CurrentRow
	crt.Sleep 100
	dd2 = crt.Screen.get(dd,1,dd,50)
	dim result
		 
	host_name = trim(dd2)
	crt.Screen.Send host_name & chr(13)
	crt.Sleep 100

	crt.Screen.Send "Show clock" & chr(13)
	result = crt.Screen.WaitForString (host_name)
	
	crt.Screen.Send "ter monitor" & chr(13)
	result = crt.Screen.WaitForString (host_name)
	'host_name

	crt.Screen.Send "Show tech | no" & chr(13)

	result = crt.Screen.WaitForString (host_name)
	
	crt.Screen.Send chr(13)
	result = crt.Screen.WaitForString (host_name)
	crt.Screen.Send "Show env | no" & chr(13)
	
End Sub
I have a problem with above script
waitforstring does not work until the command "show tech | no"
so next command "show env | no " does not work too

Last edited by jdev; 06-02-2020 at 07:16 AM. Reason: Please use [code][/code] tags around your code for preserving indentation/spacing
Reply With Quote