if you have 7 buttons and they are each 32px in width, that's 224. now subtract that from the panel width and divide it by 2. that gives you the x co-ordinate of where the first button should be....
var but_x = Math.round((p.w - 224) / 2);
use but_x for the first button and then increment each one by 32 (but_x + 32, but_x + 64 etc)
you also need to make sure you call the b.update() function inside the on_size function like this...
function on_size() {
p.size();
b.update();
}
This shouldn't be hard at all, but i'm missing something...
That's the panel where i'd like to center the icons:

That's how i edited your original weblinks script:
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common7.js"
// @name "Web Links"
// @author "marc2003. Images by komodomedia.com and mjm716"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
var p = new panel("Web Links", ["custom_background", "metadb"]);
p.version = "7.2013-04-20.02";
p.filename = "web links.txt";
var b = new buttons();
var but_x = Math.round((p.w - 224) / 2);
p.check_version();
b.update = function() {
if (!p.metadb) return;
var artist = encodeURIComponent(p.eval("%artist%"));
var title = encodeURIComponent(p.eval("%title%"));
var lastfm = "http://www.last.fm/music/" + artist + "/_/" + title;
var google = "https://www.google.co.uk/search?q=" + artist;
var wikipedia = "http://en.wikipedia.org/wiki/" + artist;
var youtube = "http://www.youtube.com/results?search_query=" + artist + "+" + title;
var discogs = "http://www.discogs.com/search?q=" + artist;
var myspace = "http://www.myspace.com/search/music?q=" + artist;
var allmusic = "http://www.allmusic.com/search/artists/" + artist;
b.buttons = {
lastfm: new button(but_x, 0, 32, 32, {normal: "lastfm.png", hover: "lastfm_h.png"}, function() { p.browser(lastfm); }, lastfm),
google: new button(but_x+32, 0, 32, 32, {normal: "google.png", hover: "google_h.png"}, function() { p.browser(google); }, google),
youtube: new button(but_x+64, 0, 32, 32, {normal: "youtube.png", hover: "youtube_h.png"}, function() { p.browser(youtube); }, youtube),
wikipedia: new button(but_x+96, 0, 32, 32, {normal: "wikipedia.png", hover: "wikipedia_h.png"}, function() { p.browser(wikipedia); }, wikipedia),
discogs: new button(but_x+128, 0, 32, 32, {normal: "discogs.png", hover: "discogs_h.png"}, function() { p.browser(discogs); }, discogs),
myspace: new button(but_x+160, 0, 32, 32, {normal: "myspace.png", hover: "myspace_h.png"}, function() { p.browser(myspace); }, myspace),
allmusic: new button(but_x+192, 0, 32, 32, {normal: "allmusic.png", hover: "allmusic_h.png"}, function() { p.browser(allmusic); }, allmusic),
}
window.Repaint();
}
on_item_focus_change();
function on_size() {
p.size();
b.update();
}
function on_paint(gr) {
p.draw_background(gr);
b.draw(gr);
}
function on_metadb_changed() {
b.update();
}
function on_mouse_move(x, y) {
b.move(x, y);
}
function on_mouse_lbtn_up(x, y) {
b.lbtn_up(x, y);
}
And that's how i end up having the panel:

There's no doubt i'm a noob, sorry...