Skip to content

Instantly share code, notes, and snippets.

@m0rb
Created April 5, 2018 16:50
Show Gist options
  • Save m0rb/9caa309958f297831fda9bd8feaf6f59 to your computer and use it in GitHub Desktop.
Save m0rb/9caa309958f297831fda9bd8feaf6f59 to your computer and use it in GitHub Desktop.
add_door.pl
#!/usr/bin/perl -w
use warnings;
use X11::GUITest qw/:ALL/;
my $doorct = $ARGV[0];
my $doorname = $ARGV[1];
my $doorkey = $ARGV[2];
my $doorcmd = $ARGV[3];
StartApp('dosbox');
my ($win) = WaitWindowViewable('dosbox');
if (!$win) { die; };
my @session = ( "{#}", "m17\n", "c", "i$doorct\n\n", "m$doorct\n1",
"{BAC 20}", "$doorname\n", "2", "{BAC 15}", "{[}$doorkey"."{]} $doorname\n",
"3", "{BAC 3}$doorkey\n", "5DG\n", "6G:\\RG\\DOOR.BAT {%}N {%}O $doorcmd\n",
"q", "q", "q", "q", "q", "\nexit\n" );
my $ct;
foreach my $cmd (@session) {
if ( $ct == 0 ) {
WaitSeconds(5);
} else {
WaitSeconds(.5);
}
SendKeys($cmd);
$ct++;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment