Файл:Imbox deletion.png Внимание! Начат процесс обновления Wiki до версии игры 10.x. Если у Вас есть желание принять участие, то Вы можете найти больше информации в нашем ECO Contribution Wiki Discord.

Модуль:ChatCommandslist

Материал из Eco - Русская Wiki
Перейти к:навигация, поиск

Для документации этого модуля может быть создана страница Модуль:ChatCommandslist/doc

local p = {}

function p.main()
	local wiki = ''

	-- import the required modules
	local commandsData = require( "Module:CommandData" )	
	
	local commands = commandsData.commands

	-- create the header of the table
	local header = "<table class=\"wikitable sortable\"> \n " 
	header = header .. "<tr> \n "
	header = header .. "<th>Уровень<br>доступа</th> \n "
	header = header .. "<th>Категория</th> \n "
	header = header .. "<th>Команда</th> \n "
	header = header .. "<th>Быстрый вызов</th> \n "
	header = header .. "<th>Описание</th> \n "
	header = header .. "<th>Аргументы</th> \n "
	header = header .. "</tr> \n "
	
	wiki = header

	for k,v in pairs(commands) do
		local row = ''
		row = row .. "<tr> \n "

		if (v.parent == '') then v.parent = '' end
		if (v.parameters == '') then v.parameters= '' end

			row = row .. "<td>" .. v.level.. " </td> \n"
			row = row .. "<td>" .. v.parent.. " </td> \n"
			row = row .. "<td>" .. v.command.. " </td> \n"
			row = row .. "<td>" .. v.shortCut.. " </td> \n"
			row = row .. "<td>" .. v.helpText.. " </td> \n"
			row = row .. "<td></td> \n"

		row = row .. "</tr>"
	wiki = wiki .. row
	end

	wiki = wiki .. " </table>"
	return wiki
	end

return p