CHECK_VARIABLE

Compares the value of a variable against the given value.

== is assumed if no operator is given.

Example JSON

{
  "action": "CHECK_VARIABLE",
  "comparison": "==",
  "expected_bool": true,
  "success_script": "successScript",
  "value": 1,
  "variable": "varName"
},
{
  "action": "CHECK_VARIABLE",
  "comparison": "==",
  "expected_bool": true,
  "jump_index": 12,
  "value": 1,
  "variable": "varName"
}

MGS Natlang

The condition portion of this action can be used inside an if condition statement, e.g.

script {
  if (variable varName is < 1) {}
}

Examples

script {
  if variable varName is < 1 then goto successScript;
  if variable varName is < 1 then goto index 12;
  if variable varName is < 1 then goto label labelName;
  if variable varName is 1 then goto successScript;
  if variable varName is 1 then goto index 12;
  if variable varName is 1 then goto label labelName;
  if variable varName is not < 1 then goto successScript;
  if variable varName is not < 1 then goto index 12;
  if variable varName is not < 1 then goto label labelName;
  if variable varName is not 1 then goto successScript;
  if variable varName is not 1 then goto index 12;
  if variable varName is not 1 then goto label labelName;
}

Dictionary entries

if variable $variable:string is $comparison:operator $value:number
    then goto (script) $success_script:string (;)
	// built-in value: expected_bool = true

if variable $variable:string is $comparison:operator $value:number
    then goto index $jump_index:number (;)
	// built-in value: expected_bool = true

if variable $variable:string is $comparison:operator $value:number
    then goto label $jump_index:bareword (;)
	// built-in value: expected_bool = true

if variable $variable:string is $value:number
    then goto (script) $success_script:string (;)
	// built-in value: expected_bool = true
	// built-in value: comparison = ==

if variable $variable:string is $value:number
    then goto index $jump_index:number (;)
	// built-in value: expected_bool = true
	// built-in value: comparison = ==

if variable $variable:string is $value:number
    then goto label $jump_index:bareword (;)
	// built-in value: expected_bool = true
	// built-in value: comparison = ==

if variable $variable:string is not $comparison:operator $value:number
    then goto (script) $success_script:string (;)
	// built-in value: expected_bool = false

if variable $variable:string is not $comparison:operator $value:number
    then goto index $jump_index:number (;)
	// built-in value: expected_bool = false

if variable $variable:string is not $comparison:operator $value:number
    then goto label $jump_index:bareword (;)
	// built-in value: expected_bool = false

if variable $variable:string is not $value:number
    then goto (script) $success_script:string (;)
	// built-in value: expected_bool = false
	// built-in value: comparison = ==

if variable $variable:string is not $value:number
    then goto index $jump_index:number (;)
	// built-in value: expected_bool = false
	// built-in value: comparison = ==

if variable $variable:string is not $value:number
    then goto label $jump_index:bareword (;)
	// built-in value: expected_bool = false
	// built-in value: comparison = ==