Created
March 26, 2016 19:23
-
-
Save mrc0mmand/4425e70c991cf670d43d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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