Dangerous Prototypes

Other projects => Past projects => #twatch network LCD backpack => Topic started by: philalex on November 25, 2009, 09:06:28 pm

Title: Twatch perl lib - beta
Post by: philalex on November 25, 2009, 09:06:28 pm
Hi all,
you can download and test the beta version of the twatch perl lib  at https://launchpad.net/twatch (http://https://launchpad.net/twatch). Ideas, tests, bug reports would be appreciated

Phil.
Title: Re: Twatch perl lib - beta
Post by: philalex on November 26, 2009, 09:01:47 pm
Hi,

you can download lib and the demo from this url:
http://bazaar.launchpad.net/~alexandre- ... runk/files (http://bazaar.launchpad.net/~alexandre-philippe/twatch/trunk/files)
Title: Re: Twatch perl lib - beta
Post by: ian on November 27, 2009, 09:35:41 am
Thanks for the direct link, I had a hard time finding it. This is an awesome script, thanks for sharing it. I posted it up, and added it to the #twatch manual.

Great work!
Title: Re: Twatch perl lib - beta
Post by: lme on November 27, 2009, 05:42:31 pm
Cool thing! Now we only need a scroll function for long text... :)
Title: Re: Twatch perl lib - beta
Post by: philalex on November 28, 2009, 10:26:49 pm
Hi,

you can find at the same url a scroll library (beta version) and a demo.
http://bazaar.launchpad.net/~alexandre- ... runk/files (http://bazaar.launchpad.net/~alexandre-philippe/twatch/trunk/files)


@ian thank for the twatch, it's really a fun toy :)

Phil.
Title: Re: Twatch perl lib - beta
Post by: lme on November 29, 2009, 03:19:04 pm
Nice! :)

Here's my solution (added to your TWatch.pm):

Code: [Select]
sub scrollLine
{
        my ($self, $text, $row, $col) = @_;
        my $msg = $text;
        my $i = 0;

        $row=1 if(!defined($row) || $row > $self->{_NBROW} || $row < 1);
        $col=1 if(!defined($col) || $col > $self->{_NBCOL} || $col < 1);

        my $sock = $self->{_SOCKET};
        while (($col + length($text)-$i) > $self->{_NBCOL}) {
                $msg = substr($text, $i++, ($self->{_NBCOL}-$col)+1);
                print $sock chr(0xFE),chr(0x47),chr($col),chr($row);
                print $sock $msg;
                usleep(300000);
        }
        usleep(SLEEP);
}

But it was only a first try...

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01012070208session_write_close ( )...(null):0
20.01042201800ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01052202576Database_MySQL->query( ).../DatabaseHandler.php:119
40.05692341304Database_MySQL->error( ).../Db-mysql.class.php:273