Teabag wrote:Thanks these were a huge help, also other events on this page:
https://raw.githubusercontent.com/sprin ... erface.cpp
at the moment i am trying to increase the number of commands the CustomAliases plugin will allow on a single aliase. so far i have got it to read multiple commands from CustomAliases.conf file
but i am having trouble with issuing the command, it takes the first or last command only depending on the format of the second part.
this part is functioning:
Code: Select all
if($aliasDef=~/^([^\(]+)\(([^\(]+)\)\(([^\(]+)\)\(([^\(]+)\)\(([^\)]+)\)$/) {
my ($aliasName,$aliasCmd1,$aliasCmd2,$aliasCmd3,$aliasCmd4,)=($1,$2,$3,$4,$5);
my @aliasCmdTokens1=split(/ /,$aliasCmd1);
my @aliasCmdTokens2=split(/ /,$aliasCmd2);
my @aliasCmdTokens3=split(/ /,$aliasCmd3);
my @aliasCmdTokens4=split(/ /,$aliasCmd4);
second part (original):
Code: Select all
$aliases{$aliasName}=\@aliasCmdTokens;
any suggestions as to the best way to format this?
I'm not very sure about what you are trying to do, and especially how you are trying to do it.
My guess is that you are trying to implement "SPADS commands chaining", and trying to use it with aliases the way it's done in the CustomAliases plugin. But it's not that simple, this alias system is made for one-to-one mapping of alias and commands, you can't map one alias to a chain of commands directly.
You have multiple ways to do what I guess you want to do. I would suggest this one which seems the easiest one:
First you declare a new SPADS command (!chainCommands for example), which would basically take the commands passed as parameters and execute them sequentially using the "executeCommand" function. If needed, you can follow
this tutorial which explains how to implement new SPADS commands in SPADS plugins.
Then you just use the existing CustomAliases plugin without any modification, and map some aliases to the !chainCommands command with the SPADS commands you want to chain as parameters.