Forums » MacOS X

Active players widget

12»
May 06, 2005 macguy link
So devs, is there some special URL that will just give you a list of active players and their nation? This would be needed to make a widget that could display the current active players. I know you'd need to be logged in to access it, but the widget would just have people log in anyway. So, how about the URL?
May 06, 2005 jjoonathan link
I already asked for this in my other thread...

so, um, x2

But in the meantime, I see no need for a widget. Whats the advantage? The status bar item seems to fit better than a widget in this case, because it is right there rather than a button away.
May 06, 2005 macguy link
If you could alter it to show everyone who is currently active in game along with their nation, that I wouldn't be asking for a widget :). Don't think I'm trying to discredit your program by asking for a widget.
May 07, 2005 everman7 link
make that x3, cuz I asked for it in another thread as well.

...or....

bump!

I think that i'd rather have the menu-bar like list, but whatever is easiest would be OK by me.

kernel.panic
May 07, 2005 Black Omega link
oo oo oo /me votes for a widget too

might riase game profile a bit too :)
May 07, 2005 jjoonathan link
Ok, first of all there must be some sort of bug in the API for NSStatusBarItem. The below code generates an NSInternalInconsistency exception claiming that the menu is already inserted:

NSMenu *otherPeople = [[NSMenu alloc] init];
NSMenuItem *otherPeopleMenuItem = [[NSMenuItem alloc] init];
[otherPeopleMenuItem setTitle:@"Everyone Else"];
[otherPeopleMenuItem setMenu:otherPeople];
[statusBarItemMenu addItem:otherPeopleMenuItem];

Yet there is no way it can have already been inserted somewhere else... Yet other menu items seem to be able to handle submenus (but then again they are not using NSStatusItem...) I guess I will just add the list of everyone at the bottom of the menu, though that is probably not the best choice from a UI point of view. But then again, neither is a widget (you would have to scroll it beyond say 5 characters)...

So I have updated the download so there is now an option to show everyone below the Prefs/Quit/Launch VO option, and once I get this issue worked out maybe it will be put into a menu and be more readable ;)
May 08, 2005 Solra Bizna link
When I first saw this thread, I thought "Perfect opportunity to make a GAIM buddy ticker style VO Active Players Dashboard widget." After a few minutes of searching, though, I realized I didn't have the Dashboard SDK and was too lazy to get it. I'm somehow not surprised.
-:sigma.SB
May 08, 2005 roguelazer link
Dashboard SDK? It's an XML file, an HTML file and a Javascript file. Do you really need a SDK for that?
May 08, 2005 jjoonathan link
I would hope not...

but you never know. Just get another widget. Thats your SDK for you, then just modify it a bit.
May 09, 2005 jjoonathan link
http://en.wikipedia.org/wiki/SDK

^says it all ;)

For those who have a broken mouse or something,
an SDK = software development kit.
May 09, 2005 roguelazer link
Still irrelevant, however. Mayhap I'll make a vo widget sometime. I just gotta get Inkscape working on OS X, then I'll do it. :D
May 10, 2005 jjoonathan link
Actually, on an unrelated note are there any hacker-guilds (not hacker as in cheater, hacker as in higher-than-average-comp-ability) for VO?
Jun 28, 2005 mdaniel link
Widget.

M. Duncan
Jul 04, 2005 Borb II link
Yes.
Sep 08, 2005 mdaniel link
bump

M. Duncan
Sep 11, 2005 sinclair44 link
I just put together a perl script to pull only the table and nation counts from the active players page. Since I'm not a JavaScript person at all, putting together a widget might be kinda troublesome... I'll try it later anyways.

In any case, here's some perl code to pull the table. This could be called from JavaScript and then inserted into a <div>. Note that 3 styles are also necessary.

*****

#!/usr/bin/perl

use warnings;
use strict;

my $rawhtml = `curl -s http://www.vendetta-online.com/h/active.html`;

die "Error retrieving web page. (Exit code $?.)\n" if ($?);

unless ($rawhtml =~ qr#(<table border="0" align=center cellspacing=2 cellpadding=2 width="95%">.+</tr></table>(\d+) players -- (\d+) <font class=itani>Itani</font>, (\d+) <font class=serco>Serco</font>, (\d+) <font class=neutral>UIT</font>)</div>#s)
{
die "Error parsing web page for table.\n";
}

my $table = $1;

$table =~ s/align=center//;
$table =~ s/width="95%"//;

print $table;

*****

<style>
FONT.Itani {
color:#4080ff;
}

FONT.Serco {
color:#ff4060;
}

FONT.Neutral {
color:#ffc040;
}
</style>
Sep 11, 2005 sinclair44 link
It's done. I'll post it tomorrow (out of time tonight).

Hope you guys enjoy it! Due to my inability to leave an interesting problem alone once I've started it, I've worked about 6 hours or so on this today. But I finally got it done. :)
Sep 12, 2005 sinclair44 link
Widget now available.

http://www.watzmanassociates.com/josh/programming/downloads/VendettaPlayers-1.0.wdgt.tgz

Feedback is welcome, but don't count on any major changes... I don't intend to work on this much more. If I drop it, though, someone else is perfectly welecome to pick it up.
Sep 12, 2005 ctishman link
Very nice! Installed and sitting on my dashboard!

Edit: Any chance you could stick a local version of the forum background image as the bg for the widget? The address is

http://images.vendetta-online.com/images/page_main_05.jpg
Sep 12, 2005 Suicidal Lemming link
I made a different background using the one ctishman linked.
http://lemming.localnetsys.com/Default.png
Right click the widget and click show package contents. Widgets you install are found in the "Widgets" folder, in your "Library" folder, which is in your user's folder.
Replace Default.png with the one above.
Open VendettaPlayers.css
Add the line below to "#topBar" and ".mainContent" anywhere between the {}'s
color: white;
This makes the text readable.