home *** CD-ROM | disk | FTP | other *** search
/ synchro.net / synchro.net.tar / synchro.net / Synchronet_Archive / 310IBETA.ZIP / default.src < prev    next >
Encoding:
Text File  |  2002-03-24  |  13.0 KB  |  925 lines

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