generated from your-land/yl_template
Replaces /ticker with /chatcommand_domain, minor documentation fixes
This commit is contained in:
parent
24a294498b
commit
93265badce
7
api.lua
7
api.lua
@ -82,8 +82,9 @@ function yl_ticker.formspec(ticker_id)
|
||||
local r = ticker.runtime or "runtime"
|
||||
local p = ticker.param or "param"
|
||||
|
||||
local c = "/ticker_add " .. m .. "$" .. f .. "$" .. r .. "utc"
|
||||
local pa = "/ticker_add " .. p
|
||||
local c = "/" .. yl_ticker.settings.chatcommand_domain .. "_add " .. m ..
|
||||
"$" .. f .. "$" .. r .. "utc"
|
||||
local pa = "/" .. yl_ticker.settings.chatcommand_domain .. "_add " .. p
|
||||
local content = minetest.formspec_escape(
|
||||
c .. "\n\n" .. pa .. "\n\n" .. dump(ticker))
|
||||
local formspec = "formspec_version[6]" .. "size[16,6]" ..
|
||||
@ -108,7 +109,7 @@ function yl_ticker.delete(ticker_id)
|
||||
return false, "Could not retrieve list"
|
||||
end
|
||||
if ((success == true) and (data[ticker_id] == nil)) then
|
||||
return false, "Could not retrieve ticker"
|
||||
return false, "Could not retrieve ticker ID" .. dump(ticker_id)
|
||||
end
|
||||
|
||||
local ticker = table.copy(data[ticker_id]) or "No data available"
|
||||
|
35
internal.lua
35
internal.lua
@ -370,7 +370,7 @@ function yl_ticker.chatcommand_ticker_add(name, param) -- param is a string cont
|
||||
return success, "Ticker ID " .. tostring(ticker_id)
|
||||
end
|
||||
|
||||
function yl_ticker.chatcommand_ticker_copy(name, param) -- param is a numerical a_id
|
||||
function yl_ticker.chatcommand_ticker_copy(name, param) -- param is a numerical ticker_id
|
||||
|
||||
-- defense
|
||||
local player = minetest.get_player_by_name(name)
|
||||
@ -394,7 +394,7 @@ function yl_ticker.chatcommand_ticker_copy(name, param) -- param is a numerical
|
||||
return true, "Copied ticker ID " .. tostring(ticker_id)
|
||||
end
|
||||
|
||||
function yl_ticker.chatcommand_ticker_delete(name, param) -- param is a numerical a_id
|
||||
function yl_ticker.chatcommand_ticker_delete(name, param) -- param is a numerical ticker_id
|
||||
-- defense
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return false, "Player not online" end
|
||||
@ -472,8 +472,9 @@ function yl_ticker.chatcommand_ticker_list_all(name, param) -- param must be emp
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return false, "Player not online" end
|
||||
if param ~= "" then
|
||||
return false, "This command lists all tickers. " ..
|
||||
"Do /ticker_list <ticker_id> if you want to have only one."
|
||||
return false, "This command lists all tickers. " .. "Do /" ..
|
||||
yl_ticker.settings.chatcommand_domain ..
|
||||
"_list <ticker_id> if you want to have only one."
|
||||
end
|
||||
|
||||
local success, data = yl_ticker.list()
|
||||
@ -505,11 +506,13 @@ function yl_ticker.chatcommand_ticker_list_all(name, param) -- param must be emp
|
||||
return true, format_table(f_ticker)
|
||||
end
|
||||
|
||||
function yl_ticker.chatcommand_ticker_list(name, param) -- param is a numerical a_id
|
||||
function yl_ticker.chatcommand_ticker_list(name, param) -- param is a numerical ticker_id
|
||||
-- defense
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return false, "Player not online" end
|
||||
if param == "" then return false, "Ticker ID missing" end
|
||||
if param == "" then
|
||||
return false, "Ticker ID is missing"
|
||||
end
|
||||
local ticker_id = tonumber(param)
|
||||
if type(ticker_id) ~= "number" then
|
||||
return false, "Ticker ID not a number"
|
||||
@ -530,8 +533,10 @@ function yl_ticker.chatcommand_ticker_say_all(name, param) -- param must be empt
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return false, "Player not online" end
|
||||
if param ~= "" then
|
||||
return false, "This command sends all ticker to the main chat. " ..
|
||||
"Do /ticker_say <ticker_id> if you want to send only one."
|
||||
return false,
|
||||
"This command sends all ticker to the main chat. " .. "Do /" ..
|
||||
yl_ticker.settings.chatcommand_domain ..
|
||||
"_say <ticker_id> if you want to send only one."
|
||||
end
|
||||
|
||||
local success, data = yl_ticker.list()
|
||||
@ -549,7 +554,7 @@ function yl_ticker.chatcommand_ticker_say_all(name, param) -- param must be empt
|
||||
|
||||
end
|
||||
|
||||
function yl_ticker.chatcommand_ticker_say(name, param) -- param is a numerical a_id
|
||||
function yl_ticker.chatcommand_ticker_say(name, param) -- param is a numerical ticker_id
|
||||
-- defense
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return false, "Player not online" end
|
||||
@ -570,8 +575,10 @@ function yl_ticker.chatcommand_ticker_help(name, param) -- param must be empty
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return false, "Player not online" end
|
||||
if param ~= "" then
|
||||
return false, "This command displays the help for the ticker. " ..
|
||||
"Do /ticker_help without parameters."
|
||||
return false,
|
||||
"This command displays the help for the ticker. " .. "Do /" ..
|
||||
yl_ticker.settings.chatcommand_domain ..
|
||||
"_help without parameters."
|
||||
end
|
||||
|
||||
local success, message = yl_ticker.display_help()
|
||||
@ -586,8 +593,10 @@ function yl_ticker.chatcommand_ticker_examples(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return false, "Player not online" end
|
||||
if param ~= "" then
|
||||
return false, "This command displays the help for the ticker. " ..
|
||||
"Do /ticker_examples without parameters."
|
||||
return false,
|
||||
"This command displays the help for the ticker. " .. "Do /" ..
|
||||
yl_ticker.settings.chatcommand_domain ..
|
||||
"_examples without parameters."
|
||||
end
|
||||
|
||||
local success, formspecstring = yl_ticker.display_examples()
|
||||
|
Loading…
Reference in New Issue
Block a user