Guest User

Untitled

a guest
May 31st, 2026
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.55 KB | None | 0 0
  1. // Oblivion/2 BBS Clone for Synchronet BBS
  2.  
  3. "use strict";
  4.  
  5. require("sbbsdefs.js", "SYS_RA_EMU");
  6. require("userdefs.js", "USER_COLDKEYS");
  7. require("nodedefs.js", "NODE_MAIN");
  8. require("key_defs.js", "KEY_UP");
  9. require("gettext.js", "gettext");
  10. load("termsetup.js");
  11. var shell = load({}, "shell_lib.js");
  12.  
  13. system.settings |= SYS_RA_EMU;
  14.  
  15. shell.help_key = '?';
  16. // If user has unlimited time, display time-used rather than time-remaining
  17. const time_code = user.security.exemptions & UFLAG_T ? "@TUSED@" : "@TLEFT@";
  18.  
  19. shell.main_menu = {
  20. file: "obv-2/main",
  21. cls: true,
  22. eval: 'bbs.main_cmds++',
  23. node_action: NODE_MAIN,
  24. prompt: "\x01n\x01gMain \x01cþ\x01h@"
  25. + time_code
  26. + "\x01n\x01cþ \x01h\x01kC\x01n\x01go\x01hm\x01nm\x01hand: ",
  27. command: {
  28. 'A': { eval: 'bbs.auto_msg()' },
  29. 'B': { eval: 'bbs.exec_xtrn("sbbslist")' },
  30. 'C': { eval: 'bbs.page_sysop()' },
  31. 'D': { eval: 'bbs.list_logons()' },
  32. 'F': { eval: 'send_feedback()' },
  33. 'G': { eval: 'logoff(false)' },
  34. '/G': { eval: 'logoff(true)' },
  35. 'H': { eval: 'bbs.whos_online()' },
  36. 'I': { eval: 'bbs.chat_sec()' },
  37. 'K': { eval: 'bbs.user_config(); exit()' },
  38. 'Y': { eval: 'bbs.user_info()' },
  39. 'L': { eval: 'list_users()' },
  40. 'P': { eval: 'bbs.xtrn_sec()' },
  41. 'S': { eval: 'main_info()' },
  42. 'U': { eval: 'bbs.time_bank()' },
  43. 'W': { exec: 'logonlist.js', args: ['-l'] },
  44. '$': { eval: 'console.crlf();' +
  45. 'var f = system.text_dir + "donation.txt";' +
  46. 'if(file_exists(f)) console.printfile(f);' +
  47. 'else console.print("\\r\\n\\x01n\\x01hPlease ask the SysOp about making a donation.");' },
  48. 'Z': { eval: 'bbs.reinit_msg_ptrs()' },
  49. '!': { eval: 'bbs.menu("sysmain")'
  50. ,ars: 'SYSOP or EXEMPT Q or I or N' },
  51. },
  52. nav: {
  53. '\r': {},
  54. 'E': { eval: 'menu = email_menu' },
  55. 'M': { eval: 'menu = message_menu' },
  56. 'Q': { eval: 'menu = quick_menu' },
  57. 'T': { eval: 'enter_file_section(); menu = file_menu' },
  58. }
  59. };
  60.  
  61. shell.file_menu = {
  62. file: "obv-2/files",
  63. cls: true,
  64. eval: 'bbs.file_cmds++',
  65. node_action: NODE_XFER,
  66. prompt: "\x01n\x01gFile \x01cþ \x01h"
  67. + time_code
  68. + " \x01n\x01cþ \x01h\x01c(@LN@) @LIB@ (@DN@) @DIR@: ",
  69. num_input: shell.get_dir_num,
  70. slash_num_input: shell.get_lib_num,
  71. command: {
  72. 'A': { eval: 'console.clear(); select_file_area();' },
  73. 'B': { eval: 'bbs.batch_menu()' },
  74. 'C': { exec: 'filescancfg.js' },
  75. '/D': { eval: 'download_files()', msg: '\r\n\x01c\x01hDownload File(s)\r\n', ars: 'REST NOT D' },
  76. 'E': { eval: 'view_file_info(FI_REMOVE)', msg: '\r\n\x01c\x01hRemove/Edit File(s)\r\n' },
  77. 'G': { eval: 'logoff(false)' },
  78. '/G': { eval: 'logoff(true)' },
  79. 'K': { eval: 'file_config_listing()' },
  80. 'L': { eval: 'list_files()' },
  81. 'N': { eval: 'bbs.scan_dirs(FL_ULTIME)', msg: '\r\n\x01c\x01hNew File Scan\r\n' },
  82. 'R': { eval: 'bbs.batch_menu()' },
  83. 'S': { eval: 'bbs.scan_dirs(FL_NO_HDR)', msg: '\r\n\x01c\x01hSearch for Filename(s)\r\n' },
  84. 'T': { eval: 'bbs.temp_xfer()' },
  85. 'U': { eval: 'upload_file()', msg: '\r\n\x01c\x01hUpload File\r\n' },
  86. '/U': { eval: 'upload_user_file()', msg: '\r\n\x01c\x01hUpload File to User\r\n' },
  87. 'V': { eval: 'view_files()', msg: '\r\n\x01c\x01hView File(s)\r\n' },
  88. 'W': { eval: 'view_file_info(FI_INFO)', msg: '\r\n\x01c\x01hExtended File Information\r\n' },
  89. 'X': { eval: 'show_sysop_wants()' }
  90. },
  91. nav: {
  92. '\r': {},
  93. 'M': { eval: 'menu = message_menu' },
  94. 'Q': { eval: 'menu = main_menu' },
  95. '+': { eval: 'dir_up()' },
  96. '-': { eval: 'dir_down()' },
  97. '*': { eval: 'show_dirs(bbs.curlib)' },
  98. '/*': { eval: 'show_libs()' },
  99. '/+': { eval: 'lib_up()' },
  100. '/-': { eval: 'lib_down()' },
  101. },
  102. };
  103.  
  104. // Arrow keys
  105. shell.file_menu.nav[KEY_UP] = { eval: 'dir_up()' };
  106. shell.file_menu.nav[KEY_DOWN] = { eval: 'dir_down()' };
  107. shell.file_menu.nav[KEY_RIGHT] = { eval: 'lib_up()' };
  108. shell.file_menu.nav[KEY_LEFT] = { eval: 'lib_down()' };
  109.  
  110. shell.quick_menu = {
  111. cls: true,
  112. file: "obv-2/quick",
  113. eval: 'bbs.main_cmds++',
  114. node_action: NODE_MAIN,
  115. prompt: "\x01h\x01kQuick \x01n\x01gþ\x01h"
  116. + time_code
  117. + "\x01n\x01gþ \x01h\x01kC\x01n\x01go\x01hm\x01nm\x01hand: ",
  118. command: {
  119. 'C': { eval: 'bbs.page_sysop()' },
  120. 'F': { eval: 'send_feedback()' },
  121. 'G': { eval: 'logoff(false)' },
  122. '/G': { eval: 'logoff(true)' },
  123. },
  124. nav: {
  125. '\r': {},
  126. 'M': { eval: 'menu = message_menu' },
  127. 'E': { eval: 'menu = email_menu' },
  128. 'T': { eval: 'enter_file_section(); menu = file_menu' },
  129. 'Q': { eval: 'menu = main_menu' },
  130. }
  131. };
  132.  
  133. shell.message_menu = {
  134. cls: true,
  135. file: "obv-2/message",
  136. eval: 'bbs.main_cmds++',
  137. node_action: NODE_RMSG,
  138. prompt: "\x01n\x01gMessage \x01cþ \x01h"
  139. + time_code
  140. + "\x01n\x01cþ \x01c\x01h[@GN@] @GRP@ [@SN@] @SUB@: ",
  141. num_input: shell.get_sub_num,
  142. slash_num_input: shell.get_grp_num,
  143. command: {
  144. 'A': { eval: 'console.clear(); select_msg_area()' },
  145. 'B': { eval: 'show_subs(bbs.curgrp)' },
  146. 'C': { eval: 'console.clear(); bbs.cfg_msg_scan(SCAN_CFG_NEW);' },
  147. 'G': { eval: 'logoff(false)' },
  148. '/G': { eval: 'logoff(true)' },
  149. 'J': { eval: 'show_grps()' },
  150. 'O': { eval: 'bbs.menu_dir = "obv-2"; bbs.qwk_sec(); bbs.menu_dir = "";' },
  151. 'P': { eval: 'console.clear(); bbs.post_msg()' },
  152. 'R': { eval: 'msg_read()' },
  153. 'Y': { eval: 'console.clear(); bbs.scan_subs(FL_TOYOU)' },
  154. 'Z': { eval: 'toggle_user_misc(UM_ASK_SSCAN)' },
  155. '-': { eval: 'sub_down()' },
  156. '>': { eval: 'group_up()' },
  157. '<': { eval: 'grp_down()' },
  158. '*': { eval: 'show_subs(bbs.curgrp)' },
  159. '/*': { eval: 'show_grps()' },
  160. },
  161. nav: {
  162. '\r': {},
  163. 'Q': { eval: 'menu = main_menu' },
  164. 'T': { eval: 'enter_file_section(); menu = file_menu' },
  165. }
  166. };
  167.  
  168. shell.email_menu = {
  169. cls: true,
  170. file: "obv-2/email",
  171. eval: 'bbs.main_cmds++',
  172. node_action: NODE_RMAL,
  173. prompt: "\x01h\x01kEmail \x01n\x01gþ\x01h\x01g"
  174. + time_code
  175. + "\x01n\x01gþ \x01h\x01kC\x01n\x01go\x01hm\x01nm\x01hand: \x01n",
  176. command: {
  177. 'F': { eval: 'send_email()' },
  178. 'R': { eval: 'bbs.read_mail(MAIL_YOUR, user.number)' },
  179. 'S': { eval: 'send_email()' },
  180. 'V': { eval: 'bbs.read_mail(MAIL_SENT, user.number)' },
  181. },
  182. nav: {
  183. '\r': {},
  184. 'Q': { eval: 'menu = main_menu' },
  185. }
  186. };
  187.  
  188. shell.menu = shell.main_menu;
  189. shell.menu_loop();
Advertisement
Add Comment
Please, Sign In to add comment