Moduł:Protokół serwerowy: Różnice pomiędzy wersjami

Z Minecraft Wiki Polska
Przejdź do nawigacji Przejdź do wyszukiwania
[wersja nieprzejrzana][wersja nieprzejrzana]
dNie podano opisu zmian
dNie podano opisu zmian
Linia 13: Linia 13:
end
end
end
end
result = '| ' .. argv[3] .. '\n';
local result = '';
if argc == 3 or argc > 3
if argc == 3 or argc > 3
then
then
result = '| ' .. argv[3] .. '\n';
for i=1,argv[2]
if argc > 3
do
then
local value = argv[i+2];
for i=1,argv[2]-1
local color = 'nieznane';
do
local colorID = string.byte(value);
local value = argv[i+3];
if colorID == 114
local color = 'nieznane';
then
local colorID = string.byte(value);
color = 'tak';
if colorID == 114
then
color = 'tak';
end
if colorID == 110
then
color = 'nie';
end
if colorID == 111
then
color = 'neutral';
end
if colorID == 99
then
color = 'częściowo';
end
if colorID == 98
then
color = 'planowane';
end
result = result .. '|-\n| {{tc|' .. color .. '}}\n';
end
end
if colorID == 110
then
color = 'nie';
end
if colorID == 111
then
color = 'neutral';
end
if colorID == 99
then
color = 'częściowo';
end
if colorID == 98
then
color = 'planowane';
end
result = result .. '|-\n| {{tc|' .. color .. '}}\n';
end
end
end
end
return result;
return result:match "^%s*(.-)%s*$";
end
end


return obj;
return obj;

Wersja z 18:49, 29 kwi 2016

[ utwórz | historia | odśwież ]Dokumentacja
W tym module nie ma dokumentacji. Jeśli wiesz jak używać tego modułu, proszę, podaj odpowiednie informacje.
local obj = {}

obj.wersja = function(data)
	local parent = data:getParent();
	local argv = parent.args;
	local argc = table.getn(argv);
	if argc == 0
	then
		for i,value in ipairs(argv)
		do
			argc = argc+1;
			argv[i] = value;
		end
	end
	local result = '';
	if argc == 3 or argc > 3
	then
		for i=1,argv[2]
		do
			local value = argv[i+2];
			local color = 'nieznane';
			local colorID = string.byte(value);
			if colorID == 114
			then
				color = 'tak';
			end
			if colorID == 110
			then
				color = 'nie';
			end
			if colorID == 111
			then
				color = 'neutral';
			end
			if colorID == 99
			then
				color = 'częściowo';
			end
			if colorID == 98
			then
				color = 'planowane';
			end
			result = result .. '|-\n| {{tc|' .. color .. '}}\n';
		end
	end
	return result:match "^%s*(.-)%s*$";
end

return obj;