Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

default.src 13.2 KB
Newer Older
1
# default.src
2

3 4
# Default Command Shell for Synchronet Version 2.00a+

5
# $Id: default.src,v 1.29 2020/05/26 19:25:26 rswindell Exp $
6 7

# @format.tab-size 8, @format.use-tabs true
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

###############################################################################
# This shell is an imitation of the Version 1c command set/structure	      #
#									      #
# It also serves as an example of a complex command shell using the Baja      #
# command shell language						      #
#									      #
###############################################################################

# Tips:
#
#	Tabstops should be set to 8 to view/edit this file
#	If your editor does not support control characters,
#		use \1 for Ctrl-A codes
#	All lines starting with # are considered comments and are ignored
#	Left margins (indents) are not relevant and used only for clarity
#	Almost everything is not case sensitive with the exception of @-codes

################################# Begins Here #################################

!include sbbsdefs.inc

rswindell's avatar
rswindell committed
30 31
str last_str_cmd

32 33 34 35 36 37 38
# Set return point for main menu commands (via end_cmd)
cmd_home

# Display TEXT\MENU\MAIN.* if not in expert mode
compare_user_misc UM_EXPERT
if_false
	cls
39
	menu main
40 41 42 43 44 45 46 47
	end_if

# Update node status
node_action node_main
async

inc_main_cmds

48 49 50 51 52
compare_ars RIP
if_true
	getlines
	end_if

53
# Display main Prompt
54
print "\1-\1c\r\n\xfe \1b\1hMain \1n\1c\xfe \1h"
55 56 57 58 59 60
compare_ars exempt T
if_true
	print "@TUSED@"
else
	print "@TLEFT@"
	end_if
61
print " \1n\1c[\1h@GN@\1n\1c] @GRP@\1\\ [\1h@SN@\1n\1c] @SUB@: \1n"
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110

# Get key (with / extended commands allowed)
compare_user_misc UM_COLDKEYS
if_false
	getkeye
else
	getstrupr 60
	endif

# Do nothing for control keys and space
cmdkey ^@
	end_cmd
cmdkey ^M
	end_cmd
cmdkey ^S
	end_cmd
 cmdkey  "
	end_cmd

# Write command to log file
logkey_comma

# Hitting number changes current sub-board
cmdkey digit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
		end_if
	msg_get_sub_num
	end_cmd

# Hitting /number changes current group
cmdkey edigit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
	else
		shift_str 1
		end_if
	msg_get_grp_num
	end_cmd

# Show the key hit
compare_user_misc UM_COLDKEYS
if_false
	printkey
	endif

# Next sub-board
111 112 113
cmdkey ^^
	msg_subboard_up
	end_cmd
114 115 116 117 118 119
cmdkey >
	msg_subboard_up
	end_cmd
cmdkey }
	msg_subboard_up
	end_cmd
120 121 122
cmdkey )
	msg_subboard_up
	end_cmd
123 124 125 126 127 128 129 130
cmdkey +
	msg_subboard_up
	end_cmd
cmdkey =
	msg_subboard_up
	end_cmd

# Previous sub-board
131 132 133
cmdkey ^J
	msg_subboard_down
	end_cmd
134 135 136 137 138 139
cmdkey <
	msg_subboard_down
	end_cmd
cmdkey {
	msg_subboard_down
	end_cmd
140 141 142
cmdkey (
	msg_subboard_down
	end_cmd
143 144 145 146 147
cmdkey -
	msg_subboard_down
	end_cmd

# Next group
148 149 150
cmdkey ^F
	msg_group_up
	end_cmd
151 152 153 154 155
cmdkey ]
	msg_group_up
	end_cmd

# Previous group
156 157 158
cmdkey ^]
	msg_group_down
	end_cmd
