Lineage 2 Tower Forum

Full Version: Show specific line from html text
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Is there any way to showtoclient a specific line from an html dialog that contains a given text?

Take the example:

" This the first line
This is the second line that i want to display that contains the word exaple.

I want to show to client only the line that contains the word "example".

I would really appreciate it, if you could also point me to some documentation. The one from the forum is not very detailed.

Thanks.
u mean plugin with html dialog ?

or u want to get from npc html dialog?
With Gethtml plugin

With Gethtml plugin

With Gethtml plugin
this?
    LUA Programming
--ShowToClient("html dialog",tostring(GetDialogHtml()));
 
HtmlStatus = false;
--------------------------------------------------------------------------------
function OnCreate()
	this:RegisterCommand("html", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;
--------------------------------------------------------------------------------
function OnCommand_html(vCommandChatType, vNick, vCommandParam)
	if (HtmlStatus == false) then
 HtmlStatus = true;
 ShowToClient("Plugin","HTML saveed.");
	end;
end;
--------------------------------------------------------------------------------
function OnLTick1s()
	if(HtmlStatus)then
 local file = io.open(GetDir() .. "html.txt", "w");
 file:write(tostring(GetDialogHtml()).. "\n");
	--	file:write(tostring(HtmlDialog()).. "\n");
 file:close();
 HtmlStatus = false;
	end;
end;



combine

    LUA Programming
function FindSubStringInString(thesub,thestring) 
	for x = 1, 1 + string.len(thestring)-string.len(thesub),1 do
 if (string.sub(thestring,x,x+string.len(thesub)-1) == thesub) then
 return true;
 end;
	end;
	return false;
end;
 
Message = string.lower(tostring(GetDialogHtml())); -- Converts message to lower case letters.
Message = Message:gsub("^%s*(.-)%s*$", "%1"); -- Trimming message of spaces on start.
 
if (Message == "example")then
end;

The problem is, I think, that I cannot call the plugin with variables in the command.

I guess I would need to call FindSubStringInString (lets assume I named the RegisterCommand "mystring"), from the chat line like:

/mystring(example,tostring(GetDialogHtml()))

But this fails
Reference URL's