Difference between revisions of "ObjectType:system"

From Lavish Software Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 6 users not shown)
Line 2: Line 2:
  
 
== Members ==
 
== Members ==
*[[DataType:string|string]] '''OS''':  Operating system identifier (e.g. Microsoft Windows XP)
+
*[[ObjectType:string|string]] '''OS''':  Operating system identifier (e.g. Microsoft Windows XP)
*[[DataType:int|int]] '''MemFree''': Amount of free physical system RAM, in megabytes
+
*[[ObjectType:uint|uint]] '''MemoryUsage''': Amount of memory used by this process (the uplink or session), in bytes
*[[DataType:int|int]] '''MemTotal''': Total amount of physical system RAM, in megabytes
+
*[[ObjectType:uint|uint]] '''MemFree''': Amount of free physical system RAM, in megabytes
*[[DataType:string|string]] '''OSBuild''': Operating system build identifier (e.g. 2600.xpsp_sp2_rtm040803-2158)
+
*[[ObjectType:uint|uint]] '''MemTotal''': Total amount of physical system RAM, in megabytes
*[[DataType:int|int]] '''GetProcAddress['''module''','''function''']''': Retrieves the address of an exported function, usually in a DLL. (Level of understanding: High)
+
*[[ObjectType:string|string]] '''OSBuild''': Operating system build identifier (e.g. 2600.xpsp_sp2_rtm040803-2158)
*[[DataType:int|int]] '''TickCount''': A timestamp given in milliseconds.  This value does "wrap" every 46 days or so.
+
*[[ObjectType:uint|uint]] '''GetProcAddress['''module''','''function''']''': Retrieves the address of an exported function, usually in a DLL. (Level of understanding: High)
*[[DataType:string|string]] '''CurrentDirectory''': Current directory according to the operating system
+
*[[ObjectType:uint|uint]] '''TickCount''': A timestamp given in milliseconds.  This value does "wrap" every 46 days or so.
 +
*[[ObjectType:filepath|filepath]] '''CurrentDirectory''': Current directory according to the operating system
 +
*[[ObjectType:string|string]] '''RegistryValue['''hklm/hkcu''','''key''','''value''']''': Retrieve a REG_DWORD, REG_SZ, or REG_EXPAND_SZ value from the system registry
  
 
== Methods ==
 
== Methods ==
 +
  
 
== Returns ==
 
== Returns ==
Line 16: Line 19:
  
 
== Examples ==
 
== Examples ==
 +
===Display system type===
 +
echo ${System}
 +
;Output
 +
Microsoft Windows XP
 +
===Create a HUD element displaying memory information===
 +
HUD -add Memory 1,1 MemoryUsage:${System.MemFree}/${System.MemTotal} MB
 +
===Play a sound===
 +
; Note: System:APICall is deprecated, and not available in 64-bit
 +
method playSound(string s)
 +
{
 +
  SoundToPlay:Set[${s}]
 +
 +
  if ${LavishScript.RunningTime} > ${soundTimeDelay}
 +
  {
 +
    soundTimeDelay:Set[${LavishScript.RunningTime}+(${soundDelay}*1000)]
 +
    System:APICall["${System.GetProcAddress["WinMM.dll","PlaySound"].Hex}",${SoundToPlay}.String,0,"Math.Dec[22001]"]
 +
  }
 +
}
 +
===Retrieve a registry value===
 +
variable string myDoc
 +
myDoc:Set["${System.RegistryValue[hkcu,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",Personal].Escape}"]
 +
echo ${myDoc.Escape}
 +
 +
===
 +
 +
== Operates On ==
 +
''none''
  
 
== See Also ==
 
== See Also ==
* [[LavishScript:Data Types|Data Types]]
+
{{LavishScript:ObjectType}}
 
 
[[Category:LavishScript]]
 

Latest revision as of 22:49, 29 October 2018

Description

Members

  • string OS: Operating system identifier (e.g. Microsoft Windows XP)
  • uint MemoryUsage: Amount of memory used by this process (the uplink or session), in bytes
  • uint MemFree: Amount of free physical system RAM, in megabytes
  • uint MemTotal: Total amount of physical system RAM, in megabytes
  • string OSBuild: Operating system build identifier (e.g. 2600.xpsp_sp2_rtm040803-2158)
  • uint GetProcAddress[module,function]: Retrieves the address of an exported function, usually in a DLL. (Level of understanding: High)
  • uint TickCount: A timestamp given in milliseconds. This value does "wrap" every 46 days or so.
  • filepath CurrentDirectory: Current directory according to the operating system
  • string RegistryValue[hklm/hkcu,key,value]: Retrieve a REG_DWORD, REG_SZ, or REG_EXPAND_SZ value from the system registry

Methods

Returns

Same as OS

Examples

Display system type

echo ${System}

Output
Microsoft Windows XP

Create a HUD element displaying memory information

HUD -add Memory 1,1 MemoryUsage:${System.MemFree}/${System.MemTotal} MB

Play a sound

Note
System:APICall is deprecated, and not available in 64-bit
method playSound(string s)
{
  SoundToPlay:Set[${s}]

  if ${LavishScript.RunningTime} > ${soundTimeDelay}
  {
    soundTimeDelay:Set[${LavishScript.RunningTime}+(${soundDelay}*1000)]
    System:APICall["${System.GetProcAddress["WinMM.dll","PlaySound"].Hex}",${SoundToPlay}.String,0,"Math.Dec[22001]"]
  }	
}

Retrieve a registry value

variable string myDoc
myDoc:Set["${System.RegistryValue[hkcu,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",Personal].Escape}"]
echo ${myDoc.Escape}

=

Operates On

none

See Also

LavishScript Object Types