Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show specific line from html text
Author Message
liongk Offline
Expired VIP Member
**

Posts: 9
Joined: Apr 2014
Reputation: 0
Version: 1.4.3.143
Post: #1
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
Find all posts by this user Quote this message in a reply
TheQQmaster Offline
Trolling the Trolls
*****

Posts: 1,532
Joined: Jun 2012
Reputation: 635
Version: 1.4.2.133
Post: #2
RE: Show specific line from html text

u mean plugin with html dialog ?

or u want to get from npc html dialog?

PUSH [Image: knUu53] IF HELPED
07-11-2015 10:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
liongk Offline
Expired VIP Member
**

Posts: 9
Joined: Apr 2014
Reputation: 0
Version: 1.4.3.143
Post: #3
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
Find all posts by this user Quote this message in a reply
TheQQmaster Offline
Trolling the Trolls
*****

Posts: 1,532
Joined: Jun 2012
Reputation: 635
Version: 1.4.2.133
Post: #4
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 [Image: knUu53] IF HELPED
(This post was last modified: 07-11-2015 20:01 PM by TheQQmaster.)
07-11-2015 10:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
liongk Offline
Expired VIP Member
**

Posts: 9
Joined: Apr 2014
Reputation: 0
Version: 1.4.3.143
Post: #5
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
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Read a HTML game dialog w4rgo 2 1,557 01-19-2015 20:20 PM
Last Post: w4rgo
  Games windows doesn´t show name of char. Blimpador 2 2,389 08-18-2013 10:10 AM
Last Post: koradosani



User(s) browsing this thread: 1 Guest(s)