|
嗯,点击是用的hylink,然后^rt\s(.*)$的alias都能误触那是过于诡异了。。
本来做好就打算发的,只是因win10被挂起的3天前的更新导致莫名出错,各种检查不出来,直到发现更新挂起重启后就好了。。白白的完全重写了寻路模块。。
由于缩写要调用了fristword,所以fistwords.lua需要requrie
至于用处么。。因为是直接调用的rooms库,不是每处都能去,不过查询地图和房间所属区域情况倒是方便了点。。
其实这玩意没什么大用,真正有点用的是theones.lua
使用
在rooms.lua里找到以下function修改
--------------rooms.lua
-- function getFirstWords()
-- require("firstwords")
-- return FirstWords
-- end
上面可以注掉,因为嫌麻烦,firstwords被我改成fstwds了=。=
function getFirstWord(word)
if not word then
return ""
end
local oneb
local fws = {}
local f=0
for i=1,#word do
oneb = string.sub(word,1+(f*1),2+f)
table.insert(fws,fstwds[oneb])
f=f+2
end
return table.concat(fws)
end
function Room(room)
local r = SjRoom:new(room)
local group = string.find(r.id, "group/")
if group == 1 then
r.nolook = true
end
local ab = getFirstWord(r.name) ----添加abbr:缩写
if ab then
r.abbr = ab
end
map:addRoom(r)
end
------------------------------------------
然后随便哪个加载了的lua文件加上
require "firstwords" --- 缩写库
require "theones" ---- 唯一房间库
require "runto" --- 本体
theones.lua ---- 剥离出来的唯一房间,以及目标城市内的唯一房间库,runto.lua有个指令 isone('城市','房间名')
如果是唯一房间,或城市内唯一房间名,返回id,area,room
比如
if isone(dest.area,dest.room)~=nil then
sour.id,sour.area,sour.room=isone(locl.area,locl.room)
end
以上
lua.rar
(90.38 KB, 下载次数: 31)
|
|