aboutsummaryrefslogtreecommitdiffstats
path: root/feature-tests/local_input_capture.pl
diff options
context:
space:
mode:
authorricho <richo@psych0tik.net>2011-07-18 03:36:40 +0000
committerricho <richo@psych0tik.net>2011-07-18 03:36:40 +0000
commite4b9ea15d7abdae8211d18737fa54933f3faf57b (patch)
treefda4cc23faebfd1f130578b39fe161fe4c0ba1f8 /feature-tests/local_input_capture.pl
parentAdded goodnicks from richoH/richos-irssi (diff)
parentOnly attempt join if channel exists (diff)
downloadirssi-scripts-e4b9ea15d7abdae8211d18737fa54933f3faf57b.tar.gz
irssi-scripts-e4b9ea15d7abdae8211d18737fa54933f3faf57b.zip
Merge branch 'master' into richoH-dev
Diffstat (limited to '')
-rw-r--r--feature-tests/local_input_capture.pl50
1 files changed, 50 insertions, 0 deletions
diff --git a/feature-tests/local_input_capture.pl b/feature-tests/local_input_capture.pl
new file mode 100644
index 0000000..847ff07
--- /dev/null
+++ b/feature-tests/local_input_capture.pl
@@ -0,0 +1,50 @@
+use strict;
+use warnings;
+
+
+use Irssi;
+use Irssi::Irc;
+use Irssi::TextUI;
+
+use Data::Dumper;
+
+
+our $VERSION = '0.1';
+our %IRSSI = (
+ authors => 'shabble',
+ contact => 'shabble+irssi@metavore.org',
+ name => '',
+ description => '',
+ license => 'Public Domain',
+ );
+
+my $buffer = '';
+init();
+
+sub init {
+
+ Irssi::signal_add_first 'print text', 'sig_print_text';
+ Irssi::command 'echo Hello there';
+ Irssi::signal_remove 'print text', 'sig_print_text';
+ Irssi::command_bind 'showbuf', 'cmd_showbuf';
+}
+
+sub cmd_showbuf {
+ my ($args, $server, $win_item) = @_;
+ my $win;
+ if (defined $win_item) {
+ $win = $win_item->window();
+ } else {
+ $win = Irssi::active_win();
+ }
+
+ $win->print("buffer is: $buffer");
+ $buffer = '';
+}
+
+sub sig_print_text {
+ my ($text_dest, $str, $stripped_str) = @_;
+
+ $buffer .= $stripped_str;
+ Irssi::signal_stop;
+}