将模板文件先放入clipboard
然后在贴入当前文件
或者直接
document.selection.Text=也行
clipboardData.setData("BoxText",
"inherit ROOM;\nvoid create()\n{\n //名字\nset(\"short\", \"todo:名字\");\nset(\"long\", @LONG\ntodo:描述\nLONG);\n //属性\nset(\"no_fight\", 1);\nset(\"valid_startroom\", 1);\nset(\"no_sleep_room\",1);\n set(\"no_fight\", 1);\n set(\"no_magic\", 1);\n set(\"no_clean_up\",1);\n set(\"resource\", ([ /* sizeof() == 1 */\n \"water\" : 1,\n])); \n //look指令\nset(\"item_desc\", ([\"paizi\" : \"楼上雅房,每夜一两白银。\n\",\n ]));\n \n //物品\nset(\"objects\", ([__DIR__\"npc/xiaoer1\" : 1,\n \"/d/ourhome/npc/bigeye\" : 1,\n ]));\n \n //出口\n\nset(\"exits\", ([\"east\" : __DIR__\"sleep\",\n \"west\" : __DIR__\"zhuque-s1\",\n \"up\": __DIR__\"kezhanup\",\n ]));\n //创建\nsetup();\n}\n"
)
document.selection.Paste(eeCopyUnicode);
或者
document.selection.Text="inherit ROOM;\nvoid create()\n{\n //名字\nset(\"short\", \"todo:名字\");\nset(\"long\", @LONG\ntodo:描述\nLONG);\n //属性\nset(\"no_fight\", 1);\nset(\"valid_startroom\", 1);\nset(\"no_sleep_room\",1);\n set(\"no_fight\", 1);\n set(\"no_magic\", 1);\n set(\"no_clean_up\",1);\n set(\"resource\", ([ /* sizeof() == 1 */\n \"water\" : 1,\n])); \n //look指令\nset(\"item_desc\", ([\"paizi\" : \"楼上雅房,每夜一两白银。\n\",\n ]));\n \n //物品\nset(\"objects\", ([__DIR__\"npc/xiaoer1\" : 1,\n \"/d/ourhome/npc/bigeye\" : 1,\n ]));\n \n //出口\n\nset(\"exits\", ([\"east\" : __DIR__\"sleep\",\n \"west\" : __DIR__\"zhuque-s1\",\n \"up\": __DIR__\"kezhanup\",\n ]));\n //创建\nsetup();\n}\n"
来源:https://blog.csdn.net/viviliving/article/details/100538878