Skip to content

Instantly share code, notes, and snippets.

@mrc0mmand
Created March 26, 2016 19:23
Show Gist options
  • Save mrc0mmand/4425e70c991cf670d43d to your computer and use it in GitHub Desktop.
Save mrc0mmand/4425e70c991cf670d43d to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Irssi;
our $win_name = "&\@hilight_test";
our $win;
sub hilight {
if($win) {
$win->print("%Ytest hilight%n", MSGLEVEL_HILIGHT|MSGLEVEL_PUBLIC|MSGLEVEL_MSGS);
}
}
sub create_win {
$win = Irssi::window_find_name($win_name);
if($win) {
return 0;
}
$win = Irssi::Windowitem::window_create($win_name, 1);
if(not $win) {
Irssi::print("Failed to create window '$win_name'", "error");
return 1;
}
$win->set_name($win_name);
return 0;
}
if(create_win() != 0) {
return 1;
}
Irssi::timeout_add(2000, \&hilight, undef);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment