CraftBook icon indicating copy to clipboard operation
CraftBook copied to clipboard

Suggestion: Variable IF/CHECK

Open LadyCailinBot opened this issue 8 years ago • 1 comments

CRAFTBOOK-3328 - Reported by Omanoctoa

Hello! I know you have VAR ICs to check a Variable's value, but they are not always ideal in situations where you do not want use blocks/signs (such as in commands). The /cb var command is super-useful, but is missing a key element: The ability to CHECK (or compare) a variable by command. In essense, an IF command.

My suggestion is to add a subcommand to the Variable command: CHECK

/cb var CHECK <Variable> <EQUALS/NOT-EQUAL/HIGHER/LOWER> <Value> <Command if TRUE>

Basically, this would be a super-compact and streamlined Command version of the VAR ICs. The VAR CHECK command would compare the existing value of a variable to the Check value, and outputs TRUE/FALSE. If it results in a TRUE output, then it runs the <Command> argument as a CONSOLE command. I suggest running as Console, because I'm not sure how you would indicate how to run it as Player, Superuser or Console otherwise, without using symbols within the command structure (such as "/#say hello" being run from Console).

Apart from the <Command if TRUE> argument, this would basically just be a command variation of the VAR ICs. It would have very useful applications where using blocks/signs is not possible.

Cheers! Omanoctoa.

LadyCailinBot avatar May 27 '17 14:05 LadyCailinBot

Comment by me4502

This is an interesting idea. I'll look into adding it when I have some time available.

LadyCailinBot avatar May 28 '17 00:05 LadyCailinBot