Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Old 10-07-2007, 11:39 AM
jujordan jujordan is offline
Registered User
Join Date: Sep 2007
Posts: 23
If then question

I have created the following script that works as it should, however, I would like to make one tweek that would make it perfect. Below the script I have pasted a screen shot of a box. I would like to get the script to look at the Resource State = IN SERVICE:AVAILABLE line and modify the script to do the following. If the resouce state read this.....Resource State = MANUAL BUSY:SYSTEM TERMINATE then I would like the script to run the following command, vbcr & exert rts tfed. or if the resource state is Resource State = IN SERVICE:AVAILABLE do the following command: vbcr & exert busy tfed. then proceed with the rest of the current script. Any help would be great.

# $language = "VBScript.Encode"
# $interface = "1.0"
'**Start Encode**

crt.screen.synchronous = true

Dim opcuser
Dim opcpswd
Dim opcsite
Dim addr


Sub Main()
MsgBox "This is an encoded script!"

call work (opcuser, opcpswd, opcsite, addr)
End Sub

Sub work (opcuser, opcpswd, opcsite, addr)

crt.Session.Connect "/TELNET " & addr
crt.Screen.WaitForString "login: "
crt.Screen.Send opcuser & vbCr
crt.Screen.WaitForString "assword:"
crt.Screen.Send opcpswd & vbCr
crt.Screen.WaitForString "TERM = (vt100) "
crt.Screen.Send vbCr
crt.Screen.WaitForString "opc>"
crt.sleep 2000
crt.Screen.Send "clear" & vbCr
crt.sleep 1000
crt.Screen.WaitForString "opc>"
crt.Screen.Send "rmu" & vbCr
crt.sleep 1000
crt.Screen.WaitForString "wm> "
crt.sleep 1000
crt.Screen.Send "pm" & vbCr
crt.Screen.WaitForString "pm> "
crt.Screen.Send "exert busy tfed" & vbCr
crt.Screen.WaitForString "pm> "
crt.Screen.Send vbCr
crt.sleep 3000
crt.Screen.Send "exert rts tfed" & vbCr
crt.Screen.WaitForString "pm> "
crt.sleep 3000
crt.Screen.Send "quit " & vbCr
crt.Screen.WaitForString "Really quit? [n] "
crt.Screen.Send "y " & vbCr
crt.Screen.Send "logout " & VbCr

End Sub

opc> rmu
RM Test Client Version 2.0
wm> pm
pm> query base tfed tfed
Received query confirm: Operation successsful
Received query confirm
Resource tfed(1.2.1:18)
version: 0
current faulty count: 0
Current host ID:1.1.1:2130706433
incarnation id: 9943
MSR descriptor: tfed
Prime Host: opcws
Alternate Host: opcws
restart: 1
grace period: 15
max faulty count: 3
criticality: 1
filename: /iws/tfe/tfed
MSR Argument: ""
Administration state = DON'T-CARE
Reply With Quote
Old 10-28-2007, 10:58 PM
Antony Zhong Antony Zhong is offline
Registered User
Join Date: Oct 2007
Posts: 2
Question Is CRT scripting capable of doing IF-THEN?

I have the same question.
Reply With Quote
Old 10-28-2007, 11:17 PM
Antony Zhong Antony Zhong is offline
Registered User
Join Date: Oct 2007
Posts: 2
Smile Never mind, it works perfectly!

Thank you, JJH
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 08:48 AM.