Lineage 2 Tower Forum

Full Version: catch "screen text"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I tried to capture "screen text" but I have not succeeded.

Try a logger but not obtube any "display text", only the text of the system.

Any idea how to do it?

thanks

    LUA Programming
LogON = false;
 
function OnCreate()
	this:RegisterCommand("loog", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;
 
function OnCommand_loog(vCommandChatType, vNick, vCommandParam)
 
	if (LogON == false) then 
 LogON = true;
 ShowToClient("SYS ", "Log system ON"); 
	else
 LogON = false;
 ShowToClient("SYS ", "Log system OFF");
	end;
 
end;
 
function LogMessage(message)
	local file = io.open(GetDir() .. "\\MyLog.txt", "r");
	if (file == nil) then
 file = io.open(GetDir() .. "\\MyLog.txt", "w");
	end;
 file:close();
	file = io.open(GetDir() .. "\\MyLog.txt", "a+");
	file:write('['..os.date()..']'..message..'\n');
	file:close();
end;
 
function OnChatSystemMessage(id, msg)
	--Event called some system message show up on chat (id - integer, msg - string).
 
	if (LogON == true) then 
 LogMessage(id .. " - " .. msg);
	end;
 
end;

Reference URL's