Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Q&D Message-A-Minute

Discuss anything to do with plugins

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
aldreis
Posts: 3
Joined: August 16th, 2006, 8:33 am
Contact:

Q&D Message-A-Minute

Post by aldreis »

My father is very fond of his collection of inspirational and thought-provoking phrases. So, when I gave him an LCD kit, I figured out that would be nice to have Smartie to present him a different phrase each minute. Hoping that it could be of use for someone, that?s what I did:

I made a text file with 60 of those phrases and placed it in the plugin folder. And created a screen with the following code:

Code: Select all

$File(phrases.txt,$dll(demo.dll,1,1,$Time(n))) 
He loved it. ;-)
limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Post by limbo »

Smart thought by a Smartie user :D
Keep On
aldreis
Posts: 3
Joined: August 16th, 2006, 8:33 am
Contact:

Post by aldreis »

limbo wrote:Smart thought by a Smartie user :D
Keep On
Thank you, limbo. :)

As it turns out, my father become a little bored with the same 60 phrases repeated sequentially, and hinted that he?ll love to have something more random -- but with his 9000+ collection. :shock:

So I needed a plugin that outputs a random number within such range. I didn?t find one, and realized that could be a great opportunity to discover what Delphi is.

I downloaded Delphi 7 Personal ( still free, thanks Borland ) yesterday, read the help files, used the demo.dll source as a guide, wrote a very simple dll, compiled the thing and it amazingly worked. :-P

Maybe it could be of use for someone else. It?s here:
http://www.aldreis.com/recursos/smartie/rando.zip ( 24KB )

Syntax:

$dll(rando,1,X,Y)

It returns a random integer from the range that extends between X ( inclusive ) and Y (inclusive).

Examples:

$dll(rando,1,0,3) > a random number between 0 and 3.
$dll(rando,1,100,200) > an one between 100 and 200.

-----------

And that ?One Minute Wisdom? screen became this:

Code: Select all

$File(phrases.txt,$dll(rando,1,1,9000))
NOW he?s happy. ;-)
Post Reply