The following code can be added to your Roll20.net game to allow users to make Elemental Action rolls easily.
To use this functionality type into the chat window an exclamation mark followed by the elemental action and then a list of dice being rolled for the check. Using a capitalised D means that those dice are being rolled as element bending dice.
Example:

!strike 2d4 1D6

Code:

function republicRoll(msg, rolltype, targets, numdice){
var output = "rolling: "+numdice+"<br>";
var regex = /([0-9]+)([dD])([0-9]+)/gi;
var result = [];
var totalwins = 0;
var totalfails = 0;
var loss = "";
while ( (result = regex.exec(numdice)) ) {
output += result[0];
var wins = 0;
var fails = 0;
for (i = 0; i < parseInt(result[1]); i++) {
if(result[2] == "D"){
var roll1 = randomInteger(parseInt(result[3]));
var roll2 = randomInteger(parseInt(result[3]));
var success = false;
if (targets.indexOf(roll1) > -1 || targets.indexOf(roll2) > -1){
wins++;
totalwins++;
}
if (targets.indexOf(roll1) <= -1 || targets.indexOf(roll2) <= -1){
fails++;
}
if (targets.indexOf(roll1) > -1){
output += ", (<strong>"+roll1.toString()+"</strong>/";
}else{
output += ", ("+roll1.toString()+"/";
}
if (targets.indexOf(roll2) > -1){
output += "<strong>"+roll2.toString()+"</strong>)";
}else{
output += ""+roll2.toString()+")";
}

}else{
var roll = randomInteger(parseInt(result[3]));
var success = false;
if (targets.indexOf(roll) > -1){
success = true;
}
if(success){
output += ", <strong>"+roll.toString()+"</strong>";
wins++;
totalwins++;
}else{
output += ", "+roll.toString();
fails++;
totalfails++;
}
}
}
if(fails >0){
loss += fails.toString()+"d"+result[3]+" ";
}
output += ": <span style='font-weight:bold;font-size:large'>"+wins.toString()+"</span><br>";
}
output += "<span style='font-size:150%;font-weight:bold;margin: 10px 0px;'>SUCCESSES: <strong>"+totalwins.toString()+"</strong></span><br>Losses: <span style='color:red'>"+loss+"</span>";
output = output.replace(/([0-9]+d4)/gi,'<span style="color:#E74C3C">$1</span>');
output = output.replace(/([0-9]+d6)/gi,'<span style="color:#27AE60">$1</span>');
output = output.replace(/([0-9]+d8)/gi,'<span style="color:#F1C40F">$1</span>');
output = output.replace(/([0-9]+d12)/gi,'<span style="color:#8E44AD">$1</span>');
output = output.replace(/([0-9]+d20)/gi,'<span style="color:#2980B9">$1</span>');
//output = output += '<br><img src="https://acegiak.net/ace/chorusoffates.png?channel=acegiak&poll=ChorusOfFates&roll='+rolltype+'&time='+(Date.now().toString())+'">'
return '<p style="border:1px solid #222222;padding:5px;background-color:#efeedd;">'+output+'</p>';
}
on("chat:message", function(msg) {
var output = "";
if(msg.type == "api" && msg.content.indexOf("!strike ") !== -1) {
var numdice = msg.content.replace("!strike ", "");
sendChat(msg.who, republicRoll(msg,"strike",[1,2,3,11,12,13],numdice));
}
if(msg.type == "api" && msg.content.indexOf("!build ") !== -1) {
var numdice = msg.content.replace("!build ", "");
sendChat(msg.who, republicRoll(msg,"build",[4,5,6,11,12,13],numdice));
}
if(msg.type == "api" && msg.content.indexOf("!avoid ") !== -1) {
var numdice = msg.content.replace("!avoid ", "");
sendChat(msg.who, republicRoll(msg,"avoid",[4,5,6,7,8,9],numdice));
}
if(msg.type == "api" && msg.content.indexOf("!observe ") !== -1) {
var numdice = msg.content.replace("!observe ", "");
sendChat(msg.who, republicRoll(msg,"observe",[3,4,7,8,9,10,11,12],numdice));
}
if(msg.type == "api" && msg.content.indexOf("!tend ") !== -1) {
var numdice = msg.content.replace("!tend ", "");
sendChat(msg.who, republicRoll(msg,"tend",[4,5,6,9,10,11,12,13,14,15,16,17,18,19,20],numdice));
}
});