|
有兴趣的自己研究,本人不负责解释,嘿嘿
首先把dcl提供的地图mdb文件放在C:\Program Files\MUSHclient\worlds\目录下,名称是map.mdb
其次在trigger中添加如下trigger:
enabled="y"
match="【江湖传闻】风水大师预言说在某处地下埋藏了大量黄金,似乎是:"
send_to="12"
sequence="100"
>
FindTreasure1()
在脚本中添加如下脚本:
function FindTreasure(strKeywords)
{
var sqlstr=new String();
var TreasurePlace="";
if (strKeywords=="") return false;
var con = new ActiveXObject("ADODB.Connection");
con.Provider = "Microsoft.Jet.OLEDB.4.0";
con.ConnectionString = "Data Source=C:\\Program Files\\MUSHclient\\worlds\\map.mdb"
sqlstr="SELECT [num], [zone], [room], [describe] FROM [pkuxkx] WHERE 1=1 ";
sqlstr=sqlstr+" and [describe] like '"+strKeywords+"'";
world.note(sqlstr);
con.open;
var rs = new ActiveXObject("ADODB.Recordset");
rs.open(sqlstr, con);
//world.note(rs.count);
if(!rs.eof)
while (!rs.eof)
{
TreasurePlace="天降财神的地点似乎是在"+rs.Fields("zone")+"的"+rs.Fields("room")+",大家赶紧去挖啊!\n";
rs.moveNext;
}
if (TreasurePlace!="")
{
world.send("hslj "+TreasurePlace);
}
rs.close();
rs = null;
}
function FindTreasure1()
{
var line = world.GetLinesInBufferCount();
DoAfterSpecial(0.1,"FindTreasure2("+line+")",12);
}
function FindTreasure2(line)
{
var s = new String;
var sKW=new String;
sKW="%%";
for(var i = 0 ; i < 1; i++)
s += world.GetLineInfo(line+1+i,1);
var s1 = s.split("□");
for(i = 0 ; i < s1.length ; i++)
{
if(s1[i] != "")
//send("tell advent "+s1[i]);
sKW = sKW + s1[i] + "%%";
}
FindTreasure(sKW);
} |
|