<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html">wPge - [Perl] xChat SysInfo for Windows</title>
	<link rel="self" href="/rewrite.php"/>
	<updated>2010-02-25T02:32:53Z</updated>
	<generator>FluxBB</generator>
	<id>http://www.wpge.org/topic/317/perl-xchat-sysinfo-for-windows/</id>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/102128/#p102128"/>
			<content type="html">[quote=.essence][quote=Unholy]brad deleted his post or am i tripping[/quote]
yeah i came back here and his post is gone, he thinks hes crafty or something[/quote]
brad never posted here wtf you guys on?</content>
			<author>
				<name>CHOEDY</name>
			</author>
			<updated>2010-02-25T02:32:53Z</updated>
			<id>http://www.wpge.org/post/102128/#p102128</id>
		</entry>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/102121/#p102121"/>
			<content type="html">[quote=.essence][quote=Unholy]brad deleted his post or am i tripping[/quote]
yeah i came back here and his post is gone, he thinks hes crafty or something[/quote]
huh?</content>
			<author>
				<name>Brad12</name>
			</author>
			<updated>2010-02-25T02:23:48Z</updated>
			<id>http://www.wpge.org/post/102121/#p102121</id>
		</entry>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/102028/#p102028"/>
			<content type="html">copy cats</content>
			<author>
				<name>Brick Tamland</name>
			</author>
			<updated>2010-02-24T20:18:12Z</updated>
			<id>http://www.wpge.org/post/102028/#p102028</id>
		</entry>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/102013/#p102013"/>
			<content type="html">[quote=Unholy]brad deleted his post or am i tripping[/quote]
