@jkandasa Gosh, so.. I was doing some research over the forum... and I found this http://forum.mycontroller.org/topic/139/hour-meter wich I've been trying to use with no sucess...
let me put some good info here!
I've made those simple custom widgets, here is the script for them
var myImports = new JavaImporter(java.io, java.lang, java.util);
var Custo = 0;
with(myImports) {
var amp1 = mcApi.uidTag().getByUid("AmpRaw1").getResource()
var volt = mcApi.uidTag().getByUid("VoltRaw1").getResource();
var taxa = mcApi.variable().get("Taxa");
var Custo_aux = mcApi.variable().get("CustoT");
// custom value
var finalData = (amp1.value * volt.value)/ 1000;
Custo_aux.value = finalData * taxa.value;
}
I just need a way to acumulate(a.k.a SUM) the values os the last line like Custo_aux.value += the rest...
I've been trying to use the .save() without success too..
Plz master J, help me out!!