Neverwinter gateway - Profession Automation

Automatically selects professions for empty slots

< Feedback on Neverwinter gateway - Profession Automation

Question/comment

§
Posted: 2015-06-17
BUGGED - Incorrectly put name where number of characters belongs

Ive done this a couple of times now and have screwed myself. Is there a way to get the script to run properly after youve done this and saved it? After saving a name in this section, it actually removed the part to save the changes and everything I have done other than to reinstall the script has failed to make a difference. It just pops back up, inactive with the name in the character number slot.
§
Posted: 2015-06-17
Here is a screen shot
§
Posted: 2015-06-17
lol i have done this a couple of times too, totally sucks
Rotten_mindAuthor
§
Posted: 2015-06-18
Really, IDK how to fix.(ok, if make that "field" accept only some input, but then someone with funny name has problems...)

Just grind all up and keep same settings for all scripts. I maintain my running script from non-public script, allways I make change all updates to all bots automatic.
§
Posted: 2015-07-06
Edited: 2015-07-06

Haven't tested it, but in theory the following should work:

settings["charcount"] = parseInt(settings["charcount"].match(/\d+/g)) || 1;

Add it in the SaveSettings() function around line 2800. It extracts the first number from the texts if exists otherwise returns 1.

You could also add a new settings type of "number", change the "charcount" settings to type: 'number' and add the following in the switch at line 2756:

case "number":
    value = parseInt(el.val().match(/\d+/g)) || 1;
    break;

Another solution, the one that i use, is to insert the following at line 2800, before the autoreload on character count change:

// If character count is not a number revert to previous value and show an alert
if (settings["charcount"] != parseInt(settings["charcount"].match(/\d+/g))) {
    settings["charcount"] = charcount;
    alert("Character count is invalid!");
    return;
}
Rotten_mindAuthor
§
Posted: 2015-07-06

I need test that last one, could be that what takes one more mistakes away.

§
Posted: 2015-07-06

I haven't read through the entire code base, but i think charcount doesn't have a default value, so the last snippet needs to be modified to work during the setup phase, since with the current script if you enter an invalid character count for the first time, it'll probably set settings['charcount'] to undefined or an empty string or some other nonsense, which will also cause an error.

The modified snippet below sets the settings['charcount'] to 1 if charcount has a falsey value:

// If character count is not a number revert to previous value and show an alert
if (settings["charcount"] != parseInt(settings["charcount"].match(/\d+/g))) {
    settings["charcount"] = charcount || 1;
    alert("Character count is invalid!");
    return;
}

Post reply

Sign in to post a reply.