Sample CScripts

TinyTERM includes a powerful scripting language you can use for unlimited customizing possibilities. You can customize and automate host connectivity procedures, automate file transfers, create polling, login, log-out and shutdown routines, and more. CScript is similar to JavaScript in functionality and syntax, so users familiar with JavaScript won't have any problems working with CScript.




 Hostmode.cs  [download]
This script allows unattended file transfer between two PC's.

 CharSet.cs  [download]
This script runs through the standard character set, from 0 to 255. It displays the results in eight lines. Many emulations will not display the high-bit characters above 127, and some of the characters are not displayable. Before running this script, configures TinyTERM to ignore print requests.

 ftp.cs  [download]
This script will get host name, user name, password, and other relevant FTP info from the user and then get or send a file.

 jackpot.cs  [download]
A sample script that acts as a simple slot machine. It also demonstrates capture of command return codes. It will look its best if the TinyTERM window is maximized first.

 launch_tpx.cs  [download]
A sample script that presents adds a session based on the tpx file selection. The dprintln() will appear in dbmon32 if it is running.

 login.cs  [download]
A sample script that automatically logs in to a remote UNIX system by:

  • Prompting user for a Hostname
  • Prompting user for a Username
  • Prompting user for a Password
  • Then connects to the system

 logout.cs  [download]
A sample script that prompts the user to check an see if they have properly logged out.

 menuItem.cs  [download]
This script demonstrates how the user can add to the TinyTERM menu structure. Running it will add a menu item "User Cmd" to the "Help". Also Included is the Code that is run when the Menu Item is selected.

 msession.cs  [download]
A simple script that starts up multiple sessions.

 NoPrefs.cs  [download]
Modifies the Edit menu by removing the separator and the commands used to set preferences and settings. Also sets the User_Modify_Menu function to remove these items each time TinyTERM redraws the menu.

To remove the preferences and settings menu commands each time a user runs the TinyTERM emulator, you need to do the following:
  1. Copy this script to the directory containing the TinyTERM application
  2. Choose Preferences from the Edit menu and set the Application Startup Script to NoPrefs.cs (make sure you click OK)
To limit a user's ability to access preferences through other means, you will probably want to do the following:
  1. Turn off the Ribbon bar and the Session bar
  2. Save the settings as default.tpx

 outfirst.cs  [download]
This is an expanded version of the included logout.cs sample script. outfirst.cs prevents the user from disconnecting, closing a session, or exiting TinyTERM unless the user has logged out first. Otherwise, a message window pops up reminding the user to log out, and the script terminates with the connection still active. This script will only work on serial connections if the host is configured to drop DTR on logout. To use this script, configure it to run when the session is opened. It will define the "script_sessDown" and "script_sessDiscon" callbacks.

 port.cs  [download]
A sample script that searches COM ports 1 through 6 to determine which one has a modem attached. It will only find the first such COM port.

 TAPtoTPX.cs  [download]
A sample script that converts a TinyTERM version 3.3 .TAP connection file to a TinyTERM version 4.04 .TPX file. See the file TAPtoTPX.wri for complete documentation.

 y2ktest.cs  [download]
A sample script that checks three behaviors:
  1. How TinyTERM handles the year change from 1999 to 2000;
  2. How TinyTERM handles the date changes from 28 Feb 2000 to 1 Mar 2000
  3. How TinyTERM handles file dates before and after the year 2000
To properly test, the operating system should be installed before 2000, and the system clock should be in the year 2000 or beyond. This script also demonstrates passing of variables to functions.