liongk
Expired VIP Member
Posts: 9
Joined: Apr 2014
Reputation: 0
Version:
1.4.3.143
|
Show specific line from html text
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.
|
|
07-11-2015 10:37 AM |
|
liongk
Expired VIP Member
Posts: 9
Joined: Apr 2014
Reputation: 0
Version:
1.4.3.143
|
RE: Show specific line from html text
With Gethtml plugin
With Gethtml plugin
With Gethtml plugin
(This post was last modified: 07-11-2015 10:55 AM by liongk.)
|
|
07-11-2015 10:54 AM |
|
TheQQmaster
Trolling the Trolls
Posts: 1,532
Joined: Jun 2012
Reputation: 642
Version:
1.4.2.133
|
RE: Show specific line from html text
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;
PUSH IF HELPED
(This post was last modified: 07-11-2015 20:01 PM by TheQQmaster.)
|
|
07-11-2015 10:57 AM |
|
liongk
Expired VIP Member
Posts: 9
Joined: Apr 2014
Reputation: 0
Version:
1.4.3.143
|
RE: Show specific line from html text
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
|
|
07-11-2015 16:09 PM |
|