Nah, you'd do this:
Code:
function start(){
cm.sendSimple("Hello. I'll add nebulite slots onto one of your items for a fee of " + mesoCost + " mesos.");
}
function action(mode, type, selection){
(mode == 1 ? status++ : cm.dispose());
if (status == 0){
inventory = new Array(cm.EquipList(cm.getPlayer().getClient()));
However, might I point out, in Lithium (v111+ sources), they had changed the NPCScriptManager so that you can use just directly action without any start. In my v83 before it was changed, I couldn't juse use start or just use action, I had to use both. If you do use both, you can do it the way above. Otherwise, I'd personally just use action.
Oh, and Ternary's. A Ternary operation (a ? b : c); is a one line if-else statement boolean. The difference of JavaScript Ternary and Java Ternary is that within JavaScript you may use void, while in Java it will return "Not a statement" and you will have to result to a one line if-statement.
Here's an example that'll make sense for JavaScript
:
useVoid when true = Say the player has to be level 70 to see "Bye" in a void sendNext and if they aren't level 70 it will say"Hi" in a sendOk void
useVoid when false = Will change the text around, this is what you'd use it for in Java with Strings
Code:
var characterLevelRequired = 70; // level req
var characterLevel = 34; // current char level
var useVoid = false; // By default we'll see a void ternary
function start() {
if (useVoid)
(characterLevel >= characterLevelRequired ? cm.sendNext("Bye") : cm.sendOk("Hi));
else
cm.sendOk(characterLevel >= characterLevelRequired ? "Bye" : "Hi");
cm.dispose();
}