📄 ckermit.ini
字号:
COMMENT - NET macro. Arguments:; \%1 = network type; \%2 = host name or address;def NET { if < \v(argc) 3 end 1 Usage: NET network host set network type \%1 if fail end 1 unsupported network: \%1 set login user ; Don't send user ID. set host \%2 if fail end 1 Can't reach host: \%2 echo Connection successful.}COMMENT - CALL macro. Arguments:;; \%1 = modem type; \%2 = device name; \%3 = speed; \%4 = phone number;def CALL { if < \v(argc) 5 - ; All arguments present? end 1 Usage: CALL modem device speed number xif not equal {\v(modem)} {\%1} { ; Set modem type set modem \%1 if fail end 1 unknown modem type: \%1 } xif not equal {\v(line)} {\%2} { ; Communication device set line \%2 if fail end 1 can't open device: \%2 } xif not equal {\v(speed)} {\%3} { ; Communication speed set speed \%3 if fail end 1 unsupported speed: \%3 } dial \%4 ; Dial the number if fail end 1 Can't place call: \%4 end 0 Connection successful.}COMMENT - TCPCALL macro. Arguments:;; \%1 = server name:port; \%2 = modem type; \%3 = phone number;def TCPCALL { if < \v(argc) 4 - ; All arguments present? end 1 Usage: TCPCALL server[:port] modem number set net type tcp/ip ; Which network to use if fail end 1 unsupported network: tcp/ip set host \%1 ; Access server and port if fail end 1 can't access server \%1 set modem \%2 ; Set modem type if fail end 1 unknown modem type: \%2 dial \%3 ; Dial the number if fail end 1 Can't place call: \%3 end 0 Connection successful.}COMMENT - SPRINT macro. Arguments:; \%1 = Service name or address;def SPRINT { if < \v(argc) 2 end 1 Usage: \%0 service set input timeout proceed output @D\13 input 10 TERMINAL= if fail end 1 No terminal prompt out D1\13 inp 10 @ if fail end 1 No atsign prompt output c \%1\13 input 10 CONNECTED if fail end 1 Can't access \%1 from SprintNet}COMMENT - ULOGIN macro. For logging into systems where user ID is required; but there is no password. Arguments:; \%1 = UNIX user ID;define ULOGIN { if < \v(argc) 2 end 1 Usage: \%0 userid set input timeout proceed ; Handle timeouts ourselves set case on ; Case is important in UNIX minput 5 login: Username: {User ID:} {User Name:} out \%1\13 ; Send username, carriage return end 0}COMMENT - VMSLOGIN macro. Arguments:; \%1 = VMS user ID; \%2 = Password. If password not supplied, it is prompted for.; \%3 = System prompt. If omitted a default is supplied.;define VMSLOGIN { if < \v(argc) 2 end 1 Usage: \%0 userid [ password [ prompt ] ] while not defined \%2 { askq \%2 { \%1's password: } } set parity none ; Set communication parameters set duplex full set handshake none set input timeout proceed ; Handle timeouts ourselves in 5 Username: ; Is prompt already there? xif fail { ; No. for \%i 1 3 1 { ; Try 3 times to get it. out \13 ; Send carriage return in 5 Username: ; Look for prompt if success break ; Success, go log in } if > \%i 3 end 1 No Username prompt } out \%1\13 ; Send username, carriage return inp 5 Password: ; Wait 5 sec for this prompt if fail end 1 No password prompt pause ; Wait a sec out \%2\13 ; Send password xif not emulation { ; No emulator built in? set input echo off ; Protect terminal from this minput 10 {\27Z} {\27[c} {\27[0c} ; Get terminal ID query xif success { ; Got one output \27[\?1c ; Send VT100 terminal ID in 2 \27[6n ; Screen dimension query? if succ out \27[\v(rows);\v(cols)R ; Send dimensions } set input echo on ; Echo input again } if not def \%3 - ; If we were not given a prompt asg \%3 {\v(prompt)} ; use the SET LOGIN PROMPT value if not def \%3 - ; If we still don't have a prompt asg \%3 {\13$\32} ; use this one as the default reinp 0 \%3 ; Did we INPUT the prompt already? if fail inp 60 \%3 ; No, look now. if fail end 1}COMMENT - UNIXLOGIN macro. Arguments:; \%1 = UNIX user ID; \%2 = Password. If password not supplied, it is prompted for.; \%3 = System prompt. If omitted a default is supplied.;define UNIXLOGIN { local \%m \%i if < \v(argc) 2 - end 1 Usage: \%0 userid [ password [ prompt ] ] while not defined \%2 { askq \%2 { \%1's password: } } set input echo on set parity none ; Set communication parameters. set duplex full set handshake none set input timeout proceed ; Handle timeouts ourselves set case on ; Case is important in UNIX def \%m 10 ; Waiting time for INPUT for \%i 1 5 1 { minput \%m login: {ssword:} {Password for \%1:} if success break output \B\13 \%m ::= 6-\%1 } if > \%i 5 end 1 {No response from host} xif = \v(minput) 1 { ; Have username prompt output \%1\13 ; Send username minput 5 {ssword:} {ssword for \%1:} ; Wait for password prompt if fail end 1 {No password prompt} } pause ; Wait a sec out \%2\13 ; Send password if not def \%3 - ; If we were not given a prompt asg \%3 {\v(prompt)} ; use the SET LOGIN PROMPT value if not def \%3 - ; If we still don't have a prompt asg \%3 {\10$ } ; use this one as the default reinp 0 \%3 ; Did we INPUT the prompt already? if fail inp 60 \%3 ; No, look now. if fail end 1}COMMENT - VMLINELOGIN macro. Arguments:; \%1 = User ID; \%2 = Password;define VMLINELOGIN { if < \v(argc) 2 - end 1 Usage: \%0 userid [ password ] while not defined \%2 { askq \%2 { \%1's password: } } set parity mark ; Set communication parameters set flow none set handshake xon set duplex half set input timeout quit ; Don't bother with IF FAILURE input 10 BREAK KEY ; Look for BREAK KEY prompt pause 1 ; Wait a second output \B ; Send BREAK input 10 .\17, output logon \%1\13 ; Now log in input 10 .\17, output \%2\13 ; Send password input 10 .\17, output \13 ; Send carriage return input 10 .\17, output \13 ; Send another one end 0}COMMENT - VMFULLOGIN macro. Arguments:; \%1 = User ID; \%2 = Password;define VMFULLOGIN { if < \v(argc) 2 - end 1 Usage: \%0 userid [ password ] while not defined \%2 { askq \%2 { \%1's password: } } set input timeout quit ; Quit if INPUT fails set parity even ; Set communication parameters set duplex full set handshake none set flow xon/xoff out \13 ; Send carriage return inp 5 TERMINAL TYPE: ; Get terminal-type prompt out vt-100\13 ; Just send "vt-100" inp 20 RUNNING ; Get RUNNING message pau 1 ; Wait one second out \%1\9\%2\13 ; Send user ID, tab, password out \13\13 ; Two more carriage returns end 0}COMMENT - CISLOGIN macro. Arguments:; \%1 = CompuServe User ID; \%2 = Password; \%3 = Prompt;define CISLOGIN { if < \v(argc) 2 - end 1 Usage: \%0 userid [ password [ prompt ] ] while not defined \%2 { askq \%2 { \%1's password: } } set terminal bytesize 7 ; No 8-bit characters set input timeout quit ; Skip the IF FAILURE's output \13 ; Send initial carriage return input 5 Host Name: ; Look for Host Name prompt output cis\13 ; Send "cis" and carriage return input 5 User ID: ; Look for User ID prompt output \%1\13 ; Send ID and carriage return input Password: ; Look for Password prompt output \%2\13 ; Send password and CR if not def \%3 asg \%3 \v(prompt) if not def \%3 asg \%3 {CompuServe Information Service} input 30 \%3 end 0}COMMENT - DOWLOGIN macro. Arguments:; \%1 = Dow Jones Password;define DOWLOGIN { while not defined \%1 { ; Get password askq \%1 { Dow Jones password: } } set input timeout proceed input 20 SERVICE PLEASE\?\?\?\? ; Look for Dow prompt if fail end 1 No service prompt out djnr\13 ; Select DJNR input 10 @@@@@@@@ ; Get password prompt if fail end 1 No password prompt pause 1 ; Wait a second, then... output \%1\13 ; send password and CR input 30 ENTER QUERY ; Get DJNR query prompt if fail end 1 No main query prompt pause 1}COMMENT - DJNRSPRINT macro: Log in to Dow Jones via SprintNet.;def djnrsprint sprint dow, if success dowloginCOMMENT - NOLOGIN macro. Does nothing. Use when login not required.;def nologin comment:CUSTOM ; Customization file; In VMS and OpenVMS, allow for system-wide site customizationsxif equal "\v(system)" "VMS" { xif exist CKERMIT_INI:CKERMIT.SYS { echo Executing CKERMIT_INI:CKERMIT.SYS take CKERMIT_INI:CKERMIT.SYS }}; Execute user's personal customization filexif exist \m(_myinit) { ; If it exists, echo Executing \m(_myinit)... ; print message, take \m(_myinit) ; and TAKE the file.}; Finish up with traditional greeting.if < \v(ntime) 43200 echo Good Morning! else if < \v(ntime) 61200 echo Good Afternoon! else echo Good Evening.End ; of C-Kermit 7.0 initialization file.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -