MV script commands

How do I perform variable operations using the script command? sum, subtraction, division, multiplication, and equal to another variable. Thank you very much in advance.
$gameVariables.value(number) +=, -=, /=, *=, = $gameVariables.value(other number)
$gameVariables.setValue(2) < 10
$gameVariables.setValue(2) >= 10
$gameVariables.setValue(2) /= 10
$gameVariables.setValue(2) %= 10
$gameVariables.setValue(2) += 10
$gameVariables.setValue(2) -= 10

edit: ninja'd
That won't work, ShadowDragon. setValue takes 2 arguments, the variable ID and the new value for it. Your code would cause an error.
I am not able to make it work, it gives errors. token = I'm calling the script but not yours if the code format is correct.
You need to show us the code you wrote that isn't working, we can't guess at what you typed incorrectly.
You need to show us the code you wrote that isn't working, we can't guess at what you typed incorrectly.
Script: $gameVariables.value(10) +=, $gameVariables.value(20)
completely wrong

theoretically what you would need is
$gameVariables.setValue(10,$gameVariables.value(10) + $gameVariables.value(20));

however even that will most likely cause errors because you might use it at the wrong time.

Please describe to us where and what for you plan to use the commands as only then we can tell you how to do it correctly.
[TABLE]
[TR]
[TD][/TD]

[TD]$gameVariables.setValue(varID, value);[/TD]
[/TR]
[/TABLE]

"value" can be anything that ends in a valid number
(if you want to keep it clean make a var as value..)
-> example:

var v1 = (insert code for "value" here)

$gameVariables.setValue(varID, v1);



however for more infos about simple default scriptcalls check these links:

Usefull Scriptcalls Info (Page is not made by me)
alternative Scriptcall List (Page is not made by me)
$ gameVariables.setVariable (8, $ gameMap.events () [n] .x) $ gameVariables.setVariable (9, $ gameMap.events () [n] .y)

this here, the command I have gives the variable id and
the fixed value. however I need to put a "variable" value. the command I need would be something like variable id = to a number in parallel.
type
$ gamevariable.setvalue (5000, parallel number of a range
Why is it necessary for you to do this in a script? Most of the things you've put here can be done using event commands (it is also confusing to the people trying to help you that you've shown two different things you're trying to do).

If you do need to do it in a script, you should really Google some JavaScript tutorials (or look in the tutorial forums here). Your basic syntax mistakes are going to make your code fail even if you ask us and get the correct functions to use, you're typing them very wrong.

Your last question you can simply pull up the event commands, click Control Variable, Set, and there's an option for Random and you give the number range.
here in the forum I write through the translator, sorry if you are confused.
but I am not able to use variables in the usual way, I have a plugin request for that.

I'm already using all the variables of the project, I managed to use it more through scripts, but I don't know the codes to simulate the same function as the events.

the most important thing is the code to match the variables ...

variable x = variable y only by script.
the most important thing is the code to match the variables ...

variable x = variable y only by script.
ok instead x(nr1) an y(nr2), we call them NR1 and NR2, for better understanding..

JavaScript:
$gameVariables.setValue(1, $gameVariables.value(2));
// this will set $gameVariable_nr1 to the value of $gameVariable_nr2
// better copy paste it and only change the numbers , to be sure to make no mistake..

edit

and i still recommend to study these:

Usefull Scriptcalls Info (Page is not made by me)
alternative Scriptcall List (Page is not made by me)


.. also i guess and hope that we talk about RPG MV here..

Original thread: https://forums.rpgmakerweb.com/threads/script-commands.134588/