yeah i came back here and his post is gone, he thinks hes crafty or something</content>
			<author>
				<name>.essence</name>
			</author>
			<updated>2010-02-24T19:06:37Z</updated>
			<id>http://www.wpge.org/post/102013/#p102013</id>
		</entry>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/101992/#p101992"/>
			<content type="html">brad deleted his post or am i tripping</content>
			<author>
				<name>Princess</name>
			</author>
			<updated>2010-02-24T16:59:20Z</updated>
			<id>http://www.wpge.org/post/101992/#p101992</id>
		</entry>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/101978/#p101978"/>
			<content type="html">Stupid Reines and his masters degree.</content>
			<author>
				<name>PoopFaceKiller</name>
			</author>
			<updated>2010-02-24T14:25:47Z</updated>
			<id>http://www.wpge.org/post/101978/#p101978</id>
		</entry>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/101974/#p101974"/>
			<content type="html">noobcode</content>
			<author>
				<name>Brick Tamland</name>
			</author>
			<updated>2010-02-24T12:28:41Z</updated>
			<id>http://www.wpge.org/post/101974/#p101974</id>
		</entry>
		<entry>
			<title type="html">Re: [Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/101948/#p101948"/>
			<content type="html">you cant take my joke.</content>
			<author>
				<name>.essence</name>
			</author>
			<updated>2010-02-24T04:09:01Z</updated>
			<id>http://www.wpge.org/post/101948/#p101948</id>
		</entry>
		<entry>
			<title type="html">[Perl] xChat SysInfo for Windows</title>
			<link rel="alternate" href="http://www.wpge.org/post/2849/#p2849"/>
			<content type="html">I prefer xChat over mIRC, but could not find any sysinfo script for windows for it, so decided to quickly make one. For anyone else using xChat on Windows, here it is (though it [b]might[/b] only work properly on Vista).

[quote] OS: [b]Microsoft® Windows Vista™ Ultimate[/b]
 CPU: [b]Intel(R) Core(TM)2 CPU 6600 @ 3420 MHz[/b]
 Mem: [b]2046 Mb (1102 Mb used)[/b]
 GFX: [b]NVIDIA GeForce 8800 GTX 768 Mb[/b]
 Screen: [b]SyncMaster 940BW/199BW/941BW, SyncMaster Magic CX915BW(Digital) @ 1440x900[/b]
 HDD: [b]1424.6 Gb (1152.5 Gb used)[/b][/quote]

[code]use strict;
use warnings;

my $version = 0.1;

Xchat::register(&quot;SysInfo&quot;, &quot;$version&quot;, &quot;SysInfo&quot;, &quot;&quot;);
Xchat::print(&quot;Loaded SysInfo v$version&quot;);
Xchat::hook_command(&#039;sysinfo&#039;, \&amp;sysinfo);

use Win32::OLE;

my $wmi = Win32::OLE-&gt;GetObject(&#039;winmgmts:\\\\.\\root\\cimv2&#039;);
my $datetime = Win32::OLE-&gt;new(&#039;WbemScripting.SWbemDateTime&#039;);

my $os = $wmi-&gt;InstancesOf(&#039;Win32_OperatingSystem&#039;);
my $procs = $wmi-&gt;InstancesOf(&#039;Win32_Processor&#039;);
my $hdds = $wmi-&gt;InstancesOf(&#039;Win32_LogicalDisk&#039;);
my $gfx = $wmi-&gt;InstancesOf(&#039;Win32_VideoController&#039;);
my $screens = $wmi-&gt;InstancesOf(&#039;Win32_DesktopMonitor&#039;);

sub sysinfo {
    foreach my $cur_os (in $os) {
        $datetime-&gt;{Value} = $cur_os-&gt;LastBootUpTime;
        Xchat::printf(&quot;OS:\002 %s&quot;, trim($cur_os-&gt;Caption));
        
        foreach my $cur_proc (in $procs) {
            Xchat::printf(&quot;CPU:\002 %s\002 @\002 %s MHz&quot;, format_procname($cur_proc-&gt;Name), $cur_proc-&gt;MaxClockSpeed);
        }
        
        Xchat::printf(&quot;Mem:\002 %.0f Mb (%.0f Mb used)&quot;, $cur_os-&gt;TotalVisibleMemorySize / 1024, $cur_os-&gt;FreePhysicalMemory / 1024);
        
        foreach my $cur_gfx (in $gfx) {
            Xchat::printf(&quot;GFX:\002 %s %.0f Mb @ %.0fx%.0f %.0f Hz&quot;, trim($cur_gfx-&gt;Caption), $cur_gfx-&gt;AdapterRAM / 1048576);
        }
        
        foreach my $cur_screen (in $screens) {
            Xchat::printf(&quot;Screen:\002 %s @ %.0fx%.0f&quot;, trim($cur_screen-&gt;Caption), $cur_screen-&gt;ScreenWidth, $cur_screen-&gt;ScreenHeight);
        }
        
        my $hdd_total = 0;
        my $hdd_used = 0;
        foreach my $cur_hdd (in $hdds) {
            next if !defined($cur_hdd-&gt;VolumeName);
            $hdd_total += $cur_hdd-&gt;Size;
            $hdd_used += ($cur_hdd-&gt;Size - $cur_hdd-&gt;FreeSpace);
        }
        
        Xchat::printf(&quot;HDD:\002 %.1f Gb (%.1f Gb used)&quot;, $hdd_total / 1073741824, $hdd_used / 1073741824);
    }
    
    return Xchat::EAT_ALL;
}

sub trim {
    $_[0] =~ s/^\s+//;
    $_[0] =~ s/\s+$//;

    return $_[0];
}

sub format_procname {
    $_[0] =~ s/\s+@.+//g;
    $_[0] =~ s/\s+/ /g;
    
    return $_[0];
}
[/code]

Edit: I&#039;m not too sure about the screen part. I have 2 and it is only returning one for some reason.</content>
			<author>
				<name>Reines</name>
			</author>
			<updated>2008-06-19T00:41:32Z</updated>
			<id>http://www.wpge.org/post/2849/#p2849</id>
		</entry>
</feed>
