Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-05-2005, 10:51 AM
Amuk Amuk is offline
Registered User
 
Join Date: Jun 2005
Posts: 7
trying to read what is in telnet window.

I am working on a script to telnet into a as/400 and check that a process is running.
So far, I have been able to get it to log in and browse down to where this process would be, but havn't found a command that can read the running processes without crt.screen.Get(row17, col9, row17, col14). If this is my only option I'd like to know, but would rather do something else and check for the name, otherwise I would likely want to check several processes incase another had turned off causing the one I care about to be moved in the list.

The options I am using to telnet are pretty much all default, but I am using VT220 Emulation as that works better with the as/400.

a screenshot of the line I am checking:as/400 screenshot

Please let me know if more info is needed.
Amuk
Reply With Quote
  #2  
Old 07-05-2005, 11:52 AM
adeshotel adeshotel is offline
Registered User
 
Join Date: Dec 2004
Location: Houston, TX
Posts: 14
It has been ... a while ... since I've had to deal with o/s 400; however from your screen shot it would seem that the F7 might do a find for the process you're looking for. If so then you would only need to do a screen scrape of a very small box rather than the entire screen. And if that is the case they it would be quicker to give you a go/nogo type resolution rather than trying to read the entire screen line by line looking for a string match for your process. If F7 isn't a process find then I'd say your fallback position is to scrape the entire screen....

Al
Reply With Quote
  #3  
Old 07-05-2005, 12:29 PM
Amuk Amuk is offline
Registered User
 
Join Date: Jun 2005
Posts: 7
I can make the F7 search work. At least I will find things in fixed places this way and screen scrape as needed.

guess my next question, since I dont seem to find much in the looking I've done so far...how do I set and use constants and use if/then commands. Havn't seen these used in what I have looked at so far.
Reply With Quote
  #4  
Old 07-05-2005, 02:22 PM
adeshotel adeshotel is offline
Registered User
 
Join Date: Dec 2004
Location: Houston, TX
Posts: 14
Take a look at the post by Chaucer about posting to Excel. He has a nice for loop with a variable. At least I think this is what you're asking.
Reply With Quote
  #5  
Old 07-05-2005, 04:27 PM
Amuk Amuk is offline
Registered User
 
Join Date: Jun 2005
Posts: 7
ah...coo. no real section for them, just put constants in the main part and no $ needed to use them.

another question then. How do I send F keys. in the FAQ I found one thing listed.F3 which I need, but I also need F7 and F12.

I guess I will figure out more of the syntax rules as I go...I see some examples of them in the excel script and can mess with them some.
Reply With Quote
  #6  
Old 07-08-2005, 12:21 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 990
Quote:
Originally Posted by Amuk
ah...coo. no real section for them, just put constants in the main part and no $ needed to use them.

another question then. How do I send F keys. in the FAQ I found one thing listed.F3 which I need, but I also need F7 and F12.

I guess I will figure out more of the syntax rules as I go...I see some examples of them in the excel script and can mess with them some.
You might consider using the crt.Screen.SendSpecial method, as it might make your scripting life a little easier.

As an example of how you would use crt.Screen.SendSpecial, let's pretend that you're using the VT220 emulation. If you look in the vt220.key file located in the "keymaps" folder of the SecureCRT installation folder, you'll notice that the Normal usage of the VK_F7 key is set to "VT_F7". For VK_F12, it would be "VT_F12". So, to send F7 immediately followed by an F12, you would do the following:
crt.Screen.SendSpecial "VT_F7"
crt.Screen.SendSpecial "VT_F12"
For more information about the format of the SecureCRT's .key files, read the latter part of this post.

Note that not all emulations share the same keymap defaults, so although a "VT_F7" applies to the F7 key for VT220 emulations, for the SCOANSI emulation, F7 would need to send "\033[X" or in VBScript code:
' "Press" F7 in SCOANSI emulation:
crt.Screen.Send chr(27) & "[X"
' The above line could also be represented as follows,
' if you don't want to have to convert from octal to decimal:
' crt.Screen.Send chr(&O033) & "[X"
In general, you can determine the codes needed by using SecureCRT's keymap editor. First, set up your session with the desired emulation (VT100, ANSI, etc). Then, connect to the remote machine using the session that you have just created. Bring up the keymap editor (Tools menu), select the key, and the code will be displayed in the lower left hand corner of the keymap editor (as displayed in the attached graphics).
Attached Images
File Type: png KeymapEditor-F12-SCOANSI.png (36.4 KB, 268 views)
File Type: png KeymapEditor-F12-VT220.png (46.5 KB, 252 views)
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #7  
Old 02-08-2008, 05:40 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,584
Quote:
Originally Posted by Amuk
ah...coo. no real section for them, just put constants in the main part and no $ needed to use them.

another question then. How do I send F keys. in the FAQ I found one thing listed.F3 which I need, but I also need F7 and F12.

I guess I will figure out more of the syntax rules as I go...I see some examples of them in the excel script and can mess with them some.
In SecureCRT 6.1, we have made it easier to send things like function keys, Shift+<function key>, and Ctrl+<character> from a script. SecureCRT 6.1 is in pre-beta testing. If you would be interested in trying it, please send e-mail to me at Maureen.Jett@vandyke.com. It can be installed in a different folder so that you can also use a previously installed version of SecureCRT. Please let me know if you also use SecureFX so that I can send you a combined installer.

Maureen
Reply With Quote
Reply


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 11:56 PM.