home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / dos / sbbs230b.exe / EXEC.LZH / DEFAULT.SRC < prev    next >
Encoding:
Text File  |  1995-09-05  |  12.9 KB  |  921 lines

  1. # DEFAULT.SRC
  2.  
  3. # Copyright 1994 Digital Dynamics
  4.  
  5. ###############################################################################
  6. #                                          #
  7. # Default Command Shell for Synchronet Version 2.00a                  #
  8. #                                          #
  9. # This shell is an imitation of the Version 1c command set/structure          #
  10. #                                          #
  11. # It also serves as an example of a complex command shell using the Baja      #
  12. # command shell language                              #
  13. #                                          #
  14. ###############################################################################
  15.  
  16. # Tips:
  17. #
  18. #    Tabstops should be set to 8 to view/edit this file
  19. #    If your editor does not support control characters,
  20. #        use \1 for Ctrl-A codes
  21. #    All lines starting with # are considered comments and are ignored
  22. #    Left margins (indents) are not relevant and used only for clarity
  23. #    Almost everything is not case sensitive with the exception of @-codes
  24.  
  25. ################################# Begins Here #################################
  26.  
  27. !include sbbsdefs.inc
  28.  
  29. # Set return point for main menu commands (via end_cmd)
  30. cmd_home
  31.  
  32. # Display TEXT\MENU\MAIN.* if not in expert mode
  33. compare_user_misc UM_EXPERT
  34. if_false
  35.     cls
  36.     menu MAIN
  37.     end_if
  38.  
  39. # Update node status
  40. node_action node_main
  41. async
  42.  
  43. inc_main_cmds
  44.  
  45. # Display main Prompt
  46. print "-c\r\n■ bhMain nc■ h"
  47. compare_ars exempt T
  48. if_true
  49.     print "@TUSED@"
  50. else
  51.     print "@TLEFT@"
  52.     end_if
  53. print " nc[h@GN@nc] @GRP@ [h@SN@nc] @SUB@: n"
  54.  
  55. # Get key (with / extended commands allowed)
  56. compare_user_misc UM_COLDKEYS
  57. if_false
  58.     getkeye
  59. else
  60.     getstrupr 60
  61.     endif
  62.  
  63. compare_ars RIP
  64. if_true
  65.     getlines
  66.     end_if
  67.  
  68. # Do nothing for control keys and space
  69. cmdkey ^@
  70.     end_cmd
  71. cmdkey ^M
  72.     end_cmd
  73. cmdkey ^S
  74.     end_cmd
  75.  cmdkey  "
  76.     end_cmd
  77.  
  78. # Write command to log file
  79. logkey_comma
  80.  
  81. # Hitting number changes current sub-board
  82. cmdkey digit
  83.     compare_user_misc UM_COLDKEYS
  84.     if_false
  85.         ungetkey
  86.         end_if
  87.     msg_get_sub_num
  88.     end_cmd
  89.  
  90. # Hitting /number changes current group
  91. cmdkey edigit
  92.     compare_user_misc UM_COLDKEYS
  93.     if_false
  94.         ungetkey
  95.     else
  96.         shift_str 1
  97.         end_if
  98.     msg_get_grp_num
  99.     end_cmd
  100.  
  101. # Show the key hit
  102. compare_user_misc UM_COLDKEYS
  103. if_false
  104.     printkey
  105.     endif
  106.  
  107. # Next sub-board
  108. cmdkey >
  109.     msg_subboard_up
  110.     end_cmd
  111. cmdkey }
  112.     msg_subboard_up
  113.     end_cmd
  114. cmdkey +
  115.     msg_subboard_up
  116.     end_cmd
  117. cmdkey =
  118.     msg_subboard_up
  119.     end_cmd
  120.  
  121. # Previous sub-board
  122. cmdkey <
  123.     msg_subboard_down
  124.     end_cmd
  125. cmdkey {
  126.     msg_subboard_down
  127.     end_cmd
  128. cmdkey -
  129.     msg_subboard_down
  130.     end_cmd
  131.  
  132. # Next group
  133. cmdkey ]
  134.     msg_group_up
  135.     end_cmd
  136.  
  137. # Previous group
  138. cmdkey [
  139.     msg_group_down
  140.     end_cmd
  141.  
  142. # String commands start with a semicolon
  143. cmdkey ;
  144.     compare_user_misc UM_COLDKEYS
  145.     if_true
  146.         shift_str 1
  147.     else
  148.         getstrupr 40
  149.         end_if
  150.     exec_bin str_cmds
  151.     end_cmd
  152.  
  153. cmdkey T
  154.     chkfile "..\text\menu\tmessage.*"
  155.     if_true
  156.         menu tmessage
  157.         end_if
  158.         call file_transfers
  159.         end_cmd
  160.  
  161. compare_user_misc UM_COLDKEYS
  162. if_false
  163.     crlf
  164.     end_if
  165. pause_reset
  166.  
  167. # Menu
  168. cmdkey ?
  169.     compare_user_misc UM_expert
  170.     if_true
  171.         menu main
  172.         end_if
  173.     end_cmd
  174.  
  175. # Sysop Menu
  176. compare_ars SYSOP or EXEMPT Q or I or N
  177. if_true
  178.     cmdkey !
  179.         menu sysmain
  180.         end_cmd
  181.     end_if
  182.  
  183. # Commands
  184.  
  185. cmdkey A
  186.     auto_message
  187.     end_cmd
  188.  
  189. cmdkey B
  190.     print "\r\nchBrowse/New Message Scan\r\n"
  191.     msg_browse_scan
  192.     end_cmd
  193.  
  194. cmdkey C
  195.     chat_section
  196.     end_cmd
  197.  
  198. cmdkey D
  199.     user_defaults
  200.     end_cmd
  201.  
  202. cmdkey E
  203.     call E-mail
  204.     end_cmd
  205.  
  206. cmdkey F
  207.     print "\r\nchFind Text in Messages\r\n"
  208.     msg_find_text
  209.     end_cmd
  210.  
  211. cmdkey /F
  212.     msg_find_text_all
  213.     end_cmd
  214.  
  215. cmdkey G
  216.     text_file_section
  217.     end_cmd
  218.  
  219. cmdkey I
  220.     call main_info
  221.     end_cmd
  222.  
  223. cmdkey J
  224.     msg_select_area
  225.     end_cmd
  226.  
  227. cmdkey /L
  228.     nodelist_all
  229.     end_cmd
  230.  
  231. cmdkey M
  232.     minute_bank
  233.     end_cmd
  234.  
  235. cmdkey N
  236.     print "\r\nchNew Message Scan\r\n"
  237.     msg_new_scan
  238.     end_cmd
  239.  
  240. cmdkey /N
  241.     msg_new_scan_all
  242.     end_cmd
  243.  
  244. cmdkey O
  245.     file_download_batch
  246.     if_true
  247.         end_cmd
  248.                 end_if
  249.     logoff
  250.     end_cmd
  251.  
  252. cmdkey /O
  253.     file_download_batch
  254.     if_true
  255.         end_cmd
  256.                 end_if
  257.     logoff_fast
  258.     end_cmd
  259.  
  260. cmdkey P
  261.     msg_post
  262.     end_cmd
  263.  
  264. cmdkey Q
  265.     msg_qwk
  266.     end_cmd
  267.  
  268. cmdkey R
  269.     msg_read
  270.     end_cmd
  271.  
  272. cmdkey S
  273.     print "\r\nchScan for Messages Posted to You\r\n"
  274.     msg_your_scan
  275.     end_cmd
  276.  
  277. cmdkey /S
  278.     msg_your_scan_all
  279.     end_cmd
  280.  
  281. cmdkey U
  282.     print "\r\nchList Users\r\n"
  283.     mnemonics "\r\n~Logons Today, ~Sub-board, or ~All: "
  284.     getcmd LSA\r
  285.  
  286.     cmdkey L
  287.         userlist_logons
  288.         end_cmd
  289.     cmdkey S
  290.         userlist_sub
  291.         end_cmd
  292.     cmdkey A
  293.         userlist_all
  294.         end_cmd
  295.  
  296.     # fall-through for CR, Ctrl-C, etc
  297.     end_cmd
  298.  
  299. cmdkey /U
  300.     userlist_all
  301.     end_cmd
  302.  
  303. cmdkey X
  304.     xtrn_section
  305.     end_cmd
  306.  
  307. cmdkey Z
  308.     print "\r\nchContinuous New Message Scan\r\n"
  309.     msg_cont_scan
  310.     end_cmd
  311.  
  312. cmdkey /Z
  313.     msg_cont_scan_all
  314.     end_cmd
  315.  
  316. cmdkey *
  317.     msg_show_subboards
  318.     end_cmd
  319.  
  320. cmdkey /*
  321.     msg_show_groups
  322.     end_cmd
  323.  
  324. cmdkey &
  325.     call main_cfg
  326.     end_cmd
  327.  
  328. cmdkey #
  329.     print "\r\nchType the actual number, not the symbol.\r\n"
  330.     end_cmd
  331.  
  332. cmdkey /#
  333.     print "\r\nchType the actual number, not the symbol.\r\n"
  334.         end_cmd
  335.  
  336. # fall through
  337. print "\r\nchUnrecognized command."
  338. compare_user_misc UM_expert
  339. if_true
  340.     print " Hit 'i?nch' for a menu."
  341.     end_if
  342. crlf
  343. end_cmd
  344.  
  345. # shouldn't hit next line
  346. print "Problem in command shell."
  347. pause
  348. hangup
  349.  
  350. ############################### E-mail Section ################################
  351.  
  352. :e-mail
  353. cmd_home
  354. compare_user_misc UM_expert
  355. if_false
  356.     menu E-MAIL
  357.     end_if
  358. async
  359. print "\r\nyhE-mail: n"
  360. getcmd ?SRFNUKQ\r
  361. logkey
  362.  
  363. cmdkey ?
  364.     compare_user_misc UM_expert
  365.     if_true
  366.         menu E-MAIL
  367.         end_if
  368.     end_cmd
  369.  
  370. cmdkey S
  371.     print "_\r\nbhE-mail (User name or number): w"
  372.     getname 25
  373.     compare_str ""
  374.     if_true
  375.         end_cmd
  376.         end_if
  377.     compare_str "SYSOP"
  378.     if_true
  379.         setstr "1"
  380.         end_if
  381.     mail_send
  382.     end_cmd
  383.  
  384. cmdkey U
  385.     print "_\r\nbhE-mail (User name or number): w"
  386.     getname 25
  387.     compare_str ""
  388.     if_true
  389.         end_cmd
  390.         end_if
  391.     compare_str "SYSOP"
  392.     if_true
  393.         setstr "1"
  394.         end_if
  395.     mail_send_file
  396.         end_cmd
  397.  
  398. cmdkey R
  399.     mail_read
  400.     end_cmd
  401.  
  402. cmdkey F
  403.     setstr "1"
  404.     mail_send_feedback
  405.     end_cmd
  406.  
  407. cmdkey N
  408.     no_yes "\r\nAttach a file"
  409.     if_true
  410.         mail_send_netmail
  411.     else    
  412.         mail_send_netfile
  413.         end_if
  414.     end_cmd
  415.  
  416. cmdkey K
  417.     mail_read_sent
  418.     end_cmd
  419.  
  420. cmdkey Q
  421.     cmd_pop
  422.     return
  423.     end_cmd
  424.  
  425. cmd_pop
  426. return
  427.  
  428. ############################ Main Info Section    ###############################
  429.  
  430. :main_info
  431. cmd_home
  432. compare_user_misc UM_expert
  433. if_false
  434.     menu MAININFO
  435.     end_if
  436. async
  437. print "\r\nyhInfo: n"
  438. getcmd ?QISVY\r
  439. logkey
  440.  
  441. cmdkey ?
  442.     compare_user_misc UM_expert
  443.     if_true
  444.         menu MAININFO
  445.         end_if
  446.     end_cmd
  447.  
  448. cmdkey I
  449.     info_system
  450.     end_cmd
  451.  
  452. cmdkey S
  453.     info_subboard
  454.     end_cmd
  455.  
  456. cmdkey Y
  457.     info_user
  458.     end_cmd
  459.  
  460. cmdkey V
  461.     info_version
  462.     end_cmd
  463.  
  464. cmdkey Q
  465.     cmd_pop
  466.     return
  467.     end_cmd
  468.  
  469. cmd_pop
  470. return
  471.  
  472. ########################### Main Config Section  ##############################
  473.  
  474. :main_cfg
  475.  
  476. compare_user_misc UM_expert
  477. if_false
  478.     menu MAINCFG
  479.     end_if
  480. async
  481. print "\r\nyhConfig: n"
  482. getcmd ?QNPIS\r
  483. logkey
  484.  
  485. cmdkey ?
  486.     compare_user_misc UM_expert
  487.     if_true
  488.         menu MAINCFG
  489.         end_if
  490.     goto main_cfg
  491.     end_cmd
  492.  
  493. cmdkey N
  494.     msg_new_scan_cfg
  495.     return
  496.     end_cmd
  497.  
  498. cmdkey S
  499.     msg_your_scan_cfg
  500.     return
  501.     end_cmd
  502.  
  503. cmdkey P
  504.     msg_ptrs_cfg
  505.     return
  506.     end_cmd
  507.  
  508. cmdkey I
  509.     msg_ptrs_reinit
  510.     return
  511.     end_cmd
  512.  
  513. return
  514.  
  515.  
  516. ########################### File Transfer Section #############################
  517.  
  518. :file_transfers
  519.  
  520. compare_ars file_cmds=0
  521. if_true
  522.     compare_user_misc UM_ask_nscan
  523.     if_true
  524.         yes_no "\r\n\r\nSearch all libraries for new files"
  525.         if_true
  526.             file_new_scan_all
  527.             end_if
  528.         end_if
  529.     end_if
  530.  
  531. cmd_home
  532.  
  533. compare_user_misc UM_expert
  534. if_false
  535.     cls
  536.     menu TRANSFER
  537.     end_if
  538.  
  539. # Update node status
  540. node_action node_xfer
  541. async
  542.  
  543. inc_file_cmds
  544.  
  545. # Display main Prompt
  546. print "-c\r\n■ bhFile nc■ h"
  547. compare_ars exempt T
  548. if_true
  549.     print "@TUSED@"
  550. else
  551.     print "@TLEFT@"
  552.     end_if
  553. print " nc(h@LN@nc) @LIB@ (h@DN@nc) @DIR@: n"
  554.  
  555. # Get key (with / extended commands allowed)
  556. compare_user_misc UM_COLDKEYS
  557. if_false
  558.     getkeye
  559. else
  560.     getstrupr 60
  561.         endif
  562.  
  563. compare_ars RIP
  564. if_true
  565.     getlines
  566.     end_if
  567.  
  568. # Do nothing for control keys and space
  569. cmdkey ^@
  570.     end_cmd
  571. cmdkey ^M
  572.     end_cmd
  573. cmdkey ^S
  574.     end_cmd
  575.  cmdkey  "
  576.     end_cmd
  577.  
  578. # Write command to log file
  579. logkey_comma
  580.  
  581. # Hitting number changes current sub-board
  582. cmdkey digit
  583.     compare_user_misc UM_COLDKEYS
  584.     if_false
  585.         ungetkey
  586.                 end_if
  587.     file_get_dir_num
  588.     end_cmd
  589.  
  590. # Hitting /number changes current group
  591. cmdkey edigit
  592.     compare_user_misc UM_COLDKEYS
  593.     if_false
  594.         ungetkey
  595.     else
  596.         shift_str 1
  597.                 end_if
  598.     file_get_lib_num
  599.     end_cmd
  600.  
  601. # Show the key hit
  602. compare_user_misc UM_COLDKEYS
  603. if_false
  604.     printkey
  605.         endif
  606.  
  607. # Next directory
  608. cmdkey >
  609.     file_directory_up
  610.     end_cmd
  611. cmdkey }
  612.     file_directory_up
  613.     end_cmd
  614. cmdkey +
  615.     file_directory_up
  616.     end_cmd
  617. cmdkey =
  618.     file_directory_up
  619.     end_cmd
  620.  
  621. # Previous directory
  622. cmdkey <
  623.     file_directory_down
  624.     end_cmd
  625. cmdkey {
  626.     file_directory_down
  627.     end_cmd
  628. cmdkey -
  629.     file_directory_down
  630.     end_cmd
  631.  
  632. # Next library
  633. cmdkey ]
  634.     file_library_up
  635.     end_cmd
  636.  
  637. # Previous library
  638. cmdkey [
  639.     file_library_down
  640.     end_cmd
  641.  
  642. # String commands start with a semicolon
  643. cmdkey ;
  644.     compare_user_misc UM_COLDKEYS
  645.     if_true
  646.         shift_str 1
  647.     else
  648.                 getstrupr 40
  649.         end_if
  650.     exec_bin str_cmds
  651.     end_cmd
  652.  
  653. cmdkey Q
  654.         cmd_pop
  655.         return
  656.         end_cmd
  657.  
  658. compare_user_misc UM_COLDKEYS
  659. if_false
  660.     crlf
  661.     end_if
  662. pause_reset
  663.  
  664. # Menu
  665. cmdkey ?
  666.     compare_user_misc UM_expert
  667.     if_true
  668.         menu TRANSFER
  669.         end_if
  670.     end_cmd
  671.  
  672. # Sysop Menu
  673. compare_ars SYSOP
  674. if_true
  675.     cmdkey !
  676.         menu sysxfer
  677.         end_cmd
  678.     end_if
  679.  
  680. # Commands
  681.  
  682. cmdkey B
  683.     file_batch_section
  684.     end_cmd
  685.  
  686. cmdkey C
  687.     chat_section
  688.     end_cmd
  689.  
  690. cmdkey D
  691.     print "\r\nchDownload File(s)\r\n"
  692.     file_download_batch
  693.     if_true
  694.         end_cmd
  695.         end_if
  696.     getfilespec
  697.     if_true
  698.         file_download
  699.         end_if
  700.     end_cmd
  701.  
  702. cmdkey /D
  703.     print "\r\nchDownload File(s) from User(s)\r\n"
  704.     file_download_user
  705.     end_cmd
  706.  
  707. cmdkey E
  708.     print "\r\nchList Extended File Information\r\n"
  709.     getfilespec
  710.     if_true
  711.         file_list_extended
  712.         end_if
  713.     end_cmd
  714.  
  715. cmdkey F
  716.     print "\r\nchFind Text in File Descriptions (no wildcards)\r\n"
  717.     file_find_text
  718.     end_cmd
  719.  
  720. cmdkey /F
  721.     file_find_text_all
  722.         end_cmd
  723.  
  724. cmdkey I
  725.     call file_info
  726.     end_cmd
  727.  
  728. cmdkey J
  729.     file_select_area
  730.     end_cmd
  731.  
  732. cmdkey L
  733.     setstr *.*
  734.     file_list
  735.     end_cmd
  736.  
  737. cmdkey /L
  738.     nodelist_all
  739.     end_cmd
  740.  
  741. cmdkey N
  742.     print "\r\nchNew File Scan\r\n"
  743.     file_new_scan
  744.     end_cmd
  745.  
  746. cmdkey /N
  747.     file_new_scan_all
  748.     end_cmd
  749.  
  750. cmdkey O
  751.     file_download_batch
  752.     if_true
  753.         end_cmd
  754.                 end_if
  755.     logoff
  756.     end_cmd
  757.  
  758. cmdkey /O
  759.     file_download_batch
  760.     if_true
  761.         end_cmd
  762.                 end_if
  763.     logoff_fast
  764.         end_cmd
  765.  
  766. cmdkey R
  767.     print "\r\nchRemove/Edit File(s)\r\n"
  768.     getfilespec
  769.     if_true
  770.         file_remove
  771.         end_if
  772.     end_cmd
  773.  
  774. cmdkey S
  775.     print "\r\nchSearch for Filename(s)\r\n"
  776.     file_find_name
  777.     end_cmd
  778.  
  779. cmdkey /S
  780.     file_find_name_all
  781.     end_cmd
  782.  
  783. cmdkey T
  784.     file_temp_section
  785.     end_cmd
  786.  
  787. cmdkey U
  788.     print "\r\nchUpload File\r\n"
  789.     chkfile "..\text\menu\upload.*"
  790.     if_true
  791.         menu upload
  792.         end_if
  793.     file_upload
  794.     end_cmd
  795.  
  796. cmdkey /U
  797.     print "\r\nchUpload File to User\r\n"
  798.     file_upload_user
  799.     end_cmd
  800.  
  801. cmdkey V
  802.     print "\r\nchView File(s)\r\n"
  803.     getfilespec
  804.     if_true
  805.         file_view
  806.         end_if
  807.     end_cmd
  808.  
  809. cmdkey Z
  810.     print "\r\nchUpload File to Sysop\r\n"
  811.     file_upload_sysop
  812.     end_cmd
  813.  
  814. cmdkey *
  815.     file_show_directories
  816.     end_cmd
  817.  
  818. cmdkey /*
  819.     file_show_libraries
  820.     end_cmd
  821.  
  822. cmdkey &
  823.     :xfercfg
  824.     compare_user_misc UM_expert
  825.     if_false
  826.         menu XFERCFG
  827.         end_if
  828.     async
  829.     print "\r\nyhConfig: n"
  830.     getcmd ?QBEP\r
  831.     logkey
  832.  
  833.     cmdkey ?
  834.         compare_user_misc UM_expert
  835.         if_true
  836.             menu XFERCFG
  837.             end_if
  838.         goto xfercfg
  839.         end_cmd
  840.  
  841.     cmdkey P
  842.         file_ptrs_cfg
  843.         end_cmd
  844.  
  845.     cmdkey B
  846.         toggle_user_misc UM_BATCHFLAG
  847.         end_cmd
  848.  
  849.     cmdkey E
  850.         toggle_user_misc UM_EXTDESC
  851.                 end_cmd
  852.     end_cmd
  853.  
  854. cmdkey #
  855.     print "\r\nchType the actual number, not the symbol.\r\n"
  856.     end_cmd
  857.  
  858. cmdkey /#
  859.     print "\r\nchType the actual number, not the symbol.\r\n"
  860.         end_cmd
  861.  
  862. # fall through
  863. print "\r\nchUnrecognized command."
  864. compare_user_misc UM_expert
  865. if_true
  866.     print " Hit 'i?nch' for a menu."
  867.     end_if
  868. crlf
  869. end_cmd
  870.  
  871. # shouldn't hit next line
  872. print "Problem in command shell."
  873. pause
  874. hangup
  875.  
  876. ############################ File Info Section    ###############################
  877.  
  878. :file_info
  879. cmd_home
  880. compare_user_misc UM_expert
  881. if_false
  882.     menu XFERINFO
  883.     end_if
  884. async
  885. print "\r\nyhInfo: n"
  886. getcmd ?TYDUQ\r
  887. logkey
  888.  
  889. cmdkey ?
  890.     compare_user_misc UM_expert
  891.     if_true
  892.         menu XFERINFO
  893.         end_if
  894.     end_cmd
  895.  
  896. cmdkey T
  897.     info_xfer_policy
  898.     end_cmd
  899.  
  900. cmdkey Y
  901.     info_user
  902.     end_cmd
  903.  
  904. cmdkey D
  905.     info_directory
  906.     end_cmd
  907.  
  908. cmdkey U
  909.     userlist_dir
  910.     end_cmd
  911.  
  912. cmdkey Q
  913.     cmd_pop
  914.     return
  915.     end_cmd
  916.  
  917. cmd_pop
  918. return
  919.  
  920. #end of DEFAULT.SRC
  921.