|
贴个找财神埋金地点的东东,需要数据库支持
-
- function CSBegin() {
- cTrigger("CS01", "^[>]*\\s*【江湖传闻】风水大师预言说在某处地下埋藏了大量黄金,似乎是:$", "", "etri");
- cTrigger("CS02", "^(.*)$", "", "parseInfo");
- EnableTrigger("CS02",false);
- SetVariable("cs_info","");
- }
- function etri(name, line, wildcards) {
- EnableTrigger("CS02", true);
- SetVariable("cs_info","");
- cTrigger_temp("CS03", "^[>]*\\s*【谣言】某人:(.*)挖到了满满一坛黄金!", "", "getGold");
- }
- function getGold(name, line, wildcards) {
- var wcs = VBArray(wildcards).toArray();
- SetVariable("cs_getter",wcs[0] + "::" + now());
- }
- function parseInfo(name, line, wildcards) {
- var wcs = VBArray(wildcards).toArray();
- var info = wcs[0];
- var txt = GetVariable("cs_info");
- if (info.indexOf("□") == -1) {
- EnableTrigger("cs02",false);
- SetVariable("cs_info",Trim(txt.replace(/□/g,"%")));
- findGold(GetVariable("cs_info"));
- } else {
- SetVariable("cs_info",txt + info);
- }
- }
- function findGold(obj) {
- var reg1 = /[\s|,|,|.|。|;|;|:|:|"|“|”|\'|‘|’|!|!]/;//去除标点,可自行添加
- var reg2 = /%%/;//将连续两个%合为一个
- obj = obj.replaceall(reg1,"%").replaceall(reg2,"%");
- var txt = "";
- var sql = "select [id],[zone],[room],[npc],[description] from maps "
- + "where [description] like '" + obj + "'";
- mydb = new db(GetInfo(57) + "\\pkuxkx.mdb");
- mydb.connection();
- var rs = mydb.getdata(sql);
- if (!rs.eof) {
- while (!rs.eof) {
- txt += "风水大师预言说在区域【" + rs.Fields("zone") + "】,房间【" + rs.Fields("room") + "】,"
- + "旁边有NPC【" + rs.Fields("npc") + "】的地方,埋藏了大量黄金。(digmoney)\t";
- rs.moveNext;
- }
- }
- mydb.close();
- if (txt == "") {
- note("没有找到财宝的埋藏处!");
- } else {
- Send("tell " + GetVariable("a_id") + " " + txt);
- //Send("chat " + txt);
- alert(txt);
- }
- }
复制代码 |
|