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

  1. # SDOS.SRC
  2.  
  3. # DOS shell for Synchronet version 2 systems
  4.  
  5. # Thanks to Yojimbo for the BDOS shell that inspired this one
  6.  
  7. !include sbbsdefs.inc
  8.  
  9. # Give a bogus DOS error so they think they're in real DOS
  10. print "nSpecified COMMAND search directory bad\r\n\r\n"
  11. print "Microsoft(R) MS-DOS(R) Version 5.00\r\n"
  12. print "             (C)Copyright Microsoft Corp 1981-1991.\r\n"
  13.  
  14. :root
  15. cmd_home
  16.  
  17. # Update node status
  18. node_action node_main
  19. async
  20.  
  21. inc_main_cmds
  22.  
  23. call display_prompt
  24. print ">n"
  25. getstr 128
  26. logstr
  27.  
  28. compare_word "cd"
  29. if_true
  30.     shift_str 2
  31.     compare_word " "
  32.     if_true
  33.         shift_str 1
  34.         end_if
  35.     compare_word "\\"
  36.     if_true
  37.         shift_str 1
  38.         end_if
  39.     compare_word "mail"
  40.     if_true
  41.         cmd_pop
  42.         goto mail
  43.         end_if
  44.     compare_word "files"
  45.     if_true
  46.         cmd_pop
  47.         goto files
  48.         end_if
  49.     print "Invalid directory\r\n"
  50.     end_cmd
  51.     end_if
  52.  
  53. cmdstr "dir"
  54.     menu sdos\root
  55.     end_cmd
  56.  
  57. call global
  58. end_cmd
  59.  
  60. :display_prompt
  61.  
  62. pause_reset
  63. print "n\r\nC:\\"
  64. return
  65.  
  66.  
  67. ##############################################################################
  68. # This is where we go when it's not a valid command
  69. # Let's really try to act like DOS now (i.e. fake 'em out)
  70. ##############################################################################
  71.  
  72. :global
  73.  
  74. # Just <CR>, so ignore
  75. compare_str ""
  76. if_true
  77.     return
  78.     end_if
  79.  
  80. # String commands start with a semicolon
  81. compare_word ";"
  82. if_true
  83.     shift_str 1
  84.     exec_bin str_cmds
  85.     return
  86.     end_if
  87.  
  88. compare_str "sysop"
  89. if_true
  90.     menu sysmain
  91.     return
  92.     end_if
  93.  
  94. compare_str "type"
  95. if_True
  96.     print "Required paramater missing\r\n"
  97.     return
  98.     end_if
  99.  
  100. compare_word "type "
  101. if_true
  102.     shift_str 5
  103.     call type
  104.     return
  105.     end_if
  106.  
  107. # Global BBS commands
  108. compare_str "chat"
  109. if_true
  110.     chat_section
  111.     return
  112.     end_if
  113.  
  114. compare_str "open"
  115. if_true
  116.     print "External program name missing\r\n"
  117.     return
  118.         end_if
  119.  
  120. compare_word "open "
  121. if_true
  122.     shift_str 5
  123.     xtrn_exec
  124.     return
  125.     end_if
  126.  
  127. compare_str "doors"
  128. if_true
  129.     xtrn_section
  130.     return
  131.     end_if
  132.  
  133. compare_str "gfiles"
  134. if_true
  135.     text_file_section
  136.     return
  137.     end_if
  138.  
  139. compare_str "automsg"
  140. if_true
  141.     auto_message
  142.     return
  143.     end_if
  144.  
  145. compare_str "setup"
  146. if_true
  147.     user_defaults
  148.     return
  149.     end_if
  150.  
  151. compare_str "logoff"
  152. if_true
  153.     file_download_batch
  154.     if_true
  155.         return
  156.                 end_if
  157.     logoff
  158.     return
  159.     end_if
  160.  
  161. compare_str "ver"
  162. if_True
  163.     info_version
  164.     return
  165.     end_if
  166.  
  167. compare_str "exit"
  168. if_true
  169.     logoff_fast
  170.     return
  171.     end_if
  172.  
  173. # DOS Stuff
  174. compare_word "dir"
  175. if_true
  176.     shift_str 3
  177.     compare_word " "
  178.     if_true
  179.         shift_str 1
  180.         end_if
  181.     compare_str ".."
  182.     if_true
  183.         menu sdos\root
  184.         return
  185.         end_if
  186.     compare_word ".."
  187.     if_true
  188.         shift_str 2
  189.         end_if
  190.     compare_str ""
  191.     if_true
  192.         menu sdos\root
  193.         return
  194.         end_if
  195.     compare_word "\\"
  196.     if_true
  197.         shift_str 1
  198.         end_if
  199.     compare_str ""
  200.     if_true
  201.         menu sdos\root
  202.         return
  203.         end_if
  204.     compare_word "files"
  205.     if_true
  206.         menu sdos\files
  207.         return
  208.         end_if
  209.     compare_word "mail"
  210.     if_true
  211.         menu sdos\mail
  212.         return
  213.         end_if
  214.     shift_str 1
  215.     compare_word ":"
  216.     if_true
  217.         print "Invalid drive specification\r\n"
  218.         return
  219.         end_if
  220.     print "\r\n Volume in drive C is BBS\r\n"
  221.     print " Volume Serial Number is 9156-8BEA\r\n"
  222.     print "Invalid directory\r\n"
  223.     return
  224.     end_if
  225.  
  226. # Fake environment
  227. compare_str "set"
  228. if_true
  229.     print "COMSPEC=C:\\COMMAND.COM\r\n"
  230.     print "PROMPT=$p$g\r\n"
  231.     print "PATH=C:\\\r\n"
  232.     print "SBBSCTRL=C:\\SBBS\\CTRL\r\n"
  233.     print "SBBSNODE=C:\\BBS\\NODE@NODE@\\\r\n"
  234.     print "SBBSNNUM=@NODE@\r\n"
  235.     return
  236.     end_if
  237.  
  238. # Pretend we set it
  239. compare_word "set "
  240. if_true
  241.     return
  242.     end_if
  243.  
  244. # Echo
  245. compare_str "echo"
  246. if_true
  247.     print "ECHO is on\r\n"
  248.     return
  249.     end_if
  250.  
  251. compare_word "echo "
  252. if_true
  253.     shift_str 5
  254.     printstr
  255.     crlf
  256.     return
  257.     end_if
  258.  
  259. # Del, Erase, Copy
  260. compare_str "del"
  261. if_true
  262.     print "Required parameter missing\r\n"
  263.     return
  264.         end_if
  265.  
  266. compare_word "del "
  267. if_true
  268.     print "Sharing violation\r\n"
  269.     return
  270.     end_if
  271.  
  272. compare_str "erase"
  273. if_true
  274.     print "Required parameter missing\r\n"
  275.     return
  276.         end_if
  277.  
  278. compare_word "erase "
  279. if_true
  280.     print "Sharing violation\r\n"
  281.     return
  282.     end_if
  283.  
  284. compare_str "copy"
  285. if_true
  286.     print "Required parameter missing\r\n"
  287.     return
  288.         end_if
  289.  
  290. compare_word "copy "
  291. if_true
  292.     print "Sharing violation\r\n"
  293.     return
  294.         end_if
  295.  
  296. # Changing drive letter?
  297.  
  298. shift_str 1
  299. compare_word ":"
  300. if_true
  301.         print "Invalid drive specification\r\n"
  302.         return
  303.         end_if
  304. print "Bad command or file name\r\n"
  305. return
  306.  
  307. :files
  308.  
  309. cmd_home
  310. call display_prompt
  311.  
  312. print "FILES>n"
  313. getstr 128
  314. logstr
  315.  
  316. compare_word "cd"
  317. if_true
  318.     shift_str 2
  319.     compare_word " "
  320.     if_true
  321.         shift_str 1
  322.         end_if
  323.     compare_str ".."
  324.     if_true
  325.         cmd_pop
  326.         goto root
  327.         end_if
  328.     compare_word ".."
  329.     if_true
  330.         shift_str 2
  331.                 end_if
  332.     compare_str "\\"
  333.     if_true
  334.         cmd_pop
  335.         goto root
  336.         end_if
  337.     compare_str "\\mail"
  338.     if_true
  339.         cmd_pop
  340.         goto mail
  341.                 end_if
  342.     print "Invalid directory\r\n"
  343.     end_cmd
  344.         end_if
  345.  
  346. cmdstr "dir"
  347.     menu sdos\files
  348.     end_cmd
  349.  
  350. cmdstr "batch"
  351.     file_batch_section
  352.     end_cmd
  353.  
  354. cmdstr "download"
  355.     file_download_batch
  356.     if_true
  357.         end_cmd
  358.         end_if
  359.     getfilespec
  360.     if_true
  361.         file_download
  362.         end_if
  363.         end_cmd
  364.  
  365. compare_word "download "
  366. if_true
  367.     shift_str 9
  368.     file_download
  369.     end_cmd
  370.     end_if
  371.  
  372. cmdstr "extended"
  373.     getfilespec
  374.     if_true
  375.         file_list_extended
  376.         end_if
  377.         end_cmd
  378.  
  379. compare_word "extended "
  380. if_true
  381.     shift_str 9
  382.     file_list_extended
  383.     end_cmd
  384.     end_If
  385.  
  386. cmdstr "find"
  387.     file_find_text
  388.     end_cmd
  389.  
  390. cmdstr "area"
  391.     file_select_area
  392.     end_cmd
  393.  
  394. cmdstr "list"
  395.     getfilespec
  396.     if_true
  397.         file_list
  398.         end_if
  399.         end_cmd
  400.  
  401. compare_word "list "
  402. if_true
  403.     shift_str 5
  404.     file_list
  405.     end_cmd
  406.     end_if
  407.  
  408. cmdstr "newscan"
  409.     file_new_scan
  410.     end_cmd
  411.  
  412. cmdstr "remove"
  413.     getfilespec
  414.     if_true
  415.         file_remove
  416.         end_if
  417.         end_cmd
  418.  
  419. compare_word "remove "
  420. if_True
  421.     shift_str 7
  422.     file_remove
  423.     end_cmd
  424.     end_if
  425.  
  426. cmdstr "search"
  427.     file_find_name
  428.     end_cmd
  429.  
  430. cmdstr "temp"
  431.     file_temp_section
  432.     end_cmd
  433.  
  434. cmdstr "upload"
  435.     chkfile "..\text\menu\upload.*"
  436.     if_true
  437.         menu upload
  438.         end_if
  439.     file_upload
  440.         end_cmd
  441.  
  442. cmdstr "view"
  443.     getfilespec
  444.     if_true
  445.         file_view
  446.         end_if
  447.         end_cmd
  448.  
  449. compare_word "view "
  450. if_True
  451.     shift_str 5
  452.     file_view
  453.     end_cmd
  454.     end_if
  455.  
  456. cmdstr "config"
  457.     file_ptrs_cfg
  458.     end_cmd
  459.  
  460. call global
  461. end_cmd
  462.  
  463. :type
  464.  
  465. compare_word nodes
  466. if_true
  467.     nodelist_all
  468.     return
  469.     end_if
  470.  
  471. compare_word logon
  472. if_true
  473.     userlist_logons
  474.     return
  475.     end_if
  476.  
  477. compare_word users
  478. if_true
  479.     userlist_all
  480.     return
  481.     end_if
  482.  
  483. compare_word system
  484. if_true
  485.     info_system
  486.     return
  487.     end_if
  488.  
  489. compare_word your
  490. if_true
  491.     info_user
  492.     return
  493.     end_if
  494.  
  495. print "File not found - "
  496. printstr
  497. crlf
  498. return
  499.  
  500.  
  501. :mail
  502.  
  503. cmd_home
  504.  
  505. # Update node status
  506. node_action node_main
  507. async
  508.  
  509. inc_main_cmds
  510.  
  511. call display_prompt
  512.  
  513. print "MAIL>n"
  514. getstr 128
  515. logstr
  516.  
  517. compare_word "cd"
  518. if_true
  519.     shift_str 2
  520.     compare_word " "
  521.     if_true
  522.         shift_str 1
  523.         end_if
  524.     compare_str ".."
  525.     if_true
  526.         cmd_pop
  527.         goto root
  528.                 end_if
  529.     compare_word ".."
  530.     if_true
  531.         shift_str 2
  532.         end_if
  533.     compare_str "\\"
  534.     if_true
  535.         cmd_pop
  536.         goto root
  537.         end_if
  538.     compare_str "\\files"
  539.     if_true
  540.         cmd_pop
  541.         goto files
  542.         end_if
  543.     print "Invalid directory\r\n"
  544.     end_cmd
  545.         end_if
  546.  
  547. cmdstr "dir"
  548.     menu sdos\mail
  549.     end_cmd
  550.  
  551. cmdstr "config"
  552.     call main_cfg
  553.     end_cmd
  554.  
  555. cmdstr "send"
  556.     print "_\r\nbhE-mail (User name or number): w"
  557.     getname 25
  558.     compare_str ""
  559.     if_true
  560.         end_cmd
  561.         end_if
  562.     compare_str "SYSOP"
  563.     if_true
  564.         setstr "1"
  565.         end_if
  566.     mail_send
  567.         end_cmd
  568.  
  569. cmdstr "sendfile"
  570.     print "_\r\nbhE-mail (User name or number): w"
  571.     getname 25
  572.     compare_str ""
  573.     if_true
  574.         end_cmd
  575.         end_if
  576.     compare_str "SYSOP"
  577.     if_true
  578.         setstr "1"
  579.         end_if
  580.     mail_send_file
  581.         end_cmd
  582.  
  583. cmdstr "read"
  584.     mail_read
  585.     end_cmd
  586.  
  587. cmdstr "feedback"
  588.     setstr "1"
  589.     mail_send_feedback
  590.     end_cmd
  591.  
  592. cmdstr "netmail"
  593.     no_yes "\r\nAttach a file"
  594.     if_true
  595.         mail_send_netmail
  596.     else
  597.         mail_send_netfile
  598.         end_if
  599.     end_cmd
  600.  
  601. cmdstr "readsent"
  602.     mail_read_sent
  603.         end_cmd
  604.  
  605. cmdstr "area"
  606.     msg_select_area
  607.     end_cmd
  608.  
  609. cmdstr "post"
  610.     msg_post
  611.     end_cmd
  612.  
  613. cmdstr "newscan"
  614.     msg_new_scan
  615.     end_cmd
  616.  
  617. cmdstr "find"
  618.     msg_find_text
  619.     end_cmd
  620.  
  621. cmdstr "yourmsgs"
  622.     msg_your_scan
  623.     end_cmd
  624.  
  625. cmdstr "qwk"
  626.     msg_qwk
  627.     end_cmd
  628.  
  629. cmdstr "readmsgs"
  630.     msg_read
  631.     end_Cmd
  632.  
  633.  
  634. call global
  635. end_cmd
  636.  
  637. ########################### Main Config Section  ##############################
  638.  
  639. :main_cfg
  640.  
  641. compare_user_misc UM_expert
  642. if_false
  643.     menu MAINCFG
  644.     end_if
  645. async
  646. print "\r\nyhConfig: n"
  647. getcmd ?QNPIS\r
  648. logkey
  649.  
  650. cmdkey ?
  651.     compare_user_misc UM_expert
  652.     if_true
  653.         menu MAINCFG
  654.         end_if
  655.     goto main_cfg
  656.     end_cmd
  657.  
  658. cmdkey N
  659.     msg_new_scan_cfg
  660.     return
  661.     end_cmd
  662.  
  663. cmdkey S
  664.     msg_your_scan_cfg
  665.     return
  666.     end_cmd
  667.  
  668. cmdkey P
  669.     msg_ptrs_cfg
  670.     return
  671.     end_cmd
  672.  
  673. cmdkey I
  674.     msg_ptrs_reinit
  675.     return
  676.     end_cmd
  677.  
  678. return
  679.  
  680. # End of SDOS.SRC
  681.