Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[HELP] Cashmaster v0.9.1 error ?

    Using Cashmaster v0.9.1, when my players try to buy anything from NPC shop, it throws this error in chat: CashMaster: ERROR: You must specify a target by name within double quotes in the phrase T "Shield,Copy 7:46PM (From CashMaster): ERROR: TypeError: Cannot read property 'indexOf' of null 7:46PM (From CashMaster): ERROR: <Player> received: TypeError: Cannot read property 'indexOf' of null 7:46PM (From CashMaster): ERROR: Invalid Input. Validate that a subject is provided and input is not malformed. In response to <player> command !cm -buy -T "Shield,Copy - Linene Greywind" Sandbox error is: "Invalid Input.  Validate that a subject is provided and input is not malformed."
1605927985

Edited 1605929092
Oosh
Sheet Author
API Scripter
Does that happen with any NPC or just that one? It's generally not a good idea to have punctuation in names if you can avoid it, try removing "Copy - " from the shopkeeper's name and see what happens. edit - ah yep, found it: // Wrapping in try/catch because of the forEach. This allows us to easily escape to report errors to the user immediately. try { // Advanced Mode var tagList = subcommand.split(' -'); tagList.forEach(function (param) { if (param.startsWith('S ')) { var subjectNameList = getStringInQuotes(param); var subjectNames = []; The script uses a single hyphen as a command line split. When the buy button sends: !cm -buy -T "Shield,Copy - Linene Greywind" it's reading the hyphen as a command (like the -T and the -buy) and splitting the quotation in half which throws the errors when it gets to the getStringInQuotes(param) function. If you desperately need hyphens in there, make sure there's no whitespace before it and you can (probably) get away with it. Using "Copy-Linene Greywind" will probably make it through that section of code without breaking the furniture, though it could well cause errors somewhere else. Best to just get rid of brackets, braces and mathematical symbols.
That did it, Oosh.  That NPC was a copy because I wanted to seperate weapons and armer shops so I duped the character. Renamed her Armor, and it worked beautifully. Thanks!
1605928963
Oosh
Sheet Author
API Scripter
No worries - ignore the last bit in the edited post then, I wasn't sure if you actually wanted the hyphen in there... obviously you don't so it's not relevant :)