2016-09-05 21:43:17 -05:00
|
|
|
local dat = {}
|
2022-06-25 04:57:24 +10:00
|
|
|
|
2016-09-05 21:43:17 -05:00
|
|
|
local info, ver
|
2022-06-25 04:57:24 +10:00
|
|
|
local datread = require('data/load_dat')
|
2016-11-09 08:25:54 -06:00
|
|
|
do
|
2019-11-29 10:17:34 -06:00
|
|
|
local buttonchar
|
|
|
|
|
local function convert(str)
|
2022-06-25 04:57:24 +10:00
|
|
|
if not buttonchar then
|
|
|
|
|
buttonchar = require("data/button_char")
|
|
|
|
|
end
|
2019-11-29 10:17:34 -06:00
|
|
|
return buttonchar(str)
|
|
|
|
|
end
|
2022-06-25 04:57:24 +10:00
|
|
|
datread, ver = datread.open('command.dat', '#[^V]*Ver[^.:]*[.:]', convert)
|
2016-11-09 08:25:54 -06:00
|
|
|
end
|
2016-09-05 21:43:17 -05:00
|
|
|
|
|
|
|
|
function dat.check(set, softlist)
|
|
|
|
|
if softlist or not datread then
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
local status
|
2022-06-25 04:57:24 +10:00
|
|
|
status, info = pcall(datread, 'cmd', 'info', set)
|
2016-09-05 21:43:17 -05:00
|
|
|
if not status or not info then
|
|
|
|
|
return nil
|
|
|
|
|
end
|
2022-06-25 04:57:24 +10:00
|
|
|
return _p('plugin-data', 'Command')
|
2016-09-05 21:43:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function dat.get()
|
|
|
|
|
return info
|
|
|
|
|
end
|
|
|
|
|
|
2017-07-27 22:14:09 -05:00
|
|
|
function dat.ver()
|
|
|
|
|
return ver
|
|
|
|
|
end
|
|
|
|
|
|
2016-09-05 21:43:17 -05:00
|
|
|
return dat
|