-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCORE 04 - Help Menu - HELP.txt
103 lines (60 loc) · 15.1 KB
/
CORE 04 - Help Menu - HELP.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
@@ DEPENDENCIES - CORE
th u(NEWCOBJ,Help Management System <HELP>,help,,,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
&CMD`+HELP`PENNMUSH [u(cobj,help)]=$^(?s)(?\:\+)?(help|shelp|news)(?\:/(\S+)?)?(?\: +(.+?))?(?\:/(.+?))?(?\:/(.+?))?(?\:=(.+?))?$:@attach %!/CMD`+HELP`MAIN
@set [u(cobj,help)]/CMD`+HELP`PENNMUSH=regexp
&CMD`+HELP`RHOSTMUSH [u(cobj,help)]=$^(?s)(?\:\+)?(help|shelp|news)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:/(.+?))?(?\:/(.+?))?(?\:=(.+?))?$:@attach %!/CMD`+HELP`MAIN
@set [u(cobj,help)]/CMD`+HELP`RHOSTMUSH=regexp
&CMD`+HELP`MAIN [u(cobj,help)]=@attach %!/INC`GETSWITCH=%2;@attach %!/INC`INIT`%1;th u(setq,accid,u(strfirstof,u(accid,%#),%#));@attach %!/INC`[u(strfirstof,%q<switch>,MAIN)]=trim(%3),trim(%4),trim(%5),trim(%6),%1
@set [u(cobj,help)]/CMD`+HELP`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&INC`INIT`HELP [u(cobj,help)]=th [u(setq,disp,mudname() Help Files)][u(setq,comm,+help)][u(setq,db,0)][u(setq,sysname,HELP)]
&INC`INIT`SHELP [u(cobj,help)]=th [u(setq,disp,mudname() Staff Help Files)][u(setq,comm,+shelp)][u(setq,db,1)][u(setq,sysname,SHELP)];@check u(isadmin,%#)=@attach %!/INC`MSG=Permission Denied.
&INC`INIT`NEWS [u(cobj,help)]=th [u(setq,disp,mudname() News Files)][u(setq,comm,+news)][u(setq,db,2)][u(setq,sysname,NEWS)]
&SYSTEM`NAME [u(cobj,help)]=u(strfirstof,%q<sysname>,HELP)
&SWITCHES`PLAYER [u(cobj,help)]=
&SWITCHES`ADMIN [u(cobj,help)]=HELP|NEWCATEGORY|DELETECATEGORY|RENAMECATEGORY|CATEGORY|ADD|RENAME|DELETE|GET|ADDSUB|RENAMESUB|DELETESUB|VIEWCODE
&INC`NEWCATEGORY [u(cobj,help)]=@check strlen(%0)=@attach %!/INC`MSG=ERROR: Must enter a Category name.;@check u(setr,cat_id,u(call`2,volp_help_category,0,%q<db>,'[sqlescape(%0)]'))=@attach %!/INC`MSG=ERROR: %q<cat_id>;@attach %!/INC`MSG`CHAN=New Category: %0
&INC`FINDCATEGORY [u(cobj,help)]=@check strlen(%0)=@attach %!/INC`MSG=ERROR: Must enter a category name!;@check u(setr,u(strfirstof,%5,cat_id),u(mysql,FIND`CATEGORY_EXACT,%q<db>,%0))=@attach %!/INC`MSG=ERROR: Category '%0' not found.;th u(setq,catname,u(mysql,SELECT`CATEGORY_NAME,%q<cat_id>))
&INC`RENAMECATEGORY [u(cobj,help)]=@attach %!/INC`FINDCATEGORY=%0;@check strlen(%3)=@attach %!/INC`MSG=ERROR: Must enter a replacement Category name!;@select/inline t(u(setr,exist_id,u(mysql,FIND`CATEGORY_EXACT,%q<db>,%3)))=1,{@attach %!/INC`DOSQL=REASSIGN`FILES,%q<exist_id>,%q<cat_id>;@attach %!/INC`DOSQL=DELETE`CATEGORY,%q<cat_id>},0,{@attach %!/INC`DOSQL=RENAME`CATEGORY,%3,%q<cat_id>};@attach %!/INC`MSG=Renamed Category '%q<catname>' to: %3;@attach %!/INC`MSG`CHAN=Renamed Category '%q<catname>' to: %3
&Q`FIND`CATEGORY_EXACT [u(cobj,help)]=SELECT help_category_id FROM vol_help_category WHERE help_category_type=? AND help_category_name=?
&Q`SELECT`CATEGORY_NAME [u(cobj,help)]=SELECT help_category_name FROM vol_help_category WHERE help_category_id=?
&Q`RENAME`CATEGORY [u(cobj,help)]=UPDATE vol_help_category SET help_category_name=? WHERE help_category_id=?
&Q`REASSIGN`FILES [u(cobj,help)]=UPDATE vol_help_file SET help_category_id=? WHERE help_category_id=?
&Q`DELETE`CATEGORY [u(cobj,help)]=DELETE FROM vol_help_category WHERE help_category_id=?
&INC`DELETECATEGORY [u(cobj,help)]=@attach %!/INC`FINDCATEGORY=%0;@attach %!/INC`VERIFY={[ansi(hr,WARNING:)] This will Delete Category '%q<catname>' and ALL ASSOCIATED FILES/SUBFILES. Are you SURE? Enter the same command again to verify!},DELETE HELPCAT %q<db> %q<cat_id>;@attach %!/INC`DOSQL=DELETE`CATEGORY,%q<cat_id>;@attach %!/INC`MSG=Deleted Category '%q<catname>'!;@attach %!/INC`MSG`CHAN=Deleted Category '%q<catname>'!
&INC`ADD [u(cobj,help)]=@check strlen(%1)=@attach %!/INC`MSG=ERROR: What's the file name?;@check strlen(%3)=@attach %!/INC`MSG=ERROR: File needs contents darnit!;@attach %!/INC`NEWCATEGORY=%0;@check u(setr,file_id,u(call`2,volp_help_file,0,%q<cat_id>,'[sqlescape(%1)]'))=@attach %!/INC`MSG=ERROR: %q<file_id>;@attach %!/INC`FILLFILE=%3,%q<file_id>;@attach %!/INC`MSG=Help File '%1' Created/Updated!;@attach %!/INC`MSG`CHAN=Added/Replaced File: %1
&INC`ADDSUB [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0;th u(setr,load,u(mysql3,LOAD`FILE,%q<file_id>));@check strlen(%1)=@attach %!/INC`MSG=ERROR: What's the sub-filename?;@check strlen(%3)=@attach %!/INC`MSG=ERROR: A helpfile must have contents!;@check u(setr,sub_id,u(call`2,volp_help_sub,0,%q<file_id>,'[sqlescape(%1)]'))=@attach %!/INC`MSG=ERROR: %q<sub_id>;@attach %!/INC`FILLFILE=%3,%q<sub_id>;@attach %!/INC`MSG=Sub-Help File '[u(elements,%q<load>,3,u(fsep))]/%1' Created/Updated!;@attach %!/INC`MSG`CHAN=Added/Replaced Sub-File: [u(elements,%q<load>,3,u(fsep))]/%1
&INC`FILLFILE [u(cobj,help)]=th u(setq,fulltext,%0);@select/inline isdbref(before(%q<fulltext>,/))=1,{@check cand(strlen(u(setr,rendertext,u(%q<fulltext>,1))),not(strmatch(%q<rendertext>,#-*)))=@attach %!/INC`MSG=ERROR: Cannot convert this DBREF/ATTRIBUTE.;th u(setq,isdbref,1)},0,{th u(setq,isdbref,0);th u(setq,rendertext,%q<fulltext>)};th u(setq,plaintext,stripansi(%q<rendertext>));th u(setq,squishtext,squish(squish(%q<plaintext>,%R)));@dolist/inline/delimit | help_file_dbattr~isdbref|help_file_text~fulltext|help_file_plaintext~plaintext|help_file_squished~squishtext={@attach %!/INC`DOSQL=UPDATE`FILE,before(##,~),r(after(##,~)),%1};
&Q`UPDATE`FILE [u(cobj,help)]=UPDATE vol_help_file SET !=? WHERE help_file_id=?
&INC`MAIN [u(cobj,help)]=@select/inline t(strlen(%0))[t(strlen(%1))]=00,{@attach %!/INC`SHOW`ALL},10,{@attach %!/INC`SHOW`TOPIC},11,{@attach %!/INC`SHOW`SUB}
&FUN`CATEGORIES [u(cobj,help)]=u(mysql3,SELECT`CATEGORIES,%0)
&Q`SELECT`CATEGORIES [u(cobj,help)]=SELECT help_category_id,help_category_name FROM volv_help_category WHERE help_count>0 AND help_category_type=? ORDER BY help_category_name
&FUN`FILES [u(cobj,help)]=u(mysql3,SELECT`FILES,get(%1/D`ID),%0)
&Q`SELECT`FILES [u(cobj,help)]=SELECT h.help_file_id,h.help_file_name,h.help_file_date_modified_secs,IF(r.help_read_date_checked IS NOT NULL,UNIX_TIMESTAMP(r.help_read_date_checked),0) AS help_read_date_checked_secs FROM volv_help_file AS h LEFT JOIN vol_help_read AS r ON h.help_file_id=r.help_file_id AND r.character_id=? WHERE h.help_category_id=? AND h.help_file_parent_id IS NULL
&FUN`SUBFILES [u(cobj,help)]=u(mysql3,SELECT`SUBFILES,get(%1/D`ID),%0)
&Q`SELECT`SUBFILES [u(cobj,help)]=SELECT h.help_file_id,h.help_file_name,h.help_file_date_modified_secs,IF(r.help_read_date_checked IS NOT NULL,UNIX_TIMESTAMP(r.help_read_date_checked),0) AS help_read_date_checked_secs FROM volv_help_file AS h LEFT JOIN vol_help_read AS r ON h.help_file_id=r.help_file_id AND r.character_id=? WHERE h.help_file_parent_id=?
&INC`SHOW`ALL [u(cobj,help)]=@pemit %#=u(header,%q<disp>);@dolist/inline/delimit [u(rsep)] [u(FUN`CATEGORIES,%q<db>)]={th u(setq,hdat,u(choosegame,%i0,%d0));@pemit %#=u(separator,u(capnames,u(elements,%q<hdat>,2,u(fsep))));@pemit %#=u(table,iter(u(FUN`FILES,u(elements,%q<hdat>,1,u(fsep)),%#),u(FUN`FORMATFILE,%i0),u(rsep),|),37,u(width,%#),|)};@pemit %#=u(separator)%R%TFor more information on the listed topics, please use '[ansi(h,lcstr(%q<comm>) <topic>)]'[if(u(isadmin,%#),%R%TAdmin\, please see [u(pueblize,ansi(h,lcstr(%q<comm>)/help),lcstr(%q<comm>)/help)] for config information.)];@pemit %#=u(footer)
&Q`SELECT`UNREADSUB [u(cobj,help)]=SELECT COUNT(*) FROM volv_help_file AS h LEFT JOIN vol_help_read AS r ON r.help_file_id=h.help_file_id AND r.character_id=? WHERE h.help_file_parent_id=? AND (r.help_read_date_checked IS NULL OR r.help_read_date_checked<h.help_file_date_modified)
&FUN`FORMATFILE [u(cobj,help)]=localize(ljust(u(pueblize,ansi(h,u(setr,name,u(elements,%0,2,u(fsep)))),[lcstr(%q<comm>)] [if(strlen(%1),%1/)]%q<name>),25)[rjust(u(FUN`HAVEREAD,gt(u(elements,%0,3,u(fsep)),u(elements,%0,4,u(fsep))),if(%2,u(mysql,SELECT`UNREADSUB,get(%#/D`ID),u(elements,%0,1,u(fsep))),0)),1)][u(date,u(elements,%0,3,u(fsep)),%#)])
&FUN`HAVEREAD [u(cobj,help)]=if(%0,ansi(hr,*),if(%1,ansi(y,&),%b))
&INC`FINDMAIN [u(cobj,help)]=@check strlen(%0)=@attach %!/INC`MSG=ERROR: File name segment empty.;@select/inline t(%1)=0,{@check cor(u(setr,exact,u(mysql3,FIND`EXACT_FILE,%q<db>,%0)),if(gte(strlen(%0),4),u(setr,likename,u(mysql3,FIND`LIKE_FILE,%q<db>,sqlescape(%0)))))=@attach %!/INC`MSG=ERROR: NO file named '%0'.;th u(setq,file_id,u(elements,u(strfirstof,%q<exact>,%q<likename>),1,u(fsep)))},1,{@check cor(u(setr,exact,u(mysql3,FIND`EXACT_FILE,%q<db>,%0)),if(gte(strlen(%0),4),u(setr,likename,u(mysql3,FIND`LIKE_FILE,%q<db>,sqlescape(%0)))))=@attach %!/INC`MSG=ERROR: No file named '%0'. Suggestions from Contents Search: [u(strfirstof,iter(u(mysql3,FIND`FILE_CONTAINS,%q<db>,sqlescape(%0)),u(pueblize,ansi(h,u(setr,name,[if(strlen(u(elements,%i0,3,u(fsep))),u(elements,%i0,3,u(fsep))/)][u(elements,%i0,2,u(fsep))])),[lcstr(%q<comm>)] %q<name>),u(rsep),\,%b),None)];th u(setq,file_id,u(elements,u(strfirstof,%q<exact>,%q<likename>),1,u(fsep)))};th u(setr,file_load,u(mysql3,LOAD`FILE,%q<file_id>));
&Q`FIND`EXACT_FILE [u(cobj,help)]=SELECT help_file_id,help_file_name FROM volv_help_file WHERE help_category_type=? AND help_file_name=? AND help_file_parent_id IS NULL
&Q`FIND`LIKE_FILE [u(cobj,help)]=SELECT help_file_id,help_file_name FROM volv_help_file WHERE help_category_type=? AND help_file_parent_id IS NULL AND help_file_name LIKE '!%' ORDER BY help_file_name ASC,CHAR_LENGTH(help_file_name) ASC LIMIT 1
&Q`FIND`FILE_CONTAINS [u(cobj,help)]=SELECT h.help_file_id,h.help_file_name,s.help_file_name AS parent_file_name FROM volv_help_file AS h LEFT JOIN volv_help_file AS s ON h.help_file_parent_id=s.help_file_id WHERE h.help_category_type=? AND h.help_file_squished LIKE '%!%' ORDER BY h.help_file_name
&INC`FINDSUB [u(cobj,help)]=@check cor(u(setr,exact,u(mysql3,FIND`EXACT_SUB,%q<file_id>,%0)),if(gte(strlen(%0),4),u(setr,likename,u(mysql3,FIND`LIKE_SUB,%q<file_id>,sqlescape(%0)))))=@attach %!/INC`MSG=ERROR: NO file named '%0'.;th u(setq,sub_id,u(elements,u(strfirstof,%q<exact>,%q<likename>),1,u(fsep)));th u(setr,load_sub,u(mysql3,LOAD`FILE,%q<sub_id>));
&Q`FIND`EXACT_SUB [u(cobj,help)]=SELECT help_file_id,help_file_name FROM volv_help_file WHERE help_file_parent_id=? AND help_file_name=?
&Q`FIND`LIKE_SUB [u(cobj,help)]=SELECT help_file_id,help_file_name FROM volv_help_file WHERE help_file_parent_id=? AND help_file_name LIKE '!%' ORDER BY help_file_name ASC,CHAR_LENGTH(help_file_name) ASC LIMIT 1
&INC`SHOW`TOPIC [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0,1;@pemit %#=u(header,%q<comm>: [u(setr,name,u(elements,%q<file_load>,3,u(fsep)))]);@select/inline t(u(elements,%q<file_load>,4,u(fsep)))=1,{@pemit %#=u(u(elements,%q<file_load>,5,u(fsep)))},0,{@pemit %#=u(elements,%q<file_load>,5,u(fsep))};@select/inline words(u(setr,subs,u(FUN`SUBFILES,%q<file_id>,%#)),u(rsep))=>0,{@pemit %#=u(subheader,Subfiles)%R%TTo read subfiles, use '[ansi(h,%q<comm> %q<name>/<file>)]';@pemit %#=u(table,iter(%q<subs>,u(FUN`FORMATFILE,%i0,%q<name>),u(rsep),|),37,u(width,%#),|)};@pemit %#=u(footer);@attach %!/INC`DOSQL=UPDATE`READ,get(%#/D`ID),%q<file_id>
&Q`LOAD`FILE [u(cobj,help)]=SELECT help_file_id,help_category_name,help_file_name,help_file_dbattr,help_file_text,sub_file_count FROM volv_help_file_load WHERE help_file_id=?
&Q`UPDATE`READ [u(cobj,help)]=INSERT INTO vol_help_read(character_id,help_file_id,help_read_date_checked) VALUES (?,?,UTC_TIMESTAMP()) ON DUPLICATE KEY UPDATE help_read_date_checked=UTC_TIMESTAMP()
&INC`SHOW`SUB [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0;@attach %!/INC`FINDSUB=%1;@pemit %#=u(header,%q<disp>: [u(elements,%q<file_load>,3,u(fsep))]/[elements(%q<load_sub>,3,u(fsep))]);@select/inline t(elements(%q<load_sub>,4,u(fsep)))=1,{@pemit %#=u(elements(%q<load_sub>,5,u(fsep)))},{@pemit %#=elements(%q<load_sub>,5,u(fsep))};@pemit %#=u(footer);@attach %!/INC`DOSQL=UPDATE`READ,get(%#/D`ID),%q<sub_id>
&INC`RENAME [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0;@stop strmatch(%3,*/*)=@attach %!/INC`MSG=ERROR: Helpfile names cannot contain a /.;@stop u(setr,exist_id,u(mysql,FIND`EXACT_FILE,%q<db>,%3))=@attach %!/INC`MSG=ERROR: Helpfile of that name already exists.;@attach %!/INC`DOSQL=RENAME`FILE,%3,%q<file_id>;@attach %!/INC`MSG=File Renamed to '%3'!;@attach %!/INC`MSG`CHAN=Renamed File '[elements(%q<file_load>,3,u(fsep))]' to: %3
&Q`RENAME`FILE [u(cobj,help)]=UPDATE vol_help_file SET help_file_name=?,help_file_date_modified=UTC_TIMESTAMP() WHERE help_file_id=?
&Q`DELETE`FILE [u(cobj,help)]=DELETE FROM vol_help_file WHERE help_file_id=?
&INC`RENAMESUB [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0;@attach %!/INC`FINDSUB=%1;@check strmatch(%3,*/*)=@attach %!/INC`MSG=ERROR: Helpfile names cannot contain a /.;@check u(setr,exist_id,u(mysql,FIND`EXACT_SUB,%q<file_id>,%3))=@attach %!/INC`MSG=ERROR: Helpfile of that name already exists.;@attach %!/INC`DOSQL=RENAME`FILE,%3,%q<sub_id>;@attach %!/INC`MSG=Sub-File Renamed to '%3'!;@attach %!/INC`MSG`CHAN=Renamed File '[elements(%q<file_load>,3,u(fsep))]/[elements(%q<load_sub>,3,u(fsep))]' to: %3
&INC`DELETE [u(Cobj,help)]=@attach %!/INC`FINDMAIN=%0;@attach %!/INC`VERIFY={[ansi(hr,WARNING:)] Helpfile and all subfiles will be deleted. Are you sure? Enter the same command again to verify.},DELETE HELP %q<db> %q<file_id>;@attach %!/INC`DOSQL=DELETE`FILE,%q<file_id>;@attach %!/INC`MSG=File deleted!;@attach %!/INC`MSG`CHAN=Deleted File '[elements(%q<file_load>,3,u(fsep))]'
&INC`DELETESUB [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0;@attach %!/INC`FINDSUB=%1;@attach %!/INC`VERIFY={[ansi(hr,WARNING:)] Helpfile and all subfiles will be deleted. Are you sure? Enter the same command again to verify.},DELETE HELPSUB %q<sub_id>;@attach %!/INC`DOSQL=DELETE`FILE,%q<sub_id>;@attach %!/INC`MSG=Sub-File Renamed to '%3'!;@attach %!/INC`MSG`CHAN=Renamed File '[elements(%q<file_load>,3,u(fsep))]/[elements(%q<load_sub>,3,u(fsep))]' to: %3
&INC`VIEWCODE [u(cobj,help)]=@select/inline t(strlen(%0))[t(strlen(%1))]=10,{@attach %!/INC`GET`FILE},11,{@attach %!/INC`GET`SUB},{@attach %!/INC`MSG=ERROR: What are you retrieving?}
&INC`GET`FILE [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0;@pemit %#=if(elements(%q<file_load>,4,u(fsep)),elements(%q<file_load>,5,u(fsep)),u(decompose,elements(%q<file_load>,5,u(fsep))))
&INC`GET`SUB [u(cobj,help)]=@attach %!/INC`FINDMAIN=%0;@attach %!/INC`FINDSUB=%1;@pemit %#=if(elements(%q<load_sub>,4,u(fsep)),elements(%q<load_sub>,5,u(fsep)),decompose(elements(%q<load_sub>,5,u(fsep))))
&INC`HELP [u(cobj,help)]=@pemit %#=u(header,Staff %q<comm> Commands);@pemit %#=[ansi(hc,Administrator Commands)]%R[align(5 [sub(u(width,%#),6)],,u(HLP`INTERNAL))];@pemit %#=u(footer)
&HLP`INTERNAL [u(cobj,help)]=[ansi(h,%q<comm>/add <category>/<filename>=<text>)] - Creates or update a helpfile AND the respective category if it does not exist. If <text> is #DBREF/ATTRIBUTE format\, the given attribute will be u()'d for retrieval.%R[ansi(h,%q<comm>/addsub <filename>/<subfilename>=<text>)] - Create or update a sub-helpfile. Works like /add.%R[ansi(h,%q<comm>/category <filename>=<category>)] - Re-Assign a helpfile to a different category.%R[ansi(h,%q<comm>/renamecategory <category>=<new name>)] - Re-assign all helpfiles of a given category to a new or existing one.%R[ansi(h,%q<comm>/rename <filename>)]=<newname> - Rename a file.%R[ansi(h,%q<comm>/renamesub <filename>/<subfilename>)]=<newname> - Rename a subfile.%R[ansi(h,%q<comm>/deletecategory <category>)] - Delete a category and all associated files.%R[ansi(h,%q<comm>/delete <filename>)] - Delete a helpfile and all subfiles.%R[ansi(h,%q<comm>/deletesub <filename>/<subfilename>)] - Delete a sub-helpfile.