Category Archives: My Programs - Page 3

New X-Fire Spammer

Well, it’s been a while and I decided to release a new version of the XFire Spammer.

In this update:

-Major GUI change

-Small bug fixes

Download now!

As with every program; I am not liable to what happens to your computer from using this software and visiting this website.

It’s been a while – Some PHP Code

Well, it’s been a while sense I last updated this… works being done on HE and some of my other projects. School’s almost over (one more day). Anyway, I recently created a sig generator for a game I play called Frag.Ops. A nice community member (known as Diesel_Fuel_Only) created a stats site for all the servers. It runs UTStatsDB with no modifications (other than images). I wanted to create sigs for the site, the only problem was he wouldn’t give me access to his MySQL databases because he’s kind-of a duche. Anyway, the work around was the parse the site directly, and build the sigs. He now made his own (that suck balls) so I decided to release the code I used to parse the site, as well as generate the images.

I split it into two classes. One to parse the site, and one to build the image. The image class is a php GD interface. The UTStatsDB parser is a different class. You enter the ID of the player you want, and the URL of the site pages, and it gathers some data about the player. A download link to the classes will be at the bottom of this post. First, heres and example of how to use them:

$thisID = 7;
$statObj = new statsParser($thisID, ‘http://www.fostats.com/fostats/playerstats.php?player=’, ‘http://www.fostats.com/fostats/index.php?stats=players’);

// Check stats
$mRank = $statObj->playerMissionRank;
if ($statObj->playerMissionRank == 0)
$mRank = ‘N/A’;

$wRank = $statObj->playerWarRank;
if ($statObj->playerWarRank == 0)
$wRank = ‘N/A’;

// Build Array
$text[0] = ‘Player: ‘ . $statObj->playerName;
$text[1] = ‘Total Kills: ‘ . $statObj->playerKills;
$text[2] = ‘Total Deaths: ‘ . $statObj->playerDeaths . ‘ KDR: ‘ . round($statObj->playerKills / $statObj->playerDeaths, 2);
$text[3] = ‘Mission Rank: ‘ . $mRank . ‘ War Rank: ‘ . $wRank;
$text[4] = ‘Overall Rank: ‘ . $statObj->playerOverallRank;
$totalText = 5;

// Make the image
$imageSys = new imgEditor(‘bgimg.png’, ”);
$imageSys->setFont(‘main.ttf’);
$imageSys->setSize(12);
$color[0] = 255;
$color[1] = 255;
$color[2] = 255;
$shade[0] = 150;
$shade[1] = 150;
$shade[2] = 150;

for ($iLoop2 = 0; $iLoop2 < $totalText; $iLoop2++)
$imageSys->addShadowText($text[$iLoop2], 5, 19 + (20 * $iLoop2), $color, $shade, 1);

$imageSys->outputToFile($thisID . ‘.png’, ‘./built_sigs/’);

This work is licensed under the Creative Commons Attribution-NoDerivs 3.0 United States. If you wish to use my work for the public (generate sigs/images for the public/more people than just yourself you must include “Generated using classes by Matt Razza” in the image you generate (or page if it’s just a stats page)). If it’s just for you, it’s not needed.

Download: Here

See the classes, and example code in action:

Merc Zboard “Driver” Version 0.1.1

NEW VERSION FOUND – HERE

Small update to my “driver” for the MERC Zboard on Linux.

READ THE README – and anything the shell scripts say.

Changelog:

==============================================
Zboard Config Changelog
Copyright (C) 2007 Matt Razza
==============================================

Version 0.1.0 – Version 0.1.1

Added:
-”status” command
-”checkZboard” command
-Added ability to remove existing maps to keys
-Added Zboard Compatibility tester

Changed:

Fixed:
-Changed all references of “Zboard config” to “Zboard Config”

Removed:

Download Source (tar.bz2) MD5: 557bb8594795f70cd0210a21ac8e0edc

Gentoo ebuild (provided by Ken).

License

MERC zBoard “Driver” Finished

This version is now deprecated; please visit this post.
Well, I finished my hacked together linux version of the zEngine. It’s command line only and should be pretty easy to use. I haven’t been able to test it too much, but it should work. I decided there was no point to an eBuild or Makefile so I included two small shell scripts you can run. READ THE README – and anything the shell scripts say.

Download Source (tar.bz2) MD5: 115b0a3e150d048b43bcfbfaa0276f05

License

MERC zBoard “Driver” Update

In order to get the MERC zBoard to detect running games and other applications (non-default) you are going to need to load a “custom” config file. The file structure is simple, it’s just “appName=settingsFile”. The settings file will be a xModMap readable file that my program will load when it detects the app running.

There is a possibility that you could crash the “driver” if you were to run two applications it can detect at once. In order to get around this problem I think I am going to have it only apply the settings for the first one executed (the one with the smaller PID).

MERC zBoard “Driver”

No, I’m not making a “driver” so to speak – however I am working on a problem to manage xModMap for the MERC zBoard. It will detect programs running and change the settings accordingly (based of some standard profiles you can change). Once I get it functional I may just make it an xModMap manager and not only for the zBoard. It’s about 2/3 done at the moment but I havn’t had much time to work on it (about three hours) so we’ll see. It is a pain, however, to learn the Linux API for C++; it’s like learning C++ all over again.

Benchmark Follow-up

Here’s some data to base the ratings off of:

Some lazy coding…

I made a simple bench marker… it runs some complicated math problems and rapidly saves stuff to ram, reads it, compares it to another location in memory, and clears the space. It can be downloaded at the link below (both x86 and x64 versions included). The archive is a 7zip file so you need a program that can extract it (google it if you don’t know what it is). My computer’s rating is: 905890 (the higher the better).

Download me!

Correct Coding Style

There is a correct way to write code in C++ (and any other lang but it’s different for each) and their is a wrong way. Both produce programs that work – and may work as fast. The correct way creates code that is easy to read – the wrong way creates code I refuse to read. For anyone that cared – this is what I say the right way is…

Spaces, spaces, spaces! - Place spaces before and after every operator!

Right:

if (foo == bar)

moosecow = hotshit + ass;

Wrong:

if (foo==bar)

moosecow=hotshit+ass;

Call in support we have Brackets! – Never place brackets on the same line as if/class definition!

Right:

If (moosecow == hey)

{

ADD CODE HERE

}

Wrong:

if (moosecow == hey) {

ADD CODE HERE

}

Those are the major ones; I agree almost 100% with this site (google cache).

New Pages

I created a few new pages (see left) that outline some of the programs I was/am working on that will be released to the public soon.