pymud 0.21.1__py3-none-any.whl → 0.21.2a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pymud/lang/i18n_eng.py CHANGED
@@ -1,851 +1,851 @@
1
- TRANSLATION = {
2
- "text" : {
3
- "welcome" : "Welcome to PYMUD Client - PKUXKX, the best Chinese MUD game", # the welcome text shown in the statusbar when pymud start
4
-
5
- # text in pymud.py
6
- "world" : "World", # the display text of menu "world"
7
- "new_session" : "Create New Session", # the display text of sub-menu "new_session"
8
- "show_log" : "Show Log Information", # the display text of sub-menu "show_log"
9
- "exit" : "Exit", # the display text of sub-menu "exit"
10
- "session" : "Session", # the display text of menu "session"
11
- "connect" : "Connect/Reconnect", # the display text of sub-menu "connect"
12
- "disconnect" : "Disconnect", # the display text of sub-menu "disconnect"
13
- "beautify" : "Toggle Beautify Display", # the display text of sub-menu "toggle beautify"
14
- "echoinput" : "Toggle Echo Input Commands", # the display text of sub-menu "toggle echo input"
15
- "nosplit" : "Disable Split Screen", # the display text of sub-menu "no split"
16
- "copy" : "Copy (Plain Text)", # the display text of sub-menu "copy (pure text)"
17
- "copyraw" : "Copy (ANSI)", # the display text of sub-menu "copy (raw infomation)"
18
- "clearsession" : "Clear Session Content", # the display text of sub-menu "clear session buffer"
19
- "closesession" : "Close Current Page", # the display text of sub-menu "close current session"
20
- "autoreconnect" : "Toggle Auto Reconnect", # the display text of sub-menu "toggle auto reconnect"
21
- "loadconfig" : "Load Script Configuration", # the display text of sub-menu "load config"
22
- "reloadconfig" : "Reload Script Configuration", # the display text of sub-menu "reload config"
23
- "layout" : "Layout", # the display text of menu "layout" (not used now)
24
- "hide" : "Hide Status Window", # the display text of sub-menu "hide status window" (not used now)
25
- "horizon" : "Bottom Status Window", # the display text of sub-menu "horizon layout" (not used now)
26
- "vertical" : "Right Status Window", # the display text of sub-menu "vertical layout" (not used now)
27
- "help" : "Help", # the display text of menu "help"
28
- "about" : "About", # the display text of menu "about"
29
-
30
- "session_changed" : "Successfully switched to session: {0}",
31
- "input_prompt" : '<prompt><b>Command:</b></prompt>',
32
- "msg_copy" : "Copied: {0}",
33
- "msg_copylines" : "Copied: {0} lines",
34
- "msg_no_selection" : "No content selected...",
35
- "msg_session_exists" : "Error! A session named {0} already exists, please try another name.",
36
-
37
- "logfile_name" : "Log File Name",
38
- "logfile_size" : "File Size",
39
- "logfile_modified" : "Last Modified Time",
40
-
41
- "warning" : "Warning",
42
- "warning_exit" : "Application Exit Warning",
43
- "session_close_prompt" : "Session {0} is still connected, confirm to close?",
44
- "app_exit_prompt" : "There are still {0} sessions {1} connected, confirm to close?",
45
-
46
- "msg_beautify" : "Beautify display is now",
47
- "msg_echoinput" : "Echo input commands is set to:",
48
- "msg_autoreconnect" : "Auto reconnect is set to:",
49
- "msg_open" : "On",
50
- "msg_close" : "Off",
51
-
52
- "msg_cmd_session_error" : 'When creating a session with a single parameter, use the format group.name, e.g. #session pkuxkx.newstart',
53
- "msg_cmdline_input" : "Command line input:",
54
- "msg_no_session" : "No active session currently running.",
55
- "msg_invalid_plugins" : "File: {0} is not a valid plugin file, loading error, message: {1}",
56
-
57
- "status_nobeautify" : "Beautify disabled",
58
- "status_mouseinh" : "Mouse disabled",
59
- "status_ignore" : "Global disable",
60
- "status_notconnect" : "Not connected",
61
- "status_connected" : "Connected",
62
-
63
- # text in dialogs.py
64
- "basic_dialog" : "Basic Dialog",
65
- "ok" : "OK",
66
- "cancel" : "Cancel",
67
- "visit" : "Visit",
68
- "displayhelp" : "to view the latest help documentation",
69
- "appinfo" : '<b fg="red">PYMUD {0}</b> - a MUD Client Written in Python',
70
- "author" : 'Author: <b>{0}</b> <b>E-mail</b>: <u>{1}</u>',
71
- "sysversion" : 'System:{} {} Python Version:{}',
72
- "sessionname" : "Session Name",
73
- "host" : "Server Address",
74
- "port" : "Port",
75
- "encoding" : "Encoding",
76
- "nolog" : "No Log",
77
- "chooselog" : "Select Log to View",
78
-
79
- # text in modules.py
80
- "configuration_created" : "Configuration object {0}.{1} created successfully.",
81
- "configuration_recreated" : "Configuration object {0}.{1} recreated successfully.",
82
- "configuration_fail" : "Configuration object {0}.{1} creation failed. Error message: {}",
83
- "entity_module" : "Main Configuration Module",
84
- "non_entity_module" : "Sub Configuration Module",
85
- "load_ok" : "Load completed",
86
- "load_fail" : "Load failed",
87
- "unload_ok" : "Unload completed",
88
- "reload_ok" : "Reload completed",
89
- "msg_plugin_unloaded" : "Plugin {0} has been disabled for this session.",
90
- "msg_plugin_loaded" : "Plugin {0} has been enabled for this session.",
91
-
92
- # text in objects.py
93
- "excpetion_brace_not_matched" : "Invalid code block, number of braces does not match",
94
- "exception_quote_not_matched" : "Number of quotes does not match",
95
- "exception_forced_async" : "This command contains both forced synchronous and asynchronous commands, will use asynchronous execution, synchronous commands will be invalid.",
96
- "exception_session_type_fail" : "session must be an instance of Session type object!",
97
- "exception_message" : "Exception information: <{}> {}",
98
- "exception_traceback" : "Exception occurred at line number {1} in file '{0}', and function name is '{2}'",
99
- "script_error" : "Script Error",
100
-
101
- # text display in session.py
102
- "msg_var_autoload_success" : "Variables automatically loaded from {0} successfully.",
103
- "msg_var_autoload_fail" : "Failed to automatically load variables from {0}, error message: {1}.",
104
- "msg_auto_script" : "Will automatically load the following modules: {0}",
105
- "msg_connection_fail" : "Error occurred during connection creation, time: {0}, error message: {1}.",
106
- "msg_auto_reconnect" : "Will automatically reconnect in {0} seconds...",
107
- "msg_connected" : "{0}: Successfully connected to server.",
108
- "msg_disconnected" : "{0}: Disconnected from server.",
109
- "msg_duplicate_logname" : "A logger named {0} already exists in other sessions, will return this logger directly.",
110
- "msg_default_statuswindow" : "This is a default status window message\nSession: {0} Connection Status: {1}",
111
- "msg_mxp_not_support" : "MXP support is not yet developed, please do not enable MXP support settings for now!",
112
- "msg_no_session" : "No session named {0} exists.",
113
- "msg_num_positive" : "#{num} {cmd} only supports positive integers!",
114
- "msg_cmd_not_recognized" : "Unrecognized command: {0}",
115
- "msg_id_not_consistent" : "Object {0} dictionary key {1} does not match its id {2}, will discard key and add to session using its id...",
116
- "msg_shall_be_string" : "{0} must be string type",
117
- "msg_shall_be_list_or_tuple" : "{0} names should be tuple or list, other types not accepted",
118
- "msg_names_and_values" : "names and values should not be empty and have equal length",
119
- "msg_not_null" : "{0} cannot be null",
120
- "msg_topic_not_found" : "Topic {0} not found, please confirm input is correct.",
121
- "Day" : "Day",
122
- "Hour" : "Hour",
123
- "Minute" : "Minute",
124
- "Second" : "Second",
125
- "msg_connection_duration" : "Connected to server for: {0}",
126
- "msg_no_object" : "No {1} named {0} exists in current session.",
127
- "msg_no_global_object" : "No {1} named {0} exists in global space.",
128
- "msg_object_value_setted" : "Successfully set {0} {1} value to {2}.",
129
- "variable" : "variable",
130
- "globalvar" : "global variable",
131
- "msg_object_not_exists" : "No {1} with key {0} exists in current session, please confirm and try again.",
132
- "msg_object_enabled" : "Object {0} enabled status is now on.",
133
- "msg_object_disabled" : "Object {0} enabled status is now off.",
134
- "msg_object_deleted" : "Object {0} has been deleted from session.",
135
- "msg_group_objects_enabled" : "{1} object(s) of Type {2} in group {1} has(have) been enabled.",
136
- "msg_group_objects_disabled" : "{1} object(s) of Type {2} in group {1} has(have) been disabled.",
137
- "msg_group_objects_deleted" : "{1} object(s) of Type {2} in group {1} has(have) been deleted.",
138
- "msg_object_param_invalid" : "#{0} command's second parameter only accepts on/off/del",
139
- "msg_ignore_on" : "All trigger enables are globally disabled.",
140
- "msg_ignore_off" : "No longer globally disable all trigger enables.",
141
- "msg_T_plus_incorrect" : "#T+ enable group usage incorrect, correct usage example: #t+ mygroup \nPlease use #help ignore for query.",
142
- "msg_T_minus_incorrect" : "#T- disable group usage incorrect, correct usage example: #t- mygroup \nPlease use #help ignore for query.",
143
- "msg_group_enabled" : "Group {0}: {1} aliases, {2} triggers, {3} commands, {4} timers, {5} GMCP triggers are all enabled.",
144
- "msg_group_disabled" : "Group {0}: {1} aliases, {2} triggers, {3} commands, {4} timers, {5} GMCP triggers are all disabled.",
145
- "msg_repeat_invalid" : "Current session is not connected or no command has been entered, repeat invalid",
146
- "msg_window_title" : "Message from session {0}",
147
- "msg_module_load_fail" : "Module {0} load failed, exception: {1}, type: {2}.",
148
- "msg_exception_traceback" : "Exception traceback: {0}",
149
- "msg_module_not_loaded" : "Specified module name {0} is not loaded.",
150
- "msg_all_module_reloaded" : "All configuration modules reloaded successfully.",
151
- "msg_plugins_reloaded" : "Plugin {0} reloaded successfully.",
152
- "msg_name_not_found" : "Specified name {0} neither found as module nor plugin, reload failed...",
153
- "msg_no_module" : "No modules loaded in current session.",
154
- "msg_module_list" : "Current session has loaded {0} modules, including (in loading order): {1}.",
155
- "msg_module_configurations" : "Module {0} contains configurations: {1}.",
156
- "msg_submodule_no_config" : "Module {0} is a submodule, contains no configurations.",
157
- "msg_module_not_loaded" : "No module named {0} exists in this session, may not be loaded to this session yet.",
158
- "msg_variables_saved" : "Session variable information saved to {0}.",
159
- "msg_alias_created" : "Alias {0} created successfully: {1}",
160
- "msg_trigger_created" : "Trigger {0} created successfully: {1}",
161
- "msg_timer_created" : "Timer {0} created successfully: {1}",
162
-
163
- "msg_tri_triggered" : " {0} triggered normally.",
164
- "msg_tri_wildcards" : " Captured: {0}",
165
- "msg_tri_prevent" : " {0}This trigger does not have keepEval enabled, will prevent subsequent triggers.{1}",
166
- "msg_tri_ignore" : " {1}{0} can trigger, but due to priority and keepEval settings, trigger will not activate.{2}",
167
- "msg_tri_matched" : " {0} can match trigger.",
168
- "msg_enabled_summary_0" : "{0} Among enabled triggers, none can trigger.",
169
- "msg_enabled_summary_1" : "{0} Among enabled triggers, {1} can trigger, actually triggered {2}, another {3} will not activate due to keepEval.",
170
- "msg_enabled_summary_2" : "{0} Among enabled triggers, all {1} can trigger normally.",
171
- "msg_disabled_summary_0" : "{0} Among disabled triggers, {1} can match.",
172
- "msg_disabled_summary_1" : "{0} Disabled triggers, none can match.",
173
- "msg_test_summary_0" : " Test content: {0}",
174
- "msg_test_summary_1" : " Test result: No matching triggers.",
175
- "msg_test_summary_2" : " Test result: {0} triggers can trigger normally, total {1} satisfy matching requirements.",
176
- "msg_test_title" : "Trigger Test - {0}",
177
- "msg_triggered_mode" : "'Response Mode'",
178
- "msg_matched_mode" : "'Test Mode'",
179
-
180
- "msg_no_plugins" : "PYMUD currently has no plugins loaded.",
181
- "msg_plugins_list" : "PYMUD currently has {0} plugins loaded, respectively:",
182
- "msg_plugins_info" : "Author {2} Version {1} Release Date {3}\n Description: {0}",
183
-
184
- "msg_py_exception" : "Python execution error: {0}",
185
-
186
- "title_msg" : "Message",
187
- "title_warning" : "Warning",
188
- "title_error" : "Error",
189
- "title_info" : "Info",
190
-
191
- "msg_log_title" : "Logger status in this session:",
192
- "msg_log_title2" : "Logger status in other sessions of this application:",
193
- "logger" : "Logger",
194
- "enabled" : "Enabled",
195
- "disabled" : "Disabled",
196
- "logger_status" : "Current Status",
197
- "file_mode" : "File Mode",
198
- "logger_mode" : "Log Mode",
199
- "ANSI" : "ANSI",
200
- "plain_text" : "Plain Text",
201
-
202
- "filemode_new" : "New",
203
- "filemode_append" : "Append",
204
- "filemode_overwrite" : "Overwrite",
205
-
206
- "msg_logger_enabled" : "{0}: Logger {1} enabled with {2} file mode and {3} log mode.",
207
- "msg_logger_disabled" : "{0}: Logger {1} logging disabled.",
208
- "msg_logfile_not_exists" : "Specified log file {0} does not exist.",
209
-
210
- "exception_logmode_error" : "Invalid log mode: {0}",
211
- "exception_plugin_file_not_found" : "Specified plugin file {0} does not exist or format is incorrect.",
212
- },
213
-
214
- "docstring" : {
215
- "PyMudApp": {
216
- "handle_session" :
217
- '''
218
- The execution function of the embedded command #session, used to create a remote connection session.
219
- This function should not be called directly in the code.
220
-
221
- Usage:
222
- - #session {name} {host} {port} {encoding}
223
- - When Encoding is not specified, the default encoding is utf-8.
224
- - You can directly use #{name} to switch sessions and operate session commands.
225
-
226
- - #session {group}.{name}
227
- - This is equivalent to directly clicking the {name} menu under the {group} menu to create a session. If the session already exists, switch to that session.
228
-
229
- Parameters:
230
- :name: Session name
231
- :host: Server domain name or IP address
232
- :port: Port number
233
- :encoding: Encoding format. If not specified, the default is utf8.
234
-
235
- :group: Group name, which is a keyword under the sessions field in the configuration file.
236
- :name: Shortcut name for the session, which is a keyword under the chars field of the above group keyword.
237
-
238
- Examples:
239
- ``#session {name} {host} {port} {encoding}``
240
- Create a remote connection session, connect to the specified port of the remote host using the specified encoding format, and save it as {name}. The encoding can be omitted, in which case the value of Settings.server["default_encoding"] will be used, with a default of utf8.
241
- ``#session newstart mud.pkuxkx.net 8080 GBK``
242
- Connect to port 8080 of mud.pkuxkx.net using GBK encoding, and name the session newstart.
243
- ``#session newstart mud.pkuxkx.net 8081``
244
- Connect to port 8081 of mud.pkuxkx.net using UTF8 encoding, and name the session newstart.
245
- ``#newstart``
246
- Switch the session named newstart to the current session.
247
- ``#newstart give miui gold``
248
- Make the session named newstart execute the "give miui gold" command without switching to that session.
249
-
250
- ``#session pkuxkx.newstart``
251
- Create a session through the specified shortcut configuration, which is equivalent to clicking the World -> pkuxkx -> newstart menu to create a session. If the session exists, switch to that session.
252
-
253
- Related commands:
254
- - #close
255
- - #exit
256
-
257
- ''',
258
-
259
-
260
- },
261
- "Session": {
262
- "handle_exit" :
263
- '''
264
- The execution function of the embedded command #exit, used to exit the `PyMudApp` application.
265
- This function should not be called directly in the code.
266
-
267
- *Note: When there are sessions still connected in the application, exiting the application with #exit will pop up dialog boxes one by one to confirm whether to close these sessions.*
268
-
269
- Related commands:
270
- - #close
271
- - #session
272
- ''',
273
-
274
- "handle_close" :
275
- '''
276
- The execution function of the embedded command #close, used to close the current session and remove it from the session list of `PyMudApp`.
277
- This function should not be called directly in the code.
278
-
279
- *Note: When the current session is connected, closing the session with #close will pop up a dialog box to confirm whether to close.*
280
-
281
- Related commands:
282
- - #exit
283
- - #session
284
- ''',
285
-
286
- "handle_variable" :
287
- '''
288
- The execution function of the embedded command #variable / #var, used to operate session variables.
289
- This command can be used with no parameters, one parameter, or two parameters.
290
- This function should not be called directly in the code.
291
-
292
- Usage:
293
- - #var: List all variables in this session.
294
- - #var {name}: List the value of the variable named {name} in this session.
295
- - #var {name} {value}: Set the value of the variable named {name} in this session to {value}, create it if it does not exist.
296
-
297
- Parameters:
298
- :name: Variable name.
299
- :value: Variable value. Note: After assignment, this value will be of type str!
300
-
301
- Related commands:
302
- - #global
303
- ''',
304
-
305
- "handle_global" :
306
- '''
307
- The execution function of the embedded command #global, used to operate global variables.
308
- This command can be used with no parameters, one parameter, or two parameters.
309
- This function should not be called directly in the code.
310
-
311
- Usage:
312
- - #global: List all global variables.
313
- - #global {name}: List the value of the global variable named {name}.
314
- - #global {name} {value}: Set the value of the global variable named {name} to {value}, create it if it does not exist.
315
-
316
- Parameters:
317
- :name: Variable name.
318
- :value: Variable value. Note: After assignment, this value will be of type str!
319
-
320
- Related commands:
321
- - #variable
322
- ''',
323
-
324
- "handle_task" :
325
- '''
326
- The execution function of the embedded command #task, used to display all managed task lists (for debugging only).
327
- This function should not be called directly in the code.
328
-
329
- Note:
330
- When there are many managed tasks, this command will affect system response.
331
- ''',
332
-
333
- "handle_ignore" :
334
- '''
335
- The execution function of the embedded commands #ignore / #ig, #t+ / #t-, used to handle enable/disable status.
336
- This function should not be called directly in the code.
337
-
338
- Usage:
339
- - #ig: Toggle the global enable/disable status of triggers.
340
- - #t+ [>=]{group}: Enable all objects in the {group} group, including aliases, triggers, commands, timers, GMCP triggers, etc.
341
- - #t- [>=]{group}: Disable all objects in the {group} group, including aliases, triggers, commands, timers, GMCP triggers, etc.
342
-
343
- Parameters:
344
- :group: Group name. There could be a '=' or '>' sign before groupname, to indicate only this group or this group and it's subgroups. If there is no sign, it is equavalant to use '='.
345
-
346
- Examples:
347
- - ``#ig``: Toggle the global enable/disable status of triggers. When disabled, "Global disabled" will be displayed in the lower right corner of the status bar.
348
- - ``#t+ mygroup``: Enable all objects in the group named mygroup, including aliases, triggers, commands, timers, GMCP triggers, etc.
349
- - ``#t- mygroup``: Disable all objects in the group named mygroup, including aliases, triggers, commands, timers, GMCP triggers, etc.
350
- - ``#t+ >mygroup``: Enable all objects in the group named mygroup and its subgroups (eg. mygroup.subgroup, etc.), including aliases, triggers, commands, timers, GMCP triggers, etc.
351
-
352
- Related commands:
353
- - #trigger
354
- - #alias
355
- - #timer
356
- ''',
357
-
358
- "handle_help" :
359
- '''
360
- The execution function of the embedded command #help, used to display help information for the specified topic.
361
- This function should not be called directly in the code.
362
-
363
- Usage:
364
- - #help: Display a list of all available commands.
365
- - #help <topic>: Display help information for the specified topic.
366
-
367
- Examples:
368
- - #help alias: Display help information for the alias command.
369
- - #help trigger: Display help information for the trigger command.
370
- ''',
371
-
372
- "handle_test" :
373
- '''
374
- The execution function of the embedded command #test/#show/#echo, trigger testing command. Similar to zmud's #show command.
375
- This function should not be called directly in the code.
376
-
377
- Usage:
378
- - #show {some_text}: Test trigger response when receives {some_text}. Triggers won't actually execute.
379
- - #test {some_text}: Difference from #show is that matched triggers will execute regardless of enabled status.
380
- - #echo {some_text}: Simulate receiving {some_text} from server, triggers will execute normally but won't display test results.
381
-
382
- Examples:
383
- - ``#show You take a deep breath and stand up.``: Simulate trigger testing when server receives "You take a deep breath and stand up." (display test results only)
384
- - ``#test %copy``: Copy a sentence and simulate trigger testing when server receives the copied content again
385
- - ``#test You take a deep breath and stand up.``: Actual trigger execution will occur even if disabled
386
- - ``#echo You take a deep breath and stand up.``: Simulate trigger testing when server receives "You take a deep breath and stand up." (won't display test results)
387
-
388
- Notes:
389
- - #show command only displays test results without actual trigger execution
390
- - #test command forces actual trigger execution regardless of enabled status
391
- - #echo command can be used to manually trigger triggers
392
- ''',
393
-
394
- "handle_timer" :
395
- '''
396
- The execution function of embedded command #timer/#ti for timer operations. Can be used with 0-2 parameters.
397
- This function should not be called directly in the code.
398
-
399
- Usage:
400
- - #ti: Show all timers in current session
401
- - #ti {ti_id}: Show details of timer with ID {ti_id}
402
- - #ti {ti_id} {on/off/del}: Enable/disable/delete timer with ID {ti_id}
403
- - #ti {second} {code}: Create new timer with interval {second} seconds executing {code}
404
- - PyMUD supports multiple concurrent timers
405
-
406
- Parameters:
407
- :ti_id: Timer ID
408
- :on: Enable
409
- :off: Disable
410
- :del: Delete
411
- :second: Interval in seconds for new timer
412
- :code: Code to execute when timer triggers
413
-
414
- Examples:
415
- - ``#ti``: List all timers
416
- - ``#ti my_timer``: Show details of 'my_timer' timer
417
- - ``#ti my_timer on``: Enable 'my_timer' timer
418
- - ``#ti my_timer off``: Disable 'my_timer' timer
419
- - ``#ti my_timer del``: Delete 'my_timer' timer
420
- - ``#ti 100 {drink jiudai;#wa 200;eat liang}``: Create timer executing drink/eat commands every 100 seconds
421
-
422
- Related commands:
423
- - #alias
424
- - #trigger
425
- - #command
426
- ''',
427
-
428
- "handle_command" :
429
- '''
430
- The execution function of the embedded command #command / #cmd for command operations. Can be used with 0-2 parameters.
431
- This function should not be called directly in the code.
432
-
433
- Usage:
434
- - #cmd: Show all commands in current session
435
- - #cmd {cmd_id}: Show details of command with ID {cmd_id}
436
- - #cmd {cmd_id} {on/off/del}: Enable/disable/delete command with ID {cmd_id}
437
- - Commands can only be created through script code due to their special nature
438
-
439
- Parameters:
440
- :cmd_id: Command ID
441
- :on: Enable
442
- :off: Disable
443
- :del: Delete
444
-
445
- Examples:
446
- - ``#cmd`` : No parameters, list all commands
447
- - ``#cmd my_cmd`` : Single parameter, show details of 'my_cmd' command
448
- - ``#cmd my_cmd on`` : Two parameters, enable 'my_cmd' command
449
- - ``#cmd my_cmd off`` : Two parameters, disable 'my_cmd' command
450
- - ``#cmd my_cmd del`` : Two parameters, delete 'my_cmd' command
451
-
452
- Related commands:
453
- - #alias
454
- - #trigger
455
- - #timer
456
- ''',
457
-
458
- "handle_warning" :
459
- '''
460
- The execution function of the embedded command #warning, using session.warning to output messages for testing.
461
- This function should not be called directly in the code.
462
-
463
- Usage:
464
- - #warning {msg}
465
-
466
- Related commands:
467
- - #info
468
- - #error
469
- ''',
470
-
471
- "handle_error" :
472
- '''
473
- The execution function of the embedded command #error, using session.error to output messages for testing.
474
- This function should not be called directly in the code.
475
-
476
- Usage:
477
- - #error {msg}
478
-
479
- Related commands:
480
- - #info
481
- - #warning
482
- ''',
483
-
484
- "handle_log" :
485
- '''
486
- Execution function for the embedded command #log, controlling the logging status of the current session.
487
- This function should not be called directly in code.
488
-
489
- Usage:
490
- - #log : Display status of all loggers
491
- - #log start [logger-name] [-a|-w|-n] [-r] : Start a logger
492
-
493
- Parameters:
494
- - :logger-name: Logger name. When unspecified, uses session name (default session logger)
495
- - :-a|-w|-n: File mode selection.
496
- -a Append mode (default), adds to end of existing log file
497
- -w Overwrite mode, clears existing file and starts fresh
498
- -n New mode, creates timestamped file in name.now.log format
499
- - :-r: Enable raw logging mode
500
-
501
- - #log stop [logger-name] : Stop a logger
502
-
503
- Parameters:
504
- - :logger-name: Logger name. When unspecified, uses session name (default session logger)
505
-
506
- - #log show [loggerFile]: Display all logs or specific log file
507
-
508
- Parameters:
509
- - :loggerFile: Specific log file to display. Shows directory listing when unspecified
510
-
511
- Examples:
512
- - ``#log`` : List all logger statuses in current session
513
- - ``#log start`` : Start default session logger (using session name). Logs in plain text mode to log/name.log in append mode
514
- - ``#log start -r`` : Start default logger in raw mode
515
- - ``#log start chat`` : Start 'chat' logger for specific logging via .log() calls
516
- - ``#log stop`` : Stop default session logger
517
-
518
- Notes:
519
- - File mode changes (-a/-w/-n) only take effect on next logger start
520
- - Logging mode (-r) changes take effect immediately
521
- ''',
522
-
523
- "handle_gmcp" :
524
- '''
525
- Execution function for the embedded command #gmcp, used to manage GMCPTriggers.
526
- This command can be used with no parameters, one parameter, or two parameters.
527
- This function should not be called directly in code.
528
-
529
- Usage:
530
- - #gmcp: Display all GMCPTriggers in this session
531
- - #gmcp {gmcp_key}: Show details of the GMCPTrigger named {gmcp_key} in this session
532
- - #gmcp {gmcp_key} {on/off/del}: Enable/disable/delete the GMCPTrigger named {gmcp_key} in this session
533
- - Note: GMCPTriggers can only be created through script code due to their special nature
534
-
535
- Parameters:
536
- :gmcp_key: Name/identifier of the GMCPTrigger
537
- :on: Enable
538
- :off: Disable
539
- :del: Delete
540
-
541
- Examples:
542
- - ``#gmcp`` : No parameters, list all GMCPTriggers in current session
543
- - ``#gmcp GMCP.Move`` : Single parameter, display details of GMCPTrigger named GMCP.Move
544
- - ``#gmcp GMCP.Move on`` : Two parameters, enable GMCPTrigger named GMCP.Move (enabled = True)
545
- - ``#gmcp GMCP.Move off`` : Two parameters, disable GMCPTrigger named GMCP.Move (enabled = False)
546
- - ``#gmcp GMCP.Move del`` : Two parameters, delete GMCPTrigger named GMCP.Move
547
-
548
- Related commands:
549
- - #alias
550
- - #trigger
551
- - #timer
552
- ''',
553
-
554
- "handle_plugins" :
555
- '''
556
- Execution function for the embedded command #plugins, displays plugin information. Can be used with no parameters or one parameter.
557
- This function should not be called directly in code.
558
-
559
- Usage:
560
- - #plugins: Show list of all plugins loaded in current session
561
- - #plugins {myplug}: Show detailed information for plugin named myplug
562
-
563
- Related commands:
564
- - #modules
565
- ''',
566
-
567
- "handle_replace" :
568
- '''
569
- Execution function for the embedded command #replace, modifies display content by replacing original line content with new message. No newline needed.
570
- This function should not be called directly in code.
571
-
572
- Usage:
573
- - #replace {new_display}: Replace current line display with {new_display}
574
-
575
- Parameters:
576
- - :new_display: Replacement display content (supports ANSI color codes)
577
-
578
- Example:
579
- - ``#replace %raw - Captured this line`` : Add annotation after captured line information
580
-
581
- Note:
582
- - Should be used in synchronous trigger processing. For multi-line triggers, replacement only affects last line.
583
-
584
- Related commands:
585
- - #gag
586
- ''',
587
-
588
- "handle_all" :
589
- '''
590
- Execution function for embedded command #all, sends same command to all sessions.
591
- This function should not be called directly in code.
592
-
593
- Usage:
594
- - #all {command}: Broadcast specified command to all sessions in current application
595
-
596
- Parameters:
597
- :command: Command to broadcast
598
-
599
- Example:
600
- - #all look: Execute 'look' command in all sessions
601
- - #all #cls: Clear display content for all sessions
602
- ''',
603
- "handle_save" :
604
- '''
605
- The execution function of the embedded command #save, which saves the current session variables (excluding system variables and temporary variables) to a file. This command does not take any parameters.
606
- System variables include %line, %copy, and %raw. Temporary variables refer to variables whose names start with an underscore.
607
- This function should not be called directly in the code.
608
-
609
- Usage:
610
- - #save: Save the current session variables.
611
-
612
- Notes:
613
- 1. The file is saved in the current directory with the name {session_name}.mud.
614
- 2. The Python pickle module is used to save variables, so all variables should be type introspective.
615
- 3. Although variables support all Python types, it is still recommended to use only serializable types in variables.
616
- 4. namedtuple is not recommended because type matching will fail after loading, and two namedtuples with the same definition will not be considered the same type.
617
-
618
- Related commands:
619
- - #variable
620
- ''',
621
-
622
- "handle_reset" :
623
- '''
624
- The execution function of the embedded command #reset, which resets all scripts. This command does not take any parameters.
625
- The reset operation will reset all triggers, commands, and incomplete tasks, and clear all triggers, commands, aliases, and variables.
626
- This function should not be called directly in the code.
627
-
628
- Usage:
629
- - #reset: Reset all scripts.
630
-
631
- Related commands:
632
- - #load
633
- - #unload
634
- - #reload
635
- ''',
636
-
637
- "handle_load" :
638
- '''
639
- The execution function of the embedded command #load, which performs module loading operations for the current session. When loading multiple modules, separate them with spaces or commas.
640
- This function should not be called directly in the code.
641
-
642
- Usage:
643
- - #load {mod1}: Load a module with the specified name.
644
- - #load {mod1} {mod2} ... {modn}: Load multiple modules with the specified names.
645
- - #load {mod1},{mod2},...{modn}: Load multiple modules with the specified names.
646
- - Note: When loading multiple modules, they will be loaded one by one in sequence. Therefore, if there are dependencies between modules, please pay attention to the order.
647
-
648
- Parameters:
649
- :modx: Module name.
650
-
651
- Examples:
652
- - ``#load myscript`` : Load the myscript module. First, it will look for the myscript.py file in the current directory where the PyMUD application is executed and load it.
653
- - ``#load pymud.pkuxkx`` : Load the pymud.pkuxkx module, which is equivalent to the import pymud.pkuxkx command in the script.
654
- - ``#load myscript1 myscript2`` : Load the myscript1 and myscript2 modules in sequence.
655
- - ``#load myscript1,myscript2`` : Multiple scripts can also be separated by commas.
656
-
657
- Related commands:
658
- - #unload
659
- - #reload
660
- - #module
661
- ''',
662
-
663
- "handle_unload" :
664
- '''
665
- The execution function of the embedded command #unload, which unloads modules.
666
- This function should not be called directly in the code.
667
-
668
- Usage:
669
- - #unload {modname}: Unload a loaded module with the specified name.
670
- - #unload {mod1} {mod2} ... {modn}: Unload multiple modules/plugins with the specified names.
671
- - #unload {mod1},{mod2},...{modn}: Unload multiple modules/plugins with the specified names.
672
- - Note: When unloading a module, the objects created by the module will not be automatically cleaned up. Instead, the unload method of the Configuration class in the module will be called. If you need to clean up the objects created by the module, please explicitly put the cleanup code in this method.
673
-
674
- Parameters:
675
- :modname: Module name.
676
- :modn: Module name.
677
-
678
- Examples:
679
- - ``#unload mymodule``: Unload the module named mymodule (and call the unload method of the Configuration class in it if it exists).
680
-
681
- Related commands:
682
- - #load
683
- - #reload
684
- - #module
685
- ''',
686
- "handle_modules" :
687
- '''
688
- The execution function of the embedded command #modules, used to manage loaded configuration modules.
689
- This function should not be called directly in the code.
690
-
691
- Usage:
692
- - #modules: List all loaded modules in the current session.
693
- - #modules <module>: Display the configuration details of the specified module.
694
-
695
- Parameters:
696
- :module: Module name (optional).
697
- ''',
698
-
699
- "handle_reload" :
700
- '''
701
- The execution function of the embedded command #reload, used to reload modules/plugins.
702
- This function should not be called directly in the code.
703
-
704
- Usage:
705
- - #reload: Reload all loaded modules.
706
- - #reload {modname}: Reload the module named modname.
707
- - #reload {plugins}: Reload the plugin named plugins.
708
- - #reload {mod1} {mod2} ... {modn}: Reload multiple modules/plugins with specified names.
709
- - #reload {mod1},{mod2},...{modn}: Reload multiple modules/plugins with specified names.
710
-
711
- Parameters:
712
- :modname: Module name.
713
- :plugins: Plugin name.
714
- :modn: Module name.
715
-
716
- Notes:
717
- 1. #reload can only reload modules loaded via the #load method (including those specified in pymud.cfg), but cannot reload modules imported using import xxx.
718
- 2. If there are syntax errors in the loaded module scripts, #reload may not take effect. In this case, you need to exit and reopen PyMUD.
719
- 3. If different modules are loaded sequentially and there are dependencies between them, when reloading, you should reload them one by one in the original dependency order; otherwise, it is easy to encounter missing dependencies or dependency errors.
720
-
721
- Examples:
722
- - ``#reload`` : Reload all loaded modules.
723
- - ``#reload mymodule`` : Reload the module named mymodule.
724
- - ``#reload myplugins`` : Reload the plugin named myplugins.
725
- - ``#reload mymodule myplugins`` : Reload the module named mymodule and the plugin named myplugins.
726
-
727
- Related commands:
728
- - #load
729
- - #unload
730
- - #module
731
- ''',
732
-
733
- "handle_gag" :
734
- '''
735
- The execution function of the embedded command #gag, used to prevent the current line from being displayed in the main window, usually used in triggers.
736
- This function should not be called directly in the code.
737
-
738
- Usage:
739
- - #gag
740
-
741
- Notes:
742
- - Once the current line is gagged, it will never be displayed again, but the corresponding trigger will still take effect.
743
-
744
- Related commands:
745
- - #replace
746
- ''',
747
-
748
- "handle_py" :
749
- '''
750
- The execution function of the embedded command #py, used to execute Python statements.
751
- This function should not be called directly in the code.
752
-
753
- Usage:
754
- - #py {py_code}: Execute py_code in the current context.
755
- - The environment is the current context, where self represents the current session.
756
-
757
- Examples:
758
- - ``#py self.info("hello")`` : Equivalent to calling ``session.info("hello")`` in the current session.
759
- - ``#py self.enableGroup("group1", False)`` : Equivalent to calling ``session.enableGroup("group1", False)``.
760
- ''',
761
-
762
- "handle_trigger" :
763
- '''
764
- The execution function of the embedded commands #trigger / #tri / #action, used to operate triggers. This command can be used with no parameters, one parameter, or two parameters.
765
- This function should not be called directly in the code.
766
-
767
- Usage:
768
- - #tri: Display all triggers in this session.
769
- - #tri {tri_id}: Display information about the trigger with id {tri_id} in this session.
770
- - #tri {tri_id} {on/off/del}: Enable/disable/delete the trigger with id {tri_id} in this session.
771
- - #tri {pattern} {code}: Create a new trigger with the matching pattern {pattern} and execute {code} when matched.
772
- - In the trigger's code, %line can be used to represent the line, and %1~%9 can be used to represent the captured information.
773
-
774
- Parameters:
775
- :tri_id: The id of the Trigger.
776
- :on: Enable.
777
- :off: Disable.
778
- :del: Delete.
779
- :pattern: The matching pattern of the trigger, which should be a valid Python regular expression.
780
- :code: The content to be executed when the trigger is successfully matched.
781
-
782
- Examples:
783
- - ``#tri``: Without parameters, print and list all triggers in the current session.
784
- - ``#tri my_tri``: With one parameter, list detailed information about the Trigger object with id my_tri.
785
- - ``#tri my_tri on``: With two parameters, enable the Trigger object with id my_tri (enabled = True).
786
- - ``#tri my_tri off``: With two parameters, disable the Trigger object with id my_tri (enabled = False).
787
- - ``#tri my_tri del``: With two parameters, delete the Trigger object with id my_tri.
788
- - ``#tri {^[> ]*Duan Yu stumbles.+} {get duan}``: With two parameters, create a new Trigger object. Pick up Duan Yu when he is knocked down.
789
-
790
- Related commands:
791
- - #alias
792
- - #timer
793
- - #command
794
- ''',
795
- "handle_wait" :
796
- '''
797
- The execution function of the embedded commands #wait / #wa, used for asynchronous delay waiting for a specified time, which is used for delay waiting between multiple commands.
798
- This function should not be called directly in the code.
799
-
800
- Usage:
801
- - #wa {ms}
802
-
803
- Parameters:
804
- - ms: Waiting time (milliseconds)
805
-
806
- Example:
807
- - ``eat liang;#wa 300;drink jiudai``
808
- Eat dry food, then execute "drink from the wine bag" after a 300-millisecond delay.
809
-
810
- Related commands:
811
- - #gag
812
- - #replace
813
- ''',
814
-
815
- "handle_clear" :
816
- '''
817
- The execution function of the embedded commands #clear / #cls, used to clear the current session buffer and display.
818
- This function should not be called directly in the code.
819
-
820
- Usage:
821
- - #cls: Clear the current session buffer and display.
822
- ''',
823
-
824
- "handle_message" :
825
- '''
826
- The execution function of the embedded commands #message / #mess, used to pop up a dialog box to display the given information.
827
- This function should not be called directly in the code.
828
-
829
- Usage:
830
- - #mess {msg}: Pop up a dialog box to display the information specified by {msg}.
831
-
832
- Parameters:
833
- :msg: The information to be displayed in the pop-up window.
834
-
835
- Examples:
836
- - ``#mess This is a test line`` : Use a pop-up window to display "This is a test line".
837
- - ``#mess %line`` : Use a pop-up window to display the value of the system variable %line.
838
- ''',
839
-
840
- "handle_disconnect" :
841
- '''
842
- The execution function of the embedded commands #disconnect / #dis, used to disconnect from the remote server (only effective when the remote server is already connected).
843
- This function should not be called directly in the code.
844
-
845
- Related commands:
846
- - #connect
847
- - #close
848
- ''',
849
- }
850
- },
1
+ TRANSLATION = {
2
+ "text" : {
3
+ "welcome" : "Welcome to PYMUD Client - PKUXKX, the best Chinese MUD game", # the welcome text shown in the statusbar when pymud start
4
+
5
+ # text in pymud.py
6
+ "world" : "World", # the display text of menu "world"
7
+ "new_session" : "Create New Session", # the display text of sub-menu "new_session"
8
+ "show_log" : "Show Log Information", # the display text of sub-menu "show_log"
9
+ "exit" : "Exit", # the display text of sub-menu "exit"
10
+ "session" : "Session", # the display text of menu "session"
11
+ "connect" : "Connect/Reconnect", # the display text of sub-menu "connect"
12
+ "disconnect" : "Disconnect", # the display text of sub-menu "disconnect"
13
+ "beautify" : "Toggle Beautify Display", # the display text of sub-menu "toggle beautify"
14
+ "echoinput" : "Toggle Echo Input Commands", # the display text of sub-menu "toggle echo input"
15
+ "nosplit" : "Disable Split Screen", # the display text of sub-menu "no split"
16
+ "copy" : "Copy (Plain Text)", # the display text of sub-menu "copy (pure text)"
17
+ "copyraw" : "Copy (ANSI)", # the display text of sub-menu "copy (raw infomation)"
18
+ "clearsession" : "Clear Session Content", # the display text of sub-menu "clear session buffer"
19
+ "closesession" : "Close Current Page", # the display text of sub-menu "close current session"
20
+ "autoreconnect" : "Toggle Auto Reconnect", # the display text of sub-menu "toggle auto reconnect"
21
+ "loadconfig" : "Load Script Configuration", # the display text of sub-menu "load config"
22
+ "reloadconfig" : "Reload Script Configuration", # the display text of sub-menu "reload config"
23
+ "layout" : "Layout", # the display text of menu "layout" (not used now)
24
+ "hide" : "Hide Status Window", # the display text of sub-menu "hide status window" (not used now)
25
+ "horizon" : "Bottom Status Window", # the display text of sub-menu "horizon layout" (not used now)
26
+ "vertical" : "Right Status Window", # the display text of sub-menu "vertical layout" (not used now)
27
+ "help" : "Help", # the display text of menu "help"
28
+ "about" : "About", # the display text of menu "about"
29
+
30
+ "session_changed" : "Successfully switched to session: {0}",
31
+ "input_prompt" : '<prompt><b>Command:</b></prompt>',
32
+ "msg_copy" : "Copied: {0}",
33
+ "msg_copylines" : "Copied: {0} lines",
34
+ "msg_no_selection" : "No content selected...",
35
+ "msg_session_exists" : "Error! A session named {0} already exists, please try another name.",
36
+
37
+ "logfile_name" : "Log File Name",
38
+ "logfile_size" : "File Size",
39
+ "logfile_modified" : "Last Modified Time",
40
+
41
+ "warning" : "Warning",
42
+ "warning_exit" : "Application Exit Warning",
43
+ "session_close_prompt" : "Session {0} is still connected, confirm to close?",
44
+ "app_exit_prompt" : "There are still {0} sessions {1} connected, confirm to close?",
45
+
46
+ "msg_beautify" : "Beautify display is now",
47
+ "msg_echoinput" : "Echo input commands is set to:",
48
+ "msg_autoreconnect" : "Auto reconnect is set to:",
49
+ "msg_open" : "On",
50
+ "msg_close" : "Off",
51
+
52
+ "msg_cmd_session_error" : 'When creating a session with a single parameter, use the format group.name, e.g. #session pkuxkx.newstart',
53
+ "msg_cmdline_input" : "Command line input:",
54
+ "msg_no_session" : "No active session currently running.",
55
+ "msg_invalid_plugins" : "File: {0} is not a valid plugin file, loading error, message: {1}",
56
+
57
+ "status_nobeautify" : "Beautify disabled",
58
+ "status_mouseinh" : "Mouse disabled",
59
+ "status_ignore" : "Global disable",
60
+ "status_notconnect" : "Not connected",
61
+ "status_connected" : "Connected",
62
+
63
+ # text in dialogs.py
64
+ "basic_dialog" : "Basic Dialog",
65
+ "ok" : "OK",
66
+ "cancel" : "Cancel",
67
+ "visit" : "Visit",
68
+ "displayhelp" : "to view the latest help documentation",
69
+ "appinfo" : '<b fg="red">PYMUD {0}</b> - a MUD Client Written in Python',
70
+ "author" : 'Author: <b>{0}</b> <b>E-mail</b>: <u>{1}</u>',
71
+ "sysversion" : 'System:{} {} Python Version:{}',
72
+ "sessionname" : "Session Name",
73
+ "host" : "Server Address",
74
+ "port" : "Port",
75
+ "encoding" : "Encoding",
76
+ "nolog" : "No Log",
77
+ "chooselog" : "Select Log to View",
78
+
79
+ # text in modules.py
80
+ "configuration_created" : "Configuration object {0}.{1} created successfully.",
81
+ "configuration_recreated" : "Configuration object {0}.{1} recreated successfully.",
82
+ "configuration_fail" : "Configuration object {0}.{1} creation failed. Error message: {}",
83
+ "entity_module" : "Main Configuration Module",
84
+ "non_entity_module" : "Sub Configuration Module",
85
+ "load_ok" : "Load completed",
86
+ "load_fail" : "Load failed",
87
+ "unload_ok" : "Unload completed",
88
+ "reload_ok" : "Reload completed",
89
+ "msg_plugin_unloaded" : "Plugin {0} has been disabled for this session.",
90
+ "msg_plugin_loaded" : "Plugin {0} has been enabled for this session.",
91
+
92
+ # text in objects.py
93
+ "excpetion_brace_not_matched" : "Invalid code block, number of braces does not match",
94
+ "exception_quote_not_matched" : "Number of quotes does not match",
95
+ "exception_forced_async" : "This command contains both forced synchronous and asynchronous commands, will use asynchronous execution, synchronous commands will be invalid.",
96
+ "exception_session_type_fail" : "session must be an instance of Session type object!",
97
+ "exception_message" : "Exception information: <{}> {}",
98
+ "exception_traceback" : "Exception occurred at line number {1} in file '{0}', and function name is '{2}'",
99
+ "script_error" : "Script Error",
100
+
101
+ # text display in session.py
102
+ "msg_var_autoload_success" : "Variables automatically loaded from {0} successfully.",
103
+ "msg_var_autoload_fail" : "Failed to automatically load variables from {0}, error message: {1}.",
104
+ "msg_auto_script" : "Will automatically load the following modules: {0}",
105
+ "msg_connection_fail" : "Error occurred during connection creation, time: {0}, error message: {1}.",
106
+ "msg_auto_reconnect" : "Will automatically reconnect in {0} seconds...",
107
+ "msg_connected" : "{0}: Successfully connected to server.",
108
+ "msg_disconnected" : "{0}: Disconnected from server.",
109
+ "msg_duplicate_logname" : "A logger named {0} already exists in other sessions, will return this logger directly.",
110
+ "msg_default_statuswindow" : "This is a default status window message\nSession: {0} Connection Status: {1}",
111
+ "msg_mxp_not_support" : "MXP support is not yet developed, please do not enable MXP support settings for now!",
112
+ "msg_no_session" : "No session named {0} exists.",
113
+ "msg_num_positive" : "#{num} {cmd} only supports positive integers!",
114
+ "msg_cmd_not_recognized" : "Unrecognized command: {0}",
115
+ "msg_id_not_consistent" : "Object {0} dictionary key {1} does not match its id {2}, will discard key and add to session using its id...",
116
+ "msg_shall_be_string" : "{0} must be string type",
117
+ "msg_shall_be_list_or_tuple" : "{0} names should be tuple or list, other types not accepted",
118
+ "msg_names_and_values" : "names and values should not be empty and have equal length",
119
+ "msg_not_null" : "{0} cannot be null",
120
+ "msg_topic_not_found" : "Topic {0} not found, please confirm input is correct.",
121
+ "Day" : "Day",
122
+ "Hour" : "Hour",
123
+ "Minute" : "Minute",
124
+ "Second" : "Second",
125
+ "msg_connection_duration" : "Connected to server for: {0}",
126
+ "msg_no_object" : "No {1} named {0} exists in current session.",
127
+ "msg_no_global_object" : "No {1} named {0} exists in global space.",
128
+ "msg_object_value_setted" : "Successfully set {0} {1} value to {2}.",
129
+ "variable" : "variable",
130
+ "globalvar" : "global variable",
131
+ "msg_object_not_exists" : "No {1} with key {0} exists in current session, please confirm and try again.",
132
+ "msg_object_enabled" : "Object {0} enabled status is now on.",
133
+ "msg_object_disabled" : "Object {0} enabled status is now off.",
134
+ "msg_object_deleted" : "Object {0} has been deleted from session.",
135
+ "msg_group_objects_enabled" : "{1} object(s) of Type {2} in group {1} has(have) been enabled.",
136
+ "msg_group_objects_disabled" : "{1} object(s) of Type {2} in group {1} has(have) been disabled.",
137
+ "msg_group_objects_deleted" : "{1} object(s) of Type {2} in group {1} has(have) been deleted.",
138
+ "msg_object_param_invalid" : "#{0} command's second parameter only accepts on/off/del",
139
+ "msg_ignore_on" : "All trigger enables are globally disabled.",
140
+ "msg_ignore_off" : "No longer globally disable all trigger enables.",
141
+ "msg_T_plus_incorrect" : "#T+ enable group usage incorrect, correct usage example: #t+ mygroup \nPlease use #help ignore for query.",
142
+ "msg_T_minus_incorrect" : "#T- disable group usage incorrect, correct usage example: #t- mygroup \nPlease use #help ignore for query.",
143
+ "msg_group_enabled" : "Group {0}: {1} aliases, {2} triggers, {3} commands, {4} timers, {5} GMCP triggers are all enabled.",
144
+ "msg_group_disabled" : "Group {0}: {1} aliases, {2} triggers, {3} commands, {4} timers, {5} GMCP triggers are all disabled.",
145
+ "msg_repeat_invalid" : "Current session is not connected or no command has been entered, repeat invalid",
146
+ "msg_window_title" : "Message from session {0}",
147
+ "msg_module_load_fail" : "Module {0} load failed, exception: {1}, type: {2}.",
148
+ "msg_exception_traceback" : "Exception traceback: {0}",
149
+ "msg_module_not_loaded" : "Specified module name {0} is not loaded.",
150
+ "msg_all_module_reloaded" : "All configuration modules reloaded successfully.",
151
+ "msg_plugins_reloaded" : "Plugin {0} reloaded successfully.",
152
+ "msg_name_not_found" : "Specified name {0} neither found as module nor plugin, reload failed...",
153
+ "msg_no_module" : "No modules loaded in current session.",
154
+ "msg_module_list" : "Current session has loaded {0} modules, including (in loading order): {1}.",
155
+ "msg_module_configurations" : "Module {0} contains configurations: {1}.",
156
+ "msg_submodule_no_config" : "Module {0} is a submodule, contains no configurations.",
157
+ "msg_module_not_loaded" : "No module named {0} exists in this session, may not be loaded to this session yet.",
158
+ "msg_variables_saved" : "Session variable information saved to {0}.",
159
+ "msg_alias_created" : "Alias {0} created successfully: {1}",
160
+ "msg_trigger_created" : "Trigger {0} created successfully: {1}",
161
+ "msg_timer_created" : "Timer {0} created successfully: {1}",
162
+
163
+ "msg_tri_triggered" : " {0} triggered normally.",
164
+ "msg_tri_wildcards" : " Captured: {0}",
165
+ "msg_tri_prevent" : " {0}This trigger does not have keepEval enabled, will prevent subsequent triggers.{1}",
166
+ "msg_tri_ignore" : " {1}{0} can trigger, but due to priority and keepEval settings, trigger will not activate.{2}",
167
+ "msg_tri_matched" : " {0} can match trigger.",
168
+ "msg_enabled_summary_0" : "{0} Among enabled triggers, none can trigger.",
169
+ "msg_enabled_summary_1" : "{0} Among enabled triggers, {1} can trigger, actually triggered {2}, another {3} will not activate due to keepEval.",
170
+ "msg_enabled_summary_2" : "{0} Among enabled triggers, all {1} can trigger normally.",
171
+ "msg_disabled_summary_0" : "{0} Among disabled triggers, {1} can match.",
172
+ "msg_disabled_summary_1" : "{0} Disabled triggers, none can match.",
173
+ "msg_test_summary_0" : " Test content: {0}",
174
+ "msg_test_summary_1" : " Test result: No matching triggers.",
175
+ "msg_test_summary_2" : " Test result: {0} triggers can trigger normally, total {1} satisfy matching requirements.",
176
+ "msg_test_title" : "Trigger Test - {0}",
177
+ "msg_triggered_mode" : "'Response Mode'",
178
+ "msg_matched_mode" : "'Test Mode'",
179
+
180
+ "msg_no_plugins" : "PYMUD currently has no plugins loaded.",
181
+ "msg_plugins_list" : "PYMUD currently has {0} plugins loaded, respectively:",
182
+ "msg_plugins_info" : "Author {2} Version {1} Release Date {3}\n Description: {0}",
183
+
184
+ "msg_py_exception" : "Python execution error: {0}",
185
+
186
+ "title_msg" : "Message",
187
+ "title_warning" : "Warning",
188
+ "title_error" : "Error",
189
+ "title_info" : "Info",
190
+
191
+ "msg_log_title" : "Logger status in this session:",
192
+ "msg_log_title2" : "Logger status in other sessions of this application:",
193
+ "logger" : "Logger",
194
+ "enabled" : "Enabled",
195
+ "disabled" : "Disabled",
196
+ "logger_status" : "Current Status",
197
+ "file_mode" : "File Mode",
198
+ "logger_mode" : "Log Mode",
199
+ "ANSI" : "ANSI",
200
+ "plain_text" : "Plain Text",
201
+
202
+ "filemode_new" : "New",
203
+ "filemode_append" : "Append",
204
+ "filemode_overwrite" : "Overwrite",
205
+
206
+ "msg_logger_enabled" : "{0}: Logger {1} enabled with {2} file mode and {3} log mode.",
207
+ "msg_logger_disabled" : "{0}: Logger {1} logging disabled.",
208
+ "msg_logfile_not_exists" : "Specified log file {0} does not exist.",
209
+
210
+ "exception_logmode_error" : "Invalid log mode: {0}",
211
+ "exception_plugin_file_not_found" : "Specified plugin file {0} does not exist or format is incorrect.",
212
+ },
213
+
214
+ "docstring" : {
215
+ "PyMudApp": {
216
+ "handle_session" :
217
+ '''
218
+ The execution function of the embedded command #session, used to create a remote connection session.
219
+ This function should not be called directly in the code.
220
+
221
+ Usage:
222
+ - #session {name} {host} {port} {encoding}
223
+ - When Encoding is not specified, the default encoding is utf-8.
224
+ - You can directly use #{name} to switch sessions and operate session commands.
225
+
226
+ - #session {group}.{name}
227
+ - This is equivalent to directly clicking the {name} menu under the {group} menu to create a session. If the session already exists, switch to that session.
228
+
229
+ Parameters:
230
+ :name: Session name
231
+ :host: Server domain name or IP address
232
+ :port: Port number
233
+ :encoding: Encoding format. If not specified, the default is utf8.
234
+
235
+ :group: Group name, which is a keyword under the sessions field in the configuration file.
236
+ :name: Shortcut name for the session, which is a keyword under the chars field of the above group keyword.
237
+
238
+ Examples:
239
+ ``#session {name} {host} {port} {encoding}``
240
+ Create a remote connection session, connect to the specified port of the remote host using the specified encoding format, and save it as {name}. The encoding can be omitted, in which case the value of Settings.server["default_encoding"] will be used, with a default of utf8.
241
+ ``#session newstart mud.pkuxkx.net 8080 GBK``
242
+ Connect to port 8080 of mud.pkuxkx.net using GBK encoding, and name the session newstart.
243
+ ``#session newstart mud.pkuxkx.net 8081``
244
+ Connect to port 8081 of mud.pkuxkx.net using UTF8 encoding, and name the session newstart.
245
+ ``#newstart``
246
+ Switch the session named newstart to the current session.
247
+ ``#newstart give miui gold``
248
+ Make the session named newstart execute the "give miui gold" command without switching to that session.
249
+
250
+ ``#session pkuxkx.newstart``
251
+ Create a session through the specified shortcut configuration, which is equivalent to clicking the World -> pkuxkx -> newstart menu to create a session. If the session exists, switch to that session.
252
+
253
+ Related commands:
254
+ - #close
255
+ - #exit
256
+
257
+ ''',
258
+
259
+
260
+ },
261
+ "Session": {
262
+ "handle_exit" :
263
+ '''
264
+ The execution function of the embedded command #exit, used to exit the `PyMudApp` application.
265
+ This function should not be called directly in the code.
266
+
267
+ *Note: When there are sessions still connected in the application, exiting the application with #exit will pop up dialog boxes one by one to confirm whether to close these sessions.*
268
+
269
+ Related commands:
270
+ - #close
271
+ - #session
272
+ ''',
273
+
274
+ "handle_close" :
275
+ '''
276
+ The execution function of the embedded command #close, used to close the current session and remove it from the session list of `PyMudApp`.
277
+ This function should not be called directly in the code.
278
+
279
+ *Note: When the current session is connected, closing the session with #close will pop up a dialog box to confirm whether to close.*
280
+
281
+ Related commands:
282
+ - #exit
283
+ - #session
284
+ ''',
285
+
286
+ "handle_variable" :
287
+ '''
288
+ The execution function of the embedded command #variable / #var, used to operate session variables.
289
+ This command can be used with no parameters, one parameter, or two parameters.
290
+ This function should not be called directly in the code.
291
+
292
+ Usage:
293
+ - #var: List all variables in this session.
294
+ - #var {name}: List the value of the variable named {name} in this session.
295
+ - #var {name} {value}: Set the value of the variable named {name} in this session to {value}, create it if it does not exist.
296
+
297
+ Parameters:
298
+ :name: Variable name.
299
+ :value: Variable value. Note: After assignment, this value will be of type str!
300
+
301
+ Related commands:
302
+ - #global
303
+ ''',
304
+
305
+ "handle_global" :
306
+ '''
307
+ The execution function of the embedded command #global, used to operate global variables.
308
+ This command can be used with no parameters, one parameter, or two parameters.
309
+ This function should not be called directly in the code.
310
+
311
+ Usage:
312
+ - #global: List all global variables.
313
+ - #global {name}: List the value of the global variable named {name}.
314
+ - #global {name} {value}: Set the value of the global variable named {name} to {value}, create it if it does not exist.
315
+
316
+ Parameters:
317
+ :name: Variable name.
318
+ :value: Variable value. Note: After assignment, this value will be of type str!
319
+
320
+ Related commands:
321
+ - #variable
322
+ ''',
323
+
324
+ "handle_task" :
325
+ '''
326
+ The execution function of the embedded command #task, used to display all managed task lists (for debugging only).
327
+ This function should not be called directly in the code.
328
+
329
+ Note:
330
+ When there are many managed tasks, this command will affect system response.
331
+ ''',
332
+
333
+ "handle_ignore" :
334
+ '''
335
+ The execution function of the embedded commands #ignore / #ig, #t+ / #t-, used to handle enable/disable status.
336
+ This function should not be called directly in the code.
337
+
338
+ Usage:
339
+ - #ig: Toggle the global enable/disable status of triggers.
340
+ - #t+ [>=]{group}: Enable all objects in the {group} group, including aliases, triggers, commands, timers, GMCP triggers, etc.
341
+ - #t- [>=]{group}: Disable all objects in the {group} group, including aliases, triggers, commands, timers, GMCP triggers, etc.
342
+
343
+ Parameters:
344
+ :group: Group name. There could be a '=' or '>' sign before groupname, to indicate only this group or this group and it's subgroups. If there is no sign, it is equavalant to use '='.
345
+
346
+ Examples:
347
+ - ``#ig``: Toggle the global enable/disable status of triggers. When disabled, "Global disabled" will be displayed in the lower right corner of the status bar.
348
+ - ``#t+ mygroup``: Enable all objects in the group named mygroup, including aliases, triggers, commands, timers, GMCP triggers, etc.
349
+ - ``#t- mygroup``: Disable all objects in the group named mygroup, including aliases, triggers, commands, timers, GMCP triggers, etc.
350
+ - ``#t+ >mygroup``: Enable all objects in the group named mygroup and its subgroups (eg. mygroup.subgroup, etc.), including aliases, triggers, commands, timers, GMCP triggers, etc.
351
+
352
+ Related commands:
353
+ - #trigger
354
+ - #alias
355
+ - #timer
356
+ ''',
357
+
358
+ "handle_help" :
359
+ '''
360
+ The execution function of the embedded command #help, used to display help information for the specified topic.
361
+ This function should not be called directly in the code.
362
+
363
+ Usage:
364
+ - #help: Display a list of all available commands.
365
+ - #help <topic>: Display help information for the specified topic.
366
+
367
+ Examples:
368
+ - #help alias: Display help information for the alias command.
369
+ - #help trigger: Display help information for the trigger command.
370
+ ''',
371
+
372
+ "handle_test" :
373
+ '''
374
+ The execution function of the embedded command #test/#show/#echo, trigger testing command. Similar to zmud's #show command.
375
+ This function should not be called directly in the code.
376
+
377
+ Usage:
378
+ - #show {some_text}: Test trigger response when receives {some_text}. Triggers won't actually execute.
379
+ - #test {some_text}: Difference from #show is that matched triggers will execute regardless of enabled status.
380
+ - #echo {some_text}: Simulate receiving {some_text} from server, triggers will execute normally but won't display test results.
381
+
382
+ Examples:
383
+ - ``#show You take a deep breath and stand up.``: Simulate trigger testing when server receives "You take a deep breath and stand up." (display test results only)
384
+ - ``#test %copy``: Copy a sentence and simulate trigger testing when server receives the copied content again
385
+ - ``#test You take a deep breath and stand up.``: Actual trigger execution will occur even if disabled
386
+ - ``#echo You take a deep breath and stand up.``: Simulate trigger testing when server receives "You take a deep breath and stand up." (won't display test results)
387
+
388
+ Notes:
389
+ - #show command only displays test results without actual trigger execution
390
+ - #test command forces actual trigger execution regardless of enabled status
391
+ - #echo command can be used to manually trigger triggers
392
+ ''',
393
+
394
+ "handle_timer" :
395
+ '''
396
+ The execution function of embedded command #timer/#ti for timer operations. Can be used with 0-2 parameters.
397
+ This function should not be called directly in the code.
398
+
399
+ Usage:
400
+ - #ti: Show all timers in current session
401
+ - #ti {ti_id}: Show details of timer with ID {ti_id}
402
+ - #ti {ti_id} {on/off/del}: Enable/disable/delete timer with ID {ti_id}
403
+ - #ti {second} {code}: Create new timer with interval {second} seconds executing {code}
404
+ - PyMUD supports multiple concurrent timers
405
+
406
+ Parameters:
407
+ :ti_id: Timer ID
408
+ :on: Enable
409
+ :off: Disable
410
+ :del: Delete
411
+ :second: Interval in seconds for new timer
412
+ :code: Code to execute when timer triggers
413
+
414
+ Examples:
415
+ - ``#ti``: List all timers
416
+ - ``#ti my_timer``: Show details of 'my_timer' timer
417
+ - ``#ti my_timer on``: Enable 'my_timer' timer
418
+ - ``#ti my_timer off``: Disable 'my_timer' timer
419
+ - ``#ti my_timer del``: Delete 'my_timer' timer
420
+ - ``#ti 100 {drink jiudai;#wa 200;eat liang}``: Create timer executing drink/eat commands every 100 seconds
421
+
422
+ Related commands:
423
+ - #alias
424
+ - #trigger
425
+ - #command
426
+ ''',
427
+
428
+ "handle_command" :
429
+ '''
430
+ The execution function of the embedded command #command / #cmd for command operations. Can be used with 0-2 parameters.
431
+ This function should not be called directly in the code.
432
+
433
+ Usage:
434
+ - #cmd: Show all commands in current session
435
+ - #cmd {cmd_id}: Show details of command with ID {cmd_id}
436
+ - #cmd {cmd_id} {on/off/del}: Enable/disable/delete command with ID {cmd_id}
437
+ - Commands can only be created through script code due to their special nature
438
+
439
+ Parameters:
440
+ :cmd_id: Command ID
441
+ :on: Enable
442
+ :off: Disable
443
+ :del: Delete
444
+
445
+ Examples:
446
+ - ``#cmd`` : No parameters, list all commands
447
+ - ``#cmd my_cmd`` : Single parameter, show details of 'my_cmd' command
448
+ - ``#cmd my_cmd on`` : Two parameters, enable 'my_cmd' command
449
+ - ``#cmd my_cmd off`` : Two parameters, disable 'my_cmd' command
450
+ - ``#cmd my_cmd del`` : Two parameters, delete 'my_cmd' command
451
+
452
+ Related commands:
453
+ - #alias
454
+ - #trigger
455
+ - #timer
456
+ ''',
457
+
458
+ "handle_warning" :
459
+ '''
460
+ The execution function of the embedded command #warning, using session.warning to output messages for testing.
461
+ This function should not be called directly in the code.
462
+
463
+ Usage:
464
+ - #warning {msg}
465
+
466
+ Related commands:
467
+ - #info
468
+ - #error
469
+ ''',
470
+
471
+ "handle_error" :
472
+ '''
473
+ The execution function of the embedded command #error, using session.error to output messages for testing.
474
+ This function should not be called directly in the code.
475
+
476
+ Usage:
477
+ - #error {msg}
478
+
479
+ Related commands:
480
+ - #info
481
+ - #warning
482
+ ''',
483
+
484
+ "handle_log" :
485
+ '''
486
+ Execution function for the embedded command #log, controlling the logging status of the current session.
487
+ This function should not be called directly in code.
488
+
489
+ Usage:
490
+ - #log : Display status of all loggers
491
+ - #log start [logger-name] [-a|-w|-n] [-r] : Start a logger
492
+
493
+ Parameters:
494
+ - :logger-name: Logger name. When unspecified, uses session name (default session logger)
495
+ - :-a|-w|-n: File mode selection.
496
+ -a Append mode (default), adds to end of existing log file
497
+ -w Overwrite mode, clears existing file and starts fresh
498
+ -n New mode, creates timestamped file in name.now.log format
499
+ - :-r: Enable raw logging mode
500
+
501
+ - #log stop [logger-name] : Stop a logger
502
+
503
+ Parameters:
504
+ - :logger-name: Logger name. When unspecified, uses session name (default session logger)
505
+
506
+ - #log show [loggerFile]: Display all logs or specific log file
507
+
508
+ Parameters:
509
+ - :loggerFile: Specific log file to display. Shows directory listing when unspecified
510
+
511
+ Examples:
512
+ - ``#log`` : List all logger statuses in current session
513
+ - ``#log start`` : Start default session logger (using session name). Logs in plain text mode to log/name.log in append mode
514
+ - ``#log start -r`` : Start default logger in raw mode
515
+ - ``#log start chat`` : Start 'chat' logger for specific logging via .log() calls
516
+ - ``#log stop`` : Stop default session logger
517
+
518
+ Notes:
519
+ - File mode changes (-a/-w/-n) only take effect on next logger start
520
+ - Logging mode (-r) changes take effect immediately
521
+ ''',
522
+
523
+ "handle_gmcp" :
524
+ '''
525
+ Execution function for the embedded command #gmcp, used to manage GMCPTriggers.
526
+ This command can be used with no parameters, one parameter, or two parameters.
527
+ This function should not be called directly in code.
528
+
529
+ Usage:
530
+ - #gmcp: Display all GMCPTriggers in this session
531
+ - #gmcp {gmcp_key}: Show details of the GMCPTrigger named {gmcp_key} in this session
532
+ - #gmcp {gmcp_key} {on/off/del}: Enable/disable/delete the GMCPTrigger named {gmcp_key} in this session
533
+ - Note: GMCPTriggers can only be created through script code due to their special nature
534
+
535
+ Parameters:
536
+ :gmcp_key: Name/identifier of the GMCPTrigger
537
+ :on: Enable
538
+ :off: Disable
539
+ :del: Delete
540
+
541
+ Examples:
542
+ - ``#gmcp`` : No parameters, list all GMCPTriggers in current session
543
+ - ``#gmcp GMCP.Move`` : Single parameter, display details of GMCPTrigger named GMCP.Move
544
+ - ``#gmcp GMCP.Move on`` : Two parameters, enable GMCPTrigger named GMCP.Move (enabled = True)
545
+ - ``#gmcp GMCP.Move off`` : Two parameters, disable GMCPTrigger named GMCP.Move (enabled = False)
546
+ - ``#gmcp GMCP.Move del`` : Two parameters, delete GMCPTrigger named GMCP.Move
547
+
548
+ Related commands:
549
+ - #alias
550
+ - #trigger
551
+ - #timer
552
+ ''',
553
+
554
+ "handle_plugins" :
555
+ '''
556
+ Execution function for the embedded command #plugins, displays plugin information. Can be used with no parameters or one parameter.
557
+ This function should not be called directly in code.
558
+
559
+ Usage:
560
+ - #plugins: Show list of all plugins loaded in current session
561
+ - #plugins {myplug}: Show detailed information for plugin named myplug
562
+
563
+ Related commands:
564
+ - #modules
565
+ ''',
566
+
567
+ "handle_replace" :
568
+ '''
569
+ Execution function for the embedded command #replace, modifies display content by replacing original line content with new message. No newline needed.
570
+ This function should not be called directly in code.
571
+
572
+ Usage:
573
+ - #replace {new_display}: Replace current line display with {new_display}
574
+
575
+ Parameters:
576
+ - :new_display: Replacement display content (supports ANSI color codes)
577
+
578
+ Example:
579
+ - ``#replace %raw - Captured this line`` : Add annotation after captured line information
580
+
581
+ Note:
582
+ - Should be used in synchronous trigger processing. For multi-line triggers, replacement only affects last line.
583
+
584
+ Related commands:
585
+ - #gag
586
+ ''',
587
+
588
+ "handle_all" :
589
+ '''
590
+ Execution function for embedded command #all, sends same command to all sessions.
591
+ This function should not be called directly in code.
592
+
593
+ Usage:
594
+ - #all {command}: Broadcast specified command to all sessions in current application
595
+
596
+ Parameters:
597
+ :command: Command to broadcast
598
+
599
+ Example:
600
+ - #all look: Execute 'look' command in all sessions
601
+ - #all #cls: Clear display content for all sessions
602
+ ''',
603
+ "handle_save" :
604
+ '''
605
+ The execution function of the embedded command #save, which saves the current session variables (excluding system variables and temporary variables) to a file. This command does not take any parameters.
606
+ System variables include %line, %copy, and %raw. Temporary variables refer to variables whose names start with an underscore.
607
+ This function should not be called directly in the code.
608
+
609
+ Usage:
610
+ - #save: Save the current session variables.
611
+
612
+ Notes:
613
+ 1. The file is saved in the current directory with the name {session_name}.mud.
614
+ 2. The Python pickle module is used to save variables, so all variables should be type introspective.
615
+ 3. Although variables support all Python types, it is still recommended to use only serializable types in variables.
616
+ 4. namedtuple is not recommended because type matching will fail after loading, and two namedtuples with the same definition will not be considered the same type.
617
+
618
+ Related commands:
619
+ - #variable
620
+ ''',
621
+
622
+ "handle_reset" :
623
+ '''
624
+ The execution function of the embedded command #reset, which resets all scripts. This command does not take any parameters.
625
+ The reset operation will reset all triggers, commands, and incomplete tasks, and clear all triggers, commands, aliases, and variables.
626
+ This function should not be called directly in the code.
627
+
628
+ Usage:
629
+ - #reset: Reset all scripts.
630
+
631
+ Related commands:
632
+ - #load
633
+ - #unload
634
+ - #reload
635
+ ''',
636
+
637
+ "handle_load" :
638
+ '''
639
+ The execution function of the embedded command #load, which performs module loading operations for the current session. When loading multiple modules, separate them with spaces or commas.
640
+ This function should not be called directly in the code.
641
+
642
+ Usage:
643
+ - #load {mod1}: Load a module with the specified name.
644
+ - #load {mod1} {mod2} ... {modn}: Load multiple modules with the specified names.
645
+ - #load {mod1},{mod2},...{modn}: Load multiple modules with the specified names.
646
+ - Note: When loading multiple modules, they will be loaded one by one in sequence. Therefore, if there are dependencies between modules, please pay attention to the order.
647
+
648
+ Parameters:
649
+ :modx: Module name.
650
+
651
+ Examples:
652
+ - ``#load myscript`` : Load the myscript module. First, it will look for the myscript.py file in the current directory where the PyMUD application is executed and load it.
653
+ - ``#load pymud.pkuxkx`` : Load the pymud.pkuxkx module, which is equivalent to the import pymud.pkuxkx command in the script.
654
+ - ``#load myscript1 myscript2`` : Load the myscript1 and myscript2 modules in sequence.
655
+ - ``#load myscript1,myscript2`` : Multiple scripts can also be separated by commas.
656
+
657
+ Related commands:
658
+ - #unload
659
+ - #reload
660
+ - #module
661
+ ''',
662
+
663
+ "handle_unload" :
664
+ '''
665
+ The execution function of the embedded command #unload, which unloads modules.
666
+ This function should not be called directly in the code.
667
+
668
+ Usage:
669
+ - #unload {modname}: Unload a loaded module with the specified name.
670
+ - #unload {mod1} {mod2} ... {modn}: Unload multiple modules/plugins with the specified names.
671
+ - #unload {mod1},{mod2},...{modn}: Unload multiple modules/plugins with the specified names.
672
+ - Note: When unloading a module, the objects created by the module will not be automatically cleaned up. Instead, the unload method of the Configuration class in the module will be called. If you need to clean up the objects created by the module, please explicitly put the cleanup code in this method.
673
+
674
+ Parameters:
675
+ :modname: Module name.
676
+ :modn: Module name.
677
+
678
+ Examples:
679
+ - ``#unload mymodule``: Unload the module named mymodule (and call the unload method of the Configuration class in it if it exists).
680
+
681
+ Related commands:
682
+ - #load
683
+ - #reload
684
+ - #module
685
+ ''',
686
+ "handle_modules" :
687
+ '''
688
+ The execution function of the embedded command #modules, used to manage loaded configuration modules.
689
+ This function should not be called directly in the code.
690
+
691
+ Usage:
692
+ - #modules: List all loaded modules in the current session.
693
+ - #modules <module>: Display the configuration details of the specified module.
694
+
695
+ Parameters:
696
+ :module: Module name (optional).
697
+ ''',
698
+
699
+ "handle_reload" :
700
+ '''
701
+ The execution function of the embedded command #reload, used to reload modules/plugins.
702
+ This function should not be called directly in the code.
703
+
704
+ Usage:
705
+ - #reload: Reload all loaded modules.
706
+ - #reload {modname}: Reload the module named modname.
707
+ - #reload {plugins}: Reload the plugin named plugins.
708
+ - #reload {mod1} {mod2} ... {modn}: Reload multiple modules/plugins with specified names.
709
+ - #reload {mod1},{mod2},...{modn}: Reload multiple modules/plugins with specified names.
710
+
711
+ Parameters:
712
+ :modname: Module name.
713
+ :plugins: Plugin name.
714
+ :modn: Module name.
715
+
716
+ Notes:
717
+ 1. #reload can only reload modules loaded via the #load method (including those specified in pymud.cfg), but cannot reload modules imported using import xxx.
718
+ 2. If there are syntax errors in the loaded module scripts, #reload may not take effect. In this case, you need to exit and reopen PyMUD.
719
+ 3. If different modules are loaded sequentially and there are dependencies between them, when reloading, you should reload them one by one in the original dependency order; otherwise, it is easy to encounter missing dependencies or dependency errors.
720
+
721
+ Examples:
722
+ - ``#reload`` : Reload all loaded modules.
723
+ - ``#reload mymodule`` : Reload the module named mymodule.
724
+ - ``#reload myplugins`` : Reload the plugin named myplugins.
725
+ - ``#reload mymodule myplugins`` : Reload the module named mymodule and the plugin named myplugins.
726
+
727
+ Related commands:
728
+ - #load
729
+ - #unload
730
+ - #module
731
+ ''',
732
+
733
+ "handle_gag" :
734
+ '''
735
+ The execution function of the embedded command #gag, used to prevent the current line from being displayed in the main window, usually used in triggers.
736
+ This function should not be called directly in the code.
737
+
738
+ Usage:
739
+ - #gag
740
+
741
+ Notes:
742
+ - Once the current line is gagged, it will never be displayed again, but the corresponding trigger will still take effect.
743
+
744
+ Related commands:
745
+ - #replace
746
+ ''',
747
+
748
+ "handle_py" :
749
+ '''
750
+ The execution function of the embedded command #py, used to execute Python statements.
751
+ This function should not be called directly in the code.
752
+
753
+ Usage:
754
+ - #py {py_code}: Execute py_code in the current context.
755
+ - The environment is the current context, where self represents the current session.
756
+
757
+ Examples:
758
+ - ``#py self.info("hello")`` : Equivalent to calling ``session.info("hello")`` in the current session.
759
+ - ``#py self.enableGroup("group1", False)`` : Equivalent to calling ``session.enableGroup("group1", False)``.
760
+ ''',
761
+
762
+ "handle_trigger" :
763
+ '''
764
+ The execution function of the embedded commands #trigger / #tri / #action, used to operate triggers. This command can be used with no parameters, one parameter, or two parameters.
765
+ This function should not be called directly in the code.
766
+
767
+ Usage:
768
+ - #tri: Display all triggers in this session.
769
+ - #tri {tri_id}: Display information about the trigger with id {tri_id} in this session.
770
+ - #tri {tri_id} {on/off/del}: Enable/disable/delete the trigger with id {tri_id} in this session.
771
+ - #tri {pattern} {code}: Create a new trigger with the matching pattern {pattern} and execute {code} when matched.
772
+ - In the trigger's code, %line can be used to represent the line, and %1~%9 can be used to represent the captured information.
773
+
774
+ Parameters:
775
+ :tri_id: The id of the Trigger.
776
+ :on: Enable.
777
+ :off: Disable.
778
+ :del: Delete.
779
+ :pattern: The matching pattern of the trigger, which should be a valid Python regular expression.
780
+ :code: The content to be executed when the trigger is successfully matched.
781
+
782
+ Examples:
783
+ - ``#tri``: Without parameters, print and list all triggers in the current session.
784
+ - ``#tri my_tri``: With one parameter, list detailed information about the Trigger object with id my_tri.
785
+ - ``#tri my_tri on``: With two parameters, enable the Trigger object with id my_tri (enabled = True).
786
+ - ``#tri my_tri off``: With two parameters, disable the Trigger object with id my_tri (enabled = False).
787
+ - ``#tri my_tri del``: With two parameters, delete the Trigger object with id my_tri.
788
+ - ``#tri {^[> ]*Duan Yu stumbles.+} {get duan}``: With two parameters, create a new Trigger object. Pick up Duan Yu when he is knocked down.
789
+
790
+ Related commands:
791
+ - #alias
792
+ - #timer
793
+ - #command
794
+ ''',
795
+ "handle_wait" :
796
+ '''
797
+ The execution function of the embedded commands #wait / #wa, used for asynchronous delay waiting for a specified time, which is used for delay waiting between multiple commands.
798
+ This function should not be called directly in the code.
799
+
800
+ Usage:
801
+ - #wa {ms}
802
+
803
+ Parameters:
804
+ - ms: Waiting time (milliseconds)
805
+
806
+ Example:
807
+ - ``eat liang;#wa 300;drink jiudai``
808
+ Eat dry food, then execute "drink from the wine bag" after a 300-millisecond delay.
809
+
810
+ Related commands:
811
+ - #gag
812
+ - #replace
813
+ ''',
814
+
815
+ "handle_clear" :
816
+ '''
817
+ The execution function of the embedded commands #clear / #cls, used to clear the current session buffer and display.
818
+ This function should not be called directly in the code.
819
+
820
+ Usage:
821
+ - #cls: Clear the current session buffer and display.
822
+ ''',
823
+
824
+ "handle_message" :
825
+ '''
826
+ The execution function of the embedded commands #message / #mess, used to pop up a dialog box to display the given information.
827
+ This function should not be called directly in the code.
828
+
829
+ Usage:
830
+ - #mess {msg}: Pop up a dialog box to display the information specified by {msg}.
831
+
832
+ Parameters:
833
+ :msg: The information to be displayed in the pop-up window.
834
+
835
+ Examples:
836
+ - ``#mess This is a test line`` : Use a pop-up window to display "This is a test line".
837
+ - ``#mess %line`` : Use a pop-up window to display the value of the system variable %line.
838
+ ''',
839
+
840
+ "handle_disconnect" :
841
+ '''
842
+ The execution function of the embedded commands #disconnect / #dis, used to disconnect from the remote server (only effective when the remote server is already connected).
843
+ This function should not be called directly in the code.
844
+
845
+ Related commands:
846
+ - #connect
847
+ - #close
848
+ ''',
849
+ }
850
+ },
851
851
  }