It's all in the Commands - Assistance with commands please

Hey, I am creating a command to handle a thrown item. this is what I have so far:

commands.unshift(new Cmd('Throw',{
	regex:/^(?:throw|toss|chuck) (.+) (?:at|through|on|over|under|out) (.+)$/,
	script:function(objects) {
		return handleThrowAt(game.player, objects)

function handleThrowAt(char, objects) {
	let success = false
	const throwThis = objects[0][0]
	const atThis = objects[1][0]
	if( === 'oldest_wire_cutters') {
		if( === 'broken_window') {
			if(w.boards.boardsOpen) {
				msg("Response string here")
				w.oldest_wire_cutters.loc = 'backyard'
				success = true
	if(!success) msg("Failed response string");
	return success ? world.SUCCESS : world.FAILED;

the code is created in the code.js module.

Not sure but there could be issues with the documents on this page

Example: I was not able to get this to work:

return success ? SUCCESS : FAILED;

For this example I am told that FAILED is not defined. When I changed it to this however, it worked:

return success ? world.SUCCESS : world.FAILED;


Thanks, I realised there were a number of issues with that page due to numerous updates to QuestQR since it was written. Hopefully now resolved.

Log in to post a reply.