speedwalk.pl

xpertmud/appdata/perl/speedwalk.pl · 622 B

From the archive xpertmud-2005-10-21.zip

Download the archive   « Back to the archive contents

use strict;


sub speedwalk {
   my $command=$_[0]; 
   $command=~s/^\.//;
   while (length $command) {
     my $count=1;
     if ($command=~ s/^(\d+)//) {
	$count=$1;
     }
     my $cmd="";
     if ($command=~ s/^\((.+?)\)//) {
       $cmd=$1;
     } elsif ($command=~ s/^(.)//) {
       $cmd=$1;
     } else {
                statusWindow->setFGColor(RED);
                statusWindow->print("Error in speedwalk expression\n");
                statusWindow->resetAttributes();
     }
     if (length $cmd) {
       XM::send("$cmd\n" x $count);
     }
   }
   return undef;
}



addAlias("SPEEDWALK",'^\.',\&speedwalk);

Site Stats

Snippets: 1791
Codebases: 571