Forums » MacOS X
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?
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.
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.
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.
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
...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
oo oo oo /me votes for a widget too
might riase game profile a bit too :)
might riase game profile a bit too :)
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 ;)
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 ;)
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
-:sigma.SB
Dashboard SDK? It's an XML file, an HTML file and a Javascript file. Do you really need a SDK for that?
I would hope not...
but you never know. Just get another widget. Thats your SDK for you, then just modify it a bit.
but you never know. Just get another widget. Thats your SDK for you, then just modify it a bit.
http://en.wikipedia.org/wiki/SDK
^says it all ;)
For those who have a broken mouse or something,
an SDK = software development kit.
^says it all ;)
For those who have a broken mouse or something,
an SDK = software development kit.
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
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?
Widget.
M. Duncan
M. Duncan
Yes.
bump
M. Duncan
M. Duncan
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>
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>
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. :)
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. :)
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.
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.
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
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
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.
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.