Physical Memory
Platform: mIRC
Published Feb 08, 2007
Updated Feb 08, 2007
These are two aliases I made designed to return the total amount of physical memory in kb.
Usage Example: mostly for if statements,
if ($mem > 50000) { write new.txt Something }
;
The file alias is specifically for creating the text file used to hold the memory, so it must be created first. Rather, use the file alias and then the mem alias in order to make this work successfully. Upon usage I normally recieve a message in status, DIM unknown command, I myself am not sure how to fix this. However, it does not hinder the effectiveness of this in any way. I hope some of you find this useful :D
menu channel,menubar {
-
Create File:file
Find Memory:mem
-
}
alias -l file {
var %% = aline @@
window -h @@
%% strComputer="."
%% Set objFSO = CreateObject("Scripting.FileSystemObject")
%% Set objFile = objFSO.CreateTextFile("C:\Program Files\mIRC\Memory.txt")
savebuf @@ file.vbs
window -c @@
.comopen run wscript.shell
.comclose run $com(run,run,3,bstr,wscript file.vbs,uint,5,bool,true)
.remove file.vbs
}
alias -l mem {
var %% = aline @@
window -h @@
%% Dim Physical
%% Dim strComputer, wbemServices, wbemObjectSet, wbemObject
%% strComputer="."
%% set wbemServices = GetObject("winmgmts:\\" & strComputer)
%% set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")
%% For Each wbemObject In wbemObjectSet
%% Physical = wbemObject.TotalPhysicalMemory
%% Next
%% Set objFSO = CreateObject("Scripting.FileSystemObject")
%% Set objFile = objFSO.OpenTextFile("C:\Program Files\mIRC\Memory.txt", 2, 1)
%% objFile.Write("Physical " & Physical & " ")
%% objFile.Close
savebuf @@ write.vbs
window -c @@
.comopen run wscript.shell
.comclose run $com(run,run,3,bstr,wscript write.vbs,uint,5,bool,true)
.remove write.vbs
var %memory = $read(Memory.txt, s, Physical)
return %memory
}