Script aliases with perlexec.pl (/script install perlexec.pl) Run a command for each nick: /alias foreachuser /perlexec my $b=$buffer\; my $i=weechat::infolist_get("irc_nick", "", weechat::buffer_get_string($b, "localvar_server").",".weechat::buffer_get_string($b, "localvar_channel"))\; while(weechat::infolist_next($i)){ weechat::command($b, "$* ".weechat::infolist_string($i, "name"))\; } weechat::infolist_free($i)\; Append nicklist to a command: /alias foreachuser2 /perlexec my $b=$buffer\; my $i=weechat::infolist_get("irc_nick", "", weechat::buffer_get_string($b, "localvar_server").",".weechat::buffer_get_string($b, "localvar_channel"))\; my $s\; while(weechat::infolist_next($i)){ $s.=weechat::infolist_string($i, "name")." "\; } weechat::command($b, "$* $s")\; weechat::infolist_free($i)\; Run a command for nicks in groups of three: /alias foreachuser3 /perlexec my $b=$buffer\; my $i=weechat::infolist_get("irc_nick", "", weechat::buffer_get_string($b, "localvar_server").",".weechat::buffer_get_string($b, "localvar_channel"))\; my $s=""\; my $a=0\; while(weechat::infolist_next($i)){ $s.=weechat::infolist_string($i, "name")." "\; $a++\; if($a==3){weechat::command($b, "$* $s")\;$s=""\;$a=0\;} } weechat::command($b, "$* $s")\; weechat::infolist_free($i)\; Examples: /foreachuser /kick (will run /kick once for each nick) /foreachuser2 /op (will append the list to /op) (!) remember the "/" - a message will be sent without it Toggle a string settings with a key: /key bind /mute /perlexec my ($o,$a,$b)=('setting','val1','val2')\; weechat::command "", weechat::config_string(weechat::config_get $o) eq $a ? "/set $o $b" : "/set $o $a" Globally: /alias togglestr /mute /perlexec my ($o,$a,$b)=split /!/, '$*'\; weechat::command "", weechat::config_string(weechat::config_get $o) eq $a ? "/set $o $b" : "/set $o $a" /key bind ctrl-O /togglestr setting!value1!value2 Toggle away status: /alias toggleaway /perlexec weechat::command('', weechat::buffer_get_string($buffer,'localvar_away') ? '/away -all' : '/away -all $1'); New /wii (now in core): /alias wii2 /whois $1 $1 /alias wii perlexec weechat::command '', '$1' ? '/wii2 $1' : weechat::buffer_get_string($buffer, 'localvar_type') eq 'private' ? '/wii2 '.weechat::buffer_get_string($buffer, 'localvar_channel') : '/whois '.weechat::buffer_get_string($buffer, 'localvar_nick')