159 160 161 162 163 164 165 166 167 168
cmdkey [
	msg_group_down
	end_cmd

# String commands start with a semicolon
cmdkey ;
	compare_user_misc UM_COLDKEYS
	if_true
		shift_str 1
	else
169
		getstr 40
170
		end_if
rswindell's avatar
rswindell committed
171 172 173 174
    compare_str !
    if_equal
        copy str last_str_cmd
        end_if
175
	exec_bin "str_cmds %s"
rswindell's avatar
rswindell committed
176 177 178 179
    compare_str ""
    if_not_equal
        copy last_str_cmd str
        end_if
180 181 182
	end_cmd

cmdkey T
183
	chkfile "%zmenu/tmessage.*"
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
	if_true
		menu tmessage
		end_if
        call file_transfers
        end_cmd

compare_user_misc UM_COLDKEYS
if_false
	crlf
	end_if
pause_reset

# Menu
cmdkey ?
	compare_user_misc UM_expert
	if_true
		menu main
		end_if
	end_cmd

# Sysop Menu
compare_ars SYSOP or EXEMPT Q or I or N
if_true
	cmdkey !
		menu sysmain
		end_cmd
	end_if

# Commands

cmdkey A
215
	auto_message
216
	end_cmd
217
    
218
cmdkey /A
219 220 221 222 223 224 225 226 227
	compare_ars ANSI and not GUEST
	if_false
		print "\r\nSorry, only regular users with ANSI terminals can do that.\r\n"
	else
		print "Selecting your avatar..."
		exec_bin avatar_chooser
		# an alternative approach (uses the configured xtrn/door):
		# exec_xtrn avatchoo
		end_if
228
	end_cmd
229 230

cmdkey B
231
	print "\r\n\1c\1hBrowse/New Message Scan\r\n"
232 233 234 235
	msg_browse_scan
	end_cmd

cmdkey C
236
	exec_bin chat_sec
237 238 239 240
	end_cmd

cmdkey D
	user_defaults
241
	exec_bin "termsetup"
242 243 244
	end_cmd

cmdkey E
245
	exec_bin email_sec
246 247 248
	end_cmd

cmdkey F
249
	print "\r\n\1c\1hFind Text in Messages\r\n"
250 251 252 253 254 255 256 257
	msg_find_text
	end_cmd

cmdkey /F
	msg_find_text_all
	end_cmd

cmdkey G
258
	text_file_section
259 260 261 262 263 264 265 266 267
	end_cmd

cmdkey I
	call main_info
	end_cmd

cmdkey J
	msg_select_area
	end_cmd
268 269
    
cmdkey L
270
    msg_list
271
    end_cmd
272 273

cmdkey /L
274
	nodelist_all
275 276
	end_cmd

277
cmdkey W
278
	nodelist_users
279 280
	end_cmd
    
281 282 283 284 285
cmdkey M
	minute_bank
	end_cmd

cmdkey N
286
	print "\r\n\1c\1hNew Message Scan\r\n"
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
	msg_new_scan
	end_cmd

cmdkey /N
	msg_new_scan_all
	end_cmd

cmdkey O
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff
	end_cmd

cmdkey /O
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff_fast
	end_cmd

cmdkey P
	msg_post
	end_cmd

314 315 316 317
cmdkey /P
	exec_bin postpoll
	end_cmd

318 319 320 321 322 323 324 325 326
cmdkey Q
	msg_qwk
	end_cmd

cmdkey R
	msg_read
	end_cmd

cmdkey S
327
	print "\r\n\1c\1hScan for Messages Posted to You\r\n"
328 329 330 331 332 333 334 335
	msg_your_scan
	end_cmd

cmdkey /S
	msg_your_scan_all
	end_cmd

cmdkey U
336
	print "\r\n\1c\1hList Users\r\n"
337
	mnemonics "\r\n~Logons Today, ~Yesterday, ~Sub-board, or ~All: "
338
	getcmd LSAY\r
339 340

	cmdkey L
341
		userlist_logons
342 343 344
		end_cmd
	cmdkey Y
		exec_bin "logonlist -y"
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
		end_cmd
	cmdkey S
		userlist_sub
		end_cmd
	cmdkey A
		userlist_all
		end_cmd

	# fall-through for CR, Ctrl-C, etc
	end_cmd

cmdkey /U
	userlist_all
	end_cmd

360 361 362 363 364 365 366 367
cmdkey V
    exec_bin scanpolls
    end_cmd

cmdkey /V
    exec_bin scanpolls all
    end_cmd

368
cmdkey X
369
	xtrn_section
370 371 372
	end_cmd

cmdkey Z
373
	print "\r\n\1c\1hContinuous New Message Scan\r\n"
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
	msg_cont_scan
	end_cmd

cmdkey /Z
	msg_cont_scan_all
	end_cmd

cmdkey *
	msg_show_subboards
	end_cmd

cmdkey /*
	msg_show_groups
	end_cmd

cmdkey &
	call main_cfg
	end_cmd

cmdkey #
394
	print "\r\n\1c\1hType the actual number, not the symbol.\r\n"
395 396 397
	end_cmd

cmdkey /#
398
	print "\r\n\1c\1hType the actual number, not the symbol.\r\n"
399 400 401
        end_cmd

# fall through
402
print "\r\n\1c\1hUnrecognized command."
403 404
compare_user_misc UM_expert
if_true
405
	print " Hit '\1i?\1n\1c\1h' for a menu."
406 407 408 409 410 411 412 413
	end_if
crlf
end_cmd

# shouldn't hit next line
print "Problem in command shell."
pause
hangup
rswindell's avatar
rswindell committed
414
return
415 416 417 418 419 420 421

############################ Main Info Section	###############################

:main_info
cmd_home
compare_user_misc UM_expert
if_false
422
	menu maininfo
423 424
	end_if
async
425
print "\r\n\1y\1hInfo: \1n"
426 427 428 429 430 431
getcmd ?QISVY\r
logkey

cmdkey ?
	compare_user_misc UM_expert
	if_true
432
		menu maininfo
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
		end_if
	end_cmd

cmdkey I
	info_system
	end_cmd

cmdkey S
	info_subboard
	end_cmd

cmdkey Y
	info_user
	end_cmd

cmdkey V
	info_version
	end_cmd

cmdkey Q
	cmd_pop
	return
	end_cmd

cmd_pop
return

########################### Main Config Section  ##############################

:main_cfg

compare_user_misc UM_expert
if_false
466
	menu maincfg
467 468
	end_if
async
469
print "\r\n\1y\1hConfig: \1n"
470 471 472 473 474 475
getcmd ?QNPIS\r
logkey

cmdkey ?
	compare_user_misc UM_expert
	if_true
476
		menu maincfg
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511
		end_if
	goto main_cfg
	end_cmd

cmdkey N
	msg_new_scan_cfg
	return
	end_cmd

cmdkey S
	msg_your_scan_cfg
	return
	end_cmd

cmdkey P
	msg_ptrs_cfg
	return
	end_cmd

cmdkey I
	msg_ptrs_reinit
	return
	end_cmd

return


########################### File Transfer Section #############################

:file_transfers

compare_ars file_cmds=0
if_true
	compare_user_misc UM_ask_nscan
	if_true
512 513 514
		crlf
		crlf
		yes_no "Search all libraries for new files"
515 516 517 518 519 520 521 522 523 524 525
		if_true
			file_new_scan_all
			end_if
		end_if
	end_if

cmd_home

compare_user_misc UM_expert
if_false
	cls
526
	menu transfer
527 528 529 530 531 532 533 534 535
	end_if

# Update node status
node_action node_xfer
async

inc_file_cmds

# Display main Prompt
536
print "\1-\1c\r\n\xfe \1b\1hFile \1n\1c\xfe \1h"
537 538 539 540 541 542
compare_ars exempt T
if_true
	print "@TUSED@"
else
	print "@TLEFT@"
	end_if
543
print " \1n\1c(\1h@LN@\1n\1c) @LIB@\1\\ (\1h@DN@\1n\1c) @DIR@: \1n"
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597

# Get key (with / extended commands allowed)
compare_user_misc UM_COLDKEYS
if_false
	getkeye
else
	getstrupr 60
        endif

compare_ars RIP
if_true
	getlines
	end_if

# Do nothing for control keys and space
cmdkey ^@
	end_cmd
cmdkey ^M
	end_cmd
cmdkey ^S
	end_cmd
 cmdkey  "
	end_cmd

# Write command to log file
logkey_comma

# Hitting number changes current sub-board
cmdkey digit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
                end_if
	file_get_dir_num
	end_cmd

# Hitting /number changes current group
cmdkey edigit
	compare_user_misc UM_COLDKEYS
	if_false
		ungetkey
	else
		shift_str 1
                end_if
	file_get_lib_num
	end_cmd

# Show the key hit
compare_user_misc UM_COLDKEYS
if_false
	printkey
        endif

# Next directory
598 599 600
cmdkey ^^
	file_directory_up
	end_cmd
601 602 603 604 605 606
cmdkey >
	file_directory_up
	end_cmd
cmdkey }
	file_directory_up
	end_cmd
607 608 609
cmdkey )
	file_directory_up
	end_cmd
610 611 612 613 614 615 616 617
cmdkey +
	file_directory_up
	end_cmd
cmdkey =
	file_directory_up
	end_cmd

# Previous directory
618 619 620
cmdkey ^J
	file_directory_down
	end_cmd
621 622 623 624 625 626
cmdkey <
	file_directory_down
	end_cmd
cmdkey {
	file_directory_down
	end_cmd
627 628 629
cmdkey (
	file_directory_down
	end_cmd
630 631 632 633 634
cmdkey -
	file_directory_down
	end_cmd

# Next library
635 636 637
cmdkey ^F
	file_library_up
	end_cmd
638 639 640 641 642
cmdkey ]
	file_library_up
	end_cmd

# Previous library
643 644 645
cmdkey ^]
	file_library_down
	end_cmd
646 647 648 649 650 651 652 653 654 655
cmdkey [
	file_library_down
	end_cmd

# String commands start with a semicolon
cmdkey ;
	compare_user_misc UM_COLDKEYS
	if_true
		shift_str 1
	else
656
        getstr 40
657
		end_if
rswindell's avatar
rswindell committed
658 659 660 661
    compare_str !
    if_equal
        copy str last_str_cmd
        end_if
662
	exec_bin "str_cmds %s"
rswindell's avatar
rswindell committed
663 664 665 666
    compare_str ""
    if_not_equal
        copy last_str_cmd str
        end_if
667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
	end_cmd

cmdkey Q
        cmd_pop
        return
        end_cmd

compare_user_misc UM_COLDKEYS
if_false
	crlf
	end_if
pause_reset

# Menu
cmdkey ?
	compare_user_misc UM_expert
	if_true
684
		menu transfer
685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702
		end_if
	end_cmd

# Sysop Menu
compare_ars SYSOP
if_true
	cmdkey !
		menu sysxfer
		end_cmd
	end_if

# Commands

cmdkey B
	file_batch_section
	end_cmd

cmdkey C
703
	exec_bin chat_sec
704 705 706
	end_cmd

cmdkey D
707
	print "\r\n\1c\1hDownload File(s)\r\n"
708 709 710 711 712 713 714 715 716 717 718
	file_download_batch
	if_true
		end_cmd
		end_if
	getfilespec
	if_true
		file_download
		end_if
	end_cmd

cmdkey /D
719
	print "\r\n\1c\1hDownload File(s) from User(s)\r\n"
720 721 722 723
	file_download_user
	end_cmd

cmdkey E
724
	print "\r\n\1c\1hList Extended File Information\r\n"
725 726 727 728 729 730 731
	getfilespec
	if_true
		file_list_extended
		end_if
	end_cmd

cmdkey F
732
	print "\r\n\1c\1hFind Text in File Descriptions (no wildcards)\r\n"
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748
	file_find_text
	end_cmd

cmdkey /F
	file_find_text_all
        end_cmd

cmdkey I
	call file_info
	end_cmd

cmdkey J
	file_select_area
	end_cmd

cmdkey L
749
	setstr *
750 751 752 753
	file_list
	end_cmd

cmdkey /L
754
	nodelist_all
755
	end_cmd
756 757
    
cmdkey W
758
	nodelist_users
759 760
	end_cmd
   
761
cmdkey N
762
	print "\r\n\1c\1hNew File Scan\r\n"
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
	file_new_scan
	end_cmd

cmdkey /N
	file_new_scan_all
	end_cmd

cmdkey O
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff
	end_cmd

cmdkey /O
	file_download_batch
	if_true
		end_cmd
                end_if
	logoff_fast
        end_cmd

cmdkey R
787
	print "\r\n\1c\1hRemove/Edit File(s)\r\n"
788 789 790 791 792 793 794
	getfilespec
	if_true
		file_remove
		end_if
	end_cmd

cmdkey S
795
	print "\r\n\1c\1hSearch for Filename(s)\r\n"
796 797 798 799 800 801 802 803 804 805 806 807
	file_find_name
	end_cmd

cmdkey /S
	file_find_name_all
	end_cmd

cmdkey T
	file_temp_section
	end_cmd

cmdkey U
808
	print "\r\n\1c\1hUpload File\r\n"
809
	chkfile "%zmenu/upload.*"
810 811 812 813 814 815 816
	if_true
		menu upload
		end_if
	file_upload
	end_cmd

cmdkey /U
817
	print "\r\n\1c\1hUpload File to User\r\n"
818 819 820 821
	file_upload_user
	end_cmd

cmdkey V
822
	print "\r\n\1c\1hView File(s)\r\n"
823 824 825 826 827 828 829
	getfilespec
	if_true
		file_view
		end_if
	end_cmd

cmdkey Z
830
	print "\r\n\1c\1hUpload File to Sysop\r\n"
831 832 833 834 835 836 837 838 839 840 841 842 843 844 845
	file_upload_sysop
	end_cmd

cmdkey *
	file_show_directories
	end_cmd

cmdkey /*
	file_show_libraries
	end_cmd

cmdkey &
	:xfercfg
	compare_user_misc UM_expert
	if_false
846
		menu xfercfg
847 848
		end_if
	async
849
	print "\r\n\1y\1hConfig: \1n"
850 851 852 853 854 855
	getcmd ?QBEP\r
	logkey

	cmdkey ?
		compare_user_misc UM_expert
		if_true
856
			menu xfercfg
857 858 859 860 861 862 863 864 865
			end_if
		goto xfercfg
		end_cmd

	cmdkey P
		file_ptrs_cfg
		end_cmd

	cmdkey B
866
                crlf
867
		toggle_user_misc UM_BATCHFLAG
868 869 870 871 872 873 874 875
                compare_user_misc UM_BATCHFLAG
                print "Batch flagging in file listings is now: \1h"
                if_true
                    print "ON"
                else
                    print "OFF"
                    end_if
                crlf
876
		end_cmd
877
    
878
	cmdkey E
879
                crlf
880
		toggle_user_misc UM_EXTDESC
881 882 883 884 885 886 887 888
                compare_user_misc UM_EXTDESC
                print "Extended file description display is now: \1h"
                if_true
                    print "ON"
                else
                    print "OFF"
                    end_if
                crlf
889 890 891 892
                end_cmd
	end_cmd

cmdkey #
893
	print "\r\n\1c\1hType the actual number, not the symbol.\r\n"
894 895 896
	end_cmd

cmdkey /#
897
	print "\r\n\1c\1hType the actual number, not the symbol.\r\n"
898 899 900
        end_cmd

# fall through
901
print "\r\n\1c\1hUnrecognized command."
902 903
compare_user_misc UM_expert
if_true
904
	print " Hit '\1i?\1n\1c\1h' for a menu."
905 906 907 908 909 910 911 912 913 914 915 916 917 918 919
	end_if
crlf
end_cmd

# shouldn't hit next line
print "Problem in command shell."
pause
hangup

############################ File Info Section	###############################

:file_info
cmd_home
compare_user_misc UM_expert
if_false
920
	menu xferinfo
921 922
	end_if
async
923
print "\r\n\1y\1hInfo: \1n"
924 925 926 927 928 929
getcmd ?TYDUQ\r
logkey

cmdkey ?
	compare_user_misc UM_expert
	if_true
930
		menu xferinfo
931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958
		end_if
	end_cmd

cmdkey T
	info_xfer_policy
	end_cmd

cmdkey Y
	info_user
	end_cmd

cmdkey D
	info_directory
	end_cmd

cmdkey U
	userlist_dir
	end_cmd

cmdkey Q
	cmd_pop
	return
	end_cmd

cmd_pop
return

#end of DEFAULT.SRC