Thanks! That helped quite a bit. I was able to use that bit to get it to find the ones I needed only and its percentage from the last row, and put them all in a <div> box so I could copy it all directly from chat as one long line separated list :) Saved me hours and hours of typing out 300+ skills for them all! Ill toss mine in here to give back, incase anyone wants to borrow some of it. it grabs only ones with the right name, then finds the appropriate box for the % and makes one line entry of text for them. Its probably not the easiest way to do it. but maybe some part of it will help someone else out. if (msgTxt.indexOf("!skills") !== -1) {
var Oskills = "";
var Rskills = "";
var Sskills = "";
var token = getObj('graphic', msg.selected[0]._id);
var oCharacter = getObj('character', token.get("_represents"));
var name = (oCharacter.get('name'));
var attributes = findObjs({type: "attribute",_characterid: oCharacter.id,});
_.each(attributes, function (indexAttributes) {
var attName = indexAttributes.get("name");
if (attName.indexOf("repeating_occsk_") > -1 && attName.indexOf("OCCSKPL") == -1 && attName.indexOf("OCCSKP") == -1) {
var Otemp = name + " * " + indexAttributes.get("current");
var Operc = indexAttributes.get("name");
Operc = Operc.slice(0, - 5) + "OCCSKP";
var OtempP = findObjs({_type: "attribute",name: Operc, _characterid: oCharacter.id})[0];
OtempP = " -- " + OtempP.get("current") + "<br>";
Oskills = Oskills + Otemp + OtempP;
};
});
_.each(attributes, function (indexAttributes) {
var attName = indexAttributes.get("name")
log(attName);
if (attName.indexOf("repeating_ocrcsk_") > -1 && attName.indexOf("OCRCSKp") == -1 && attName.indexOf("OCRCSKPL") == -1) {
var Rtemp = name + " * " + indexAttributes.get("current");
var Rperc = indexAttributes.get("name");
Rperc = Rperc.slice(0, - 6) + "OCRCSKp";
var RtempP = findObjs({_type: "attribute",name: Rperc, _characterid: oCharacter.id})[0];
RtempP = " -- " + RtempP.get("current") + "<br>";
Rskills = Rskills + Rtemp + RtempP;
};
});
_.each(attributes, function (indexAttributes) {
var attName = indexAttributes.get("name");
if (attName.indexOf("repeating_secsk_") > -1 && attName.indexOf("SECSKp") == -1 && attName.indexOf("SECSKpl") == -1) {
var Stemp = name + " * " + indexAttributes.get("current");
var Sperc = indexAttributes.get("name");
Sperc = Sperc.slice(0, - 5) + "SECSKp";
var StempP = findObjs({_type: "attribute",name: Sperc, _characterid: oCharacter.id})[0];
StempP = " -- " + StempP.get("current") + "<br>";
Sskills = Sskills + Stemp + StempP;
};
});
var whoC = OuterDiv + iPart + "background-color:#222222;'>" + Oskills + "</div>";
sendChat('Picked', "/direct " + whoC);
var whoC = OuterDiv + iPart + "background-color:#222222;'>" + Rskills + "</div>";
sendChat('Picked', "/direct " + whoC);
var whoC = OuterDiv + iPart + "background-color:#222222;'>" + Sskills + "</div>";
sendChat('Picked', "/direct " + whoC);
};