RAM AND MAXSCRIPT

hello , my computer usualy overload , i want to show CPU and RAM in rollout , please help me , thank you very much for your replies

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fajar's picture

here is some example....just

here is some example....
just copy paste the code into maxscript editor and execute it

--here is the basic from maxscript help "System Information"
/*
(
r=sysinfo.getSystemMemoryInfo()
for i=2 to 7 do r[i] /= (1024*1024.)
format "percent of memory in use:\t%\n" r[1]
format "total physical memory:\t% MB\n" r[2]
format "free physical memory:\t% MB\n" r[3]
format "used physical memory:\t% MB\n" (r[2]-r[3])
format "total paging file size:\t% MB\n" r[4]
format "free paging file size:\t% MB\n" r[5]
format "used paging file size:\t% MB\n" (r[4]-r[5])
format "total virtual memory:\t% MB\n" r[6]
format "free virtual memory:\t\t% MB\n" r[7]
format "used virtual memory:\t\t% MB\n" (r[6]-r[7])
ok
)
*/
 
 
rollout ram "Untitled" width:162 height:86
(
	edittext edt1 "All RAM" pos:[8,4] width:141 height:17 readOnly:true 
	edittext edt2 "Available RAM" pos:[8,24] width:141 height:17 readOnly:true 
	edittext edt3 "Used RAM" pos:[8,45] width:141 height:17 readOnly:true 
 
	local myTimer = dotNetObject "System.Windows.Forms.Timer" 
 
 
 
	fn collectSys = 
	(
		local r=sysinfo.getSystemMemoryInfo()
		for i=2 to 7 do r[i] /= (1024*1024.)
		r
	)
 
 
	fn printRAM =
	(
		local r = collectSys()
		edt2.text=(r[3] as String)
		edt3.text=((r[2]-r[3]) as String)
	)
 
	on ram open do
	(
		local r = collectSys()
		edt1.text=(r[2] as String)
 
		dotnet.addEventHandler myTimer #tick printRAM
		myTimer.Start()
	)
 
	on ram close do
	(
		myTimer.Stop()
                myTimer.Dispose()
	)
 
)
CreateDialog ram
alexnguyen's picture

thank you again

i did it , thank you very much :D

alexnguyen's picture

thank for your reply

but you not understand my question , i usally overload ram when i work , i want to display my ram . i think i use dotnet , but i dont know how to do

AttachmentSize
capture.png 7.52 KB
fajar's picture

can you do a little maxscript

can you do a little maxscript ...if yes then you can find it on maxscript help, try find "System Information"

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.