What is this # symbol on If statement

Im sorry if this was asked but I couldnt find it.

When making a If statement with a variable I saw this # symbol...

This is the same thing as ==?
no
I suggest you give the full line you read, then we can explain it to you
# is a comment in Ruby (XP, VX, VX Ace). It means anything after # on the line is ignored.

It has no meaning in Javascript (MV) outside of a hexadecimal code.

Where did you see it?
In if statement when we check variable and then we can choose =, >, <, ...
Below < have a symbol.
I want to know what that symbol do.
≠ ≠ # .
It means not equals or !=. It's an equal sign with a slash across it.
You should probably post the line of code you saw it in, because right now, it doesn't mean anything to actual JS code. html/css uses it to denote hex color codes, and private fields in class declarations use it, but the latter is an experimental feature that isn't currently available.
You should probably post the line of code you saw it in, because right now, it doesn't mean anything to actual JS code. html/css uses it to denote hex color codes, and private fields in class declarations use it, but the latter is an experimental feature that isn't currently available.
He was talking about this I'm pretty sure.
NotEquals.png
You're probably right, actually. I guess I was overthinking it, wondering if maybe he saw some weird code example or something.
Oh, well if that's the case, that's NOT a # symbol - the two are very different and mean different things. I thought he was saying there's a # in a script formula somewhere.
≠ ≠ # .
It means not equals or !=. It's an equal sign with a slash across it.

Ah, thank you.
Oh, well if that's the case, that's NOT a # symbol - the two are very different and mean different things. I thought he was saying there's a # in a script formula somewhere.

Yes I know, they are diferent, but I cant do that symbol on my keyboard.
Im sorry about that.
A screenshot would have done the job nicely 🙂

If your question is now resolved, just report your first post and let the mods know, and they'll close the thread for you.
Thanks for your help.

One more question...

How I do >= in script language?
Or where I can find a link or something.

Now I know != is "not equal".

Because I want to put a limit in this code but only works with the IF of the Software.

For exemple
10 in 10 minutes I gain passive gold but I want a limit to reach.

I have in my code

IF variable >= 120
Variable = 120
else

var minutes = $gameVariables.value(22);

var seconds = $gameVariables.value(21);

var earnings = $gameVariables.value(7);

earnings = earnings + 20;
if (minutes === 0 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 10 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 20 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 30 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if (minutes === 40 && seconds === 0) {$gameVariables.setValue(7, earnings);}
else if(minutes === 50 && seconds === 0) {$gameVariables.setValue(7, earnings);}

Works well in this form
But I want to put the code before the first else in the script and I dont know how to make a >=
When i try to pass to script the gold jump from 80 to 120.
That's a very complicated script call. Maybe try this instead:

Code:
If Variable 21: Seconds = 0
  Control Variables X: Junk = Variable 22 Minutes mod 10
  If Variable X: Junk = 0
    Control Variables 7: Earnings += 20
    If Variable 7: Earnings > 120
      Control Variables 7: Earnings = 120
   End
  End
End

(you don't technically have do to >= because if it's =, you're just going to set it to the value it currently has, so what's the point?)

Or use a timer plugin so you don't have to run a parallel process to check something on every frame that's only going to be triggered every 10 minutes:

With the above, you can just do the plugin command, once only, when you want it to start counting:
Code:
AddTimer PassiveGold 600 \setS(99, true)

where 99 is a switch id to be turned on every 10 minutes.
Then add a common event, set to parallel process, and conditioned by switch 99:

Code:
Control Variables 7: Earnings += 20
If Variable 7: Earnings > 120
  Control Variables 7: Earnings = 120
End
Plugin Command: AddTimer PassiveGold 600 \setS(99, true)
Control Switches 99 = OFF
That's a very complicated script call. Maybe try this instead:

Code:
If Variable 21: Seconds = 0
  Control Variables X: Junk = Variable 22 Minutes mod 10
  If Variable X: Junk = 0
    Control Variables 7: Earnings += 20
    If Variable 7: Earnings > 120
      Control Variables 7: Earnings = 120
   End
  End
End

(you don't technically have do to >= because if it's =, you're just going to set it to the value it currently has, so what's the point?)

Or use a timer plugin so you don't have to run a parallel process to check something on every frame that's only going to be triggered every 10 minutes:

With the above, you can just do the plugin command, once only, when you want it to start counting:
Code:
AddTimer PassiveGold 600 \setS(99, true)

where 99 is a switch id to be turned on every 10 minutes.
Then add a common event, set to parallel process, and conditioned by switch 99:

Code:
Control Variables 7: Earnings += 20
If Variable 7: Earnings > 120
  Control Variables 7: Earnings = 120
End
Plugin Command: AddTimer PassiveGold 600 \setS(99, true)
Control Switches 99 = OFF


Well I need to be more specific what i want.


This code is when I buy a shop it gives me passive gold.
I made a clock script...
And this script is working with the clock
I want to put >= to not let the code to bug, because sometimes the variable go more than 120 when I have === 120 in the script.
Just do > 120.

>= is greater than or equal to, but if it's equal to, you don't need to change it, because it's already the correct value. So you just have to check for greater than, or >

But the top bit of code I gave you is the list of event commands to use, without having to do a big, long, convoluted if statement like you've got.

In fact if you already have a clock script that ticks over the seconds and minutes, you could just put the check right in that - when the minutes change, see if it's a multiple of 10 (mod 10 === 0), and then give the gold.

minutes mod 10 === 0

is the same as saying minutes === 0 or minutes === 10 or minutes === 20 or minutes === 30 or minutes === 40 or minutes === 50

And you can remove the seconds === 0 check from every test and put it right at the start, so you only check the minutes if the seconds IS 0.
Just do > 120.

>= is greater than or equal to, but if it's equal to, you don't need to change it, because it's already the correct value. So you just have to check for greater than, or >

But the top bit of code I gave you is the list of event commands to use, without having to do a big, long, convoluted if statement like you've got.

In fact if you already have a clock script that ticks over the seconds and minutes, you could just put the check right in that - when the minutes change, see if it's a multiple of 10 (mod 10 === 0), and then give the gold.

minutes mod 10 === 0

is the same as saying minutes === 0 or minutes === 10 or minutes === 20 or minutes === 30 or minutes === 40 or minutes === 50

And you can remove the seconds === 0 check from every test and put it right at the start, so you only check the minutes if the seconds IS 0.

Thanks for your help.
I made the script like that because is more easy for me to write, im a big noob at javascript I only know the basic code :/.

This problem its fixed.
Thanks everyone who helped me 😉.

A moderator can close this post, thank you.
To have a thread closed, you need to report your first post and let the mods know you're done with it. Don't rely on them seeing and reading a comment.

Original thread: https://forums.rpgmakerweb.com/threads/what-is-this-symbol-on-if-statement.119277/