Check PC specs?

Status
Not open for further replies.

Mark91

Veteran
Veteran
Joined
May 19, 2017
Messages
112
Reaction score
10
First Language
Italian
Primarily Uses
RMMV
Hi, dear forum!
Is there a way to verify the PC specifications and store them in a variable?
I.e to check the amount of RAM in the system and store that amount in a var?
I think it would be useful to adapt some not essential processes according to the system specifications (like a lighter version of the game).
 

Ritter

Veteran
Veteran
Joined
Jan 17, 2017
Messages
64
Reaction score
30
First Language
English
Primarily Uses
RMMV
well there is navigator.deviceMemory but it's not very exact, should show you if someone has low memory, though i've never tested it to make sure on a low end machine.

I have 32GB of ram in my pc and navigator.deviceMemory shows as 8GB.

navigator.hardwareConcurrency would return the number of cpu threads

not sure you can pull much more than that, maybe someone else would know.
 
Last edited:

biud436

Veteran
Veteran
Joined
Sep 28, 2014
Messages
172
Reaction score
180
First Language
Korean
Primarily Uses
RMMV
Maybe you can use below functions of os module in NW.js

docs link : https://nodejs.org/api/os.html

JavaScript:
os.totalmem();
os.freemem();
os.cpus();

// For example
var currentMem = (os.totalmem() - os.freemem()) / Math.pow(1024, 3);
var totalMem = os.totalmem() / Math.pow(1024, 3);
 
Last edited:

Mark91

Veteran
Veteran
Joined
May 19, 2017
Messages
112
Reaction score
10
First Language
Italian
Primarily Uses
RMMV
Maybe you can use below functions of os module in NW.js

docs link : https://nodejs.org/api/os.html

JavaScript:
os.totalmem();
os.freemem();
os.cpus();

// For example
var currentMem = (os.totalmem() - os.freemem()) / Math.pow(1024, 3);
var totalMem = os.totalmem() / Math.pow(1024, 3);
Thanks for your answer!
I'm not good with jscript so, just to clear my mind, the first line in your example check for actual free memory, and the second one for total memory? And put them in variable 3?
:LZSteary: sorry, I really appreciate your help but I need some more info on how it works...
 

biud436

Veteran
Veteran
Joined
Sep 28, 2014
Messages
172
Reaction score
180
First Language
Korean
Primarily Uses
RMMV
Thanks for your answer!
I'm not good with jscript so, just to clear my mind, the first line in your example check for actual free memory, and the second one for total memory? And put them in variable 3?
:LZSteary: sorry, I really appreciate your help but I need some more info on how it works...
It is pretty easy.
In the script command, you need to write below code block.

JavaScript:
var os = require('os');

var divValue = Math.pow(1024, 3);
var currentMem = (os.totalmem() - os.freemem()) / divValue;
var totalMem = os.totalmem() / divValue;

$gameVariables.setValue(3, currentMem.toFixed(1));
$gameVariables.setValue(4, totalMem.toFixed(1));
 

Mark91

Veteran
Veteran
Joined
May 19, 2017
Messages
112
Reaction score
10
First Language
Italian
Primarily Uses
RMMV
It is pretty easy.
In the script command, you need to write below code block.

JavaScript:
var os = require('os');

var divValue = Math.pow(1024, 3);
var currentMem = (os.totalmem() - os.freemem()) / divValue;
var totalMem = os.totalmem() / divValue;

$gameVariables.setValue(3, currentMem.toFixed(1));
$gameVariables.setValue(4, totalMem.toFixed(1));
That's great!
Just one last thing if you can help; how can I store in variables informations from os.cpus?
with:
var os = require("os")
$gameVariables.setValue(1, os.cpus())
it shows only [object Object]

However thank you so much^^
 
Last edited:

biud436

Veteran
Veteran
Joined
Sep 28, 2014
Messages
172
Reaction score
180
First Language
Korean
Primarily Uses
RMMV
That's great!
Just one last thing if you can help; how can I store in variables informations from os.cpus?
with:
var os = require("os")
$gameVariables.setValue(1, os.cpus())
it shows only [object Object]

However thank you so much^^
'os.cpus()' returns an Array object so you need to enumerate one by one.
(Note that this code block is worked only in NW.js such as Mac, Windows platform)
Try this out.

JavaScript:
var os = require('os');
var cpu = os.cpus().pop();
$gameVariables.setValue(5, cpu.model); // CPU MODEL
$gameVariables.setValue(6, os.cpus().length); // CPU CORE COUNT
 

Mark91

Veteran
Veteran
Joined
May 19, 2017
Messages
112
Reaction score
10
First Language
Italian
Primarily Uses
RMMV
'os.cpus()' returns an Array object so you need to enumerate one by one.
(Note that this code block is worked only in NW.js such as Mac, Windows platform)
Try this out.

JavaScript:
var os = require('os');
var cpu = os.cpus().pop();
$gameVariables.setValue(5, cpu.model); // CPU MODEL
$gameVariables.setValue(6, os.cpus().length); // CPU CORE COUNT
Perfect!
Thank you again
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top