Page 1 of 1
Plugin to show text from a txt?
Posted: January 18th, 2018, 4:39 pm
by trihy
Hi. Could be possible to make a plugin to show text from inside a txt file?
I have a program doing a log and will be nice to have displayed on screen.
Tried webtxt but doesnt work for local HDD files.
Thanks!
Re: Plugin to show text form a txt?
Posted: January 18th, 2018, 4:56 pm
by dperrow
I'm sure there was one out there, think it was called webtxt. but can't find it now. Should be simple enough though. Have a google for it but if you can't find it let me know and I can knock something up if you spec what you are after in a bit more detail.
Re: Plugin to show text form a txt?
Posted: January 18th, 2018, 5:13 pm
by trihy
dperrow wrote:I'm sure there was one out there, think it was called webtxt. but can't find it now. Should be simple enough though. Have a google for it but if you can't find it let me know and I can knock something up if you spec what you are after in a bit more detail.
Hi, just edited, yes, just tried webxt but doesnt seem to work from a local file.
Tried this:
$dll(webtxt,1,C:\Users\xxxxx\Downloads\lcd_smartie_v5.4.2.92 Beta\test.txt,30#0)
But screen shows nothing and txt contain an entire line of text.
.txt file will always show a single line of text. ie running emulator and game and will show:
"SNES SNOW BROS" without the quotes. And everytime the game launcher close, the text inside the txt file will be cleaned and replaced with the next emulator/game launched.
Thanks
Re: Plugin to show text form a txt?
Posted: January 19th, 2018, 10:19 pm
by Guest
Also will be nice if can display different lines from a txt.
ie. txt containing
SNES (that could be displayed on line 1)
Snow Bros (and this on line 2)
Not sure if can be defined by Y axis to read line 2. Something like (0,1) or (0,2) for the second line?
Just to get better use of the limited 2x16 space.
Thanks again!
Re: Plugin to show text form a txt?
Posted: January 20th, 2018, 2:27 pm
by trihy
Seems I wasnt logged
I think update interval should be 1 sec or lower.
I attached the real file when launching a game so you can have an example (had to make a zip because dont let me upload txt)
Re: Plugin to show text from a txt?
Posted: January 27th, 2018, 2:33 pm
by trihy
Any help with this guys?

Re: Plugin to show text from a txt?
Posted: February 19th, 2018, 4:12 pm
by dperrow
okay mate, I've knocked this up see if it works for you. Copy all 3 files from the zip to the plugins folder
The file FileText.cfg contains a pointer to the file, you can change this to suit. My test file is in the plugins folder and is called FileText.txt
start Smartie and wherever you want the text put in the line $dll(FileText,1,L,S#E) where L=the line number in the file that you want (starting at 0), S is the starting character on that line (starting at 0) and E is the ending character on the line (starting at 0) the last parameter is optional. e.g. $dll(FileText,1,1,) will display the whole of line 1, $dll(FileText,1,2,3,6) will display characters 3 to 6 from line 2.
Let me know how it goes.
FileText.zip
Re: Plugin to show text from a txt?
Posted: February 20th, 2018, 10:36 am
by dperrow
Sorry, that should have been $dll(FileText,1,2,3#6)
Re: Plugin to show text from a txt?
Posted: February 21st, 2018, 1:03 am
by trihy
dperrow wrote:okay mate, I've knocked this up see if it works for you. Copy all 3 files from the zip to the plugins folder
The file FileText.cfg contains a pointer to the file, you can change this to suit. My test file is in the plugins folder and is called FileText.txt
start Smartie and wherever you want the text put in the line $dll(FileText,1,L,S#E) where L=the line number in the file that you want (starting at 0), S is the starting character on that line (starting at 0) and E is the ending character on the line (starting at 0) the last parameter is optional. e.g. $dll(FileText,1,1,) will display the whole of line 1, $dll(FileText,1,2,3,6) will display characters 3 to 6 from line 2.
Let me know how it goes.
FileText.zip
Hi @dperrow Thats an amazing job!
A little problem, I cant get plugin to show anything from line 1. It will show always line 2 on both LCD lines.
I made a txt containing this:
1
2
Then I used:
$dll(FileText,1,1,)
$dll(FileText,1,2,)
And LCD will display:
2
2
Hope it can be easily fixed, its so close to be perfect
Thanks for all your work
Re: Plugin to show text from a txt?
Posted: February 21st, 2018, 3:01 am
by trihy
@dperrow I found the problem. My bad.
Line 1 is 0
Line 2 is 1
So, using this:
$dll(FileText,1,
0,)
$dll(FileText,1,
1,)
Now works perfect.
Again, thanks
Only small problem I noticed, is that when line 2 is empty, plugin will show line 1 in both lcd lines. When line 1 is empty, doesnt have this problem, will show only line 2.
Re: Plugin to show text from a txt?
Posted: February 21st, 2018, 9:26 am
by dperrow
o.k., my bad, didn't clear the result before reading the file.
Try this:
FileText.zip
Re: Plugin to show text from a txt?
Posted: February 21st, 2018, 3:20 pm
by trihy
dperrow wrote:o.k., my bad, didn't clear the result before reading the file.
Try this:
FileText.zip
Now is just perfect.
Thanks!
Will make a tutorial on kodi forums crediting you and linking this thread

Re: Plugin to show text from a txt?
Posted: February 21st, 2018, 4:23 pm
by dperrow
Thanks,
this must be the easiest plugin I've written. Probably took a total of 20 mins since I had all the infrastructury code (logging, config file etc.) already available. So no great shakes but I can imagine lots of uses for it.
Re: Plugin to show text from a txt?
Posted: February 21st, 2018, 4:23 pm
by dperrow
Thanks,
this must be the easiest plugin I've written. Probably took a total of 20 mins since I had all the infrastructury code (logging, config file etc.) already available. So no great shakes but I can imagine lots of uses for it.
Re: Plugin to show text from a txt?
Posted: February 21st, 2018, 8:29 pm
by trihy
Hi. Yes, it could be as great as webtxt, but for local use. It could display reports from many programs, etc.
Since it was easy, maybe you can take a look to the netflix plugin

not sure if that one could be possible. I guess all depends on how netflix app reports what is playing.
Too bad there are few people around here. With arduino, this lcd are getting lot of different uses.
But also is a little complicated for a normal pc. There arent many lcd to usb interface boards. And building one is not for everyone. I guess this makes people lost interest.
Re: Plugin to show text from a txt?
Posted: February 22nd, 2018, 9:36 am
by dperrow
Netflix would be a bit difficult. I don't have it on my PC and don't know where I'd find any info on hte API. If I had the API details I'd have a go though.
Re: Plugin to show text from a txt?
Posted: February 27th, 2018, 3:30 am
by trihy
Yes, no idea really. And not sure how open the netflix api is.
Lets hope someone familiar with the api take a look.