# Documentation follows __END__ # # There is no need to modify this script. # package Xchat::b0at::MultipleCommands; use strict; use warnings; my $NAME = 'Multiple Commands'; my $VERSION = '004'; my $COMMAND = 'MULTI'; my $USAGE = "Usage: $COMMAND [separator [...]], spaces around separator are required"; Xchat::register( $NAME, $VERSION, "Execute multiple commands in sequence" ); Xchat::print( "\02$NAME $VERSION\02 by b0at (use /$COMMAND)" ); Xchat::hook_command( $COMMAND, sub { my ($w, $e) = @_; my $sep = $w->[1]; # first word is the separator my $cmd = $e->[2]; # rest of the arguments taken as one string if( not $sep or not $cmd ) { Xchat::print($USAGE) } else { Xchat::command([ split/\s+\Q$sep\E\s+/,$cmd ]) } return Xchat::EAT_XCHAT; }, {help_text=>$USAGE} ); __END__ author: b0at license: public domain examples: /multi | cmode +m | say NO YOU STFU! | timer 7 cmode -m /multi => say Well, would you look at the time? => join 0 => quit Since space is required around the separator, that character can appear elsewhere without it separating commands; eg, /multi : say Public notice: something : notice @#channel Private notice some other ways to execute multiple commands: (http://www.xchat.org/faq/index.html#q214) - /load -e /path/to/file which can allow you to save connect commands in a file in the config dir - same-named user commands Settings -> Lists -> User Commands