my first work: /nations scoreboard panel

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

User avatar
Katagrama
road tourist
road tourist
Posts: 86
Joined: 22 Nov 2008 18:31
Owned TM-games: TMNF
Location: Brazil

my first work: /nations scoreboard panel

Post by Katagrama » 09 Dec 2009 22:57

I did a "most players" panel (in red) below, and a most top1s panel (not shown in the screenshot):
Image
It is a modification in the fufi widgets plugin. It shows the number of players of each nation that joined the server (same as typing /nations). It also has the "top donators" modification by Milenco. Finally, I also added a Most Top1s panel that shows the players who have most top1s local records.
Instalation (you must have the fufi widgets plugin):
1) copy this file to your xaseco plugins folder.
2) In the "scoreboardlists" section of the "plugins/fufi/fufi_widgets_xaseco.xml" file, the field "<content>" must be "MostPlayers" for the nations panel, "chat_topdons" for the top donators panel and "MostTop1s" for the most top1s panel.

Needing help or a better explanation just ask. :1

Warning: All panels are working fine, but the most top1s panel is kind of slow, because it does one SQL query for each track. It takes about 4 seconds for a server with 800 tracks. If this upsets you, then download this version (without the most top1s panel). Feel free to help me doing a faster function (the function I created is the getMostTop1sList). If possible, with ONLY ONE query for ALL tracks. Thank you!
Last edited by Katagrama on 17 Dec 2009 13:26, edited 6 times in total.
Image

User avatar
k4nm4n
smooth traffic navigator
smooth traffic navigator
Posts: 262
Joined: 11 Feb 2008 10:30
Owned TM-games: TMUF
Location: Slovenia
Contact:

Re: my first work: /nations scoreboard panel

Post by k4nm4n » 10 Dec 2009 14:40

Tnx, I tried today and works great. I have an request if you're willing to do. Can you include even the Top Donators in this modification?

User avatar
Katagrama
road tourist
road tourist
Posts: 86
Joined: 22 Nov 2008 18:31
Owned TM-games: TMNF
Location: Brazil

Re: my first work: /nations scoreboard panel

Post by Katagrama » 11 Dec 2009 16:41

k4nm4n wrote:Can you include even the Top Donators in this modification?
Done! I included the top donators by Milenco in the first post. Not tested, but it should work. :D
Image

User avatar
k4nm4n
smooth traffic navigator
smooth traffic navigator
Posts: 262
Joined: 11 Feb 2008 10:30
Owned TM-games: TMUF
Location: Slovenia
Contact:

Re: my first work: /nations scoreboard panel

Post by k4nm4n » 11 Dec 2009 18:29

Great :thumbsup: :gobananas: I'll test now how it works.

edit: Works fine.

reaby
smooth traffic navigator
smooth traffic navigator
Posts: 214
Joined: 02 Jul 2009 21:24
Owned TM-games: TMUF

Re: my first work: /nations scoreboard panel

Post by reaby » 14 Dec 2009 16:03

My solution is following:
SELECT challengeid, playerid, min(score) FROM records GROUP BY challengeid ORDER BY score ASC;
Maybe not the best solution, but it should give the data you are seeking, but behold:

1) this returns all records on all tracks ever been played on server, so you may need to check and compare what tracks are still live, and what's buried.
2) query will not sum playersid's, you need to write function to do so.

-
Reaby

User avatar
Katagrama
road tourist
road tourist
Posts: 86
Joined: 22 Nov 2008 18:31
Owned TM-games: TMNF
Location: Brazil

Re: my first work: /nations scoreboard panel

Post by Katagrama » 14 Dec 2009 17:19

thanks for your help reaby, your query is returnig the correct top1 score for all tracks but it is not associating with the right playerid. For example:
Image
The top1 record for the challenge 444 is realy 4.40s but it was made by another player, not 15743. The player 15743 made 4,41s...
For some challenges it is correct. For example: the challenge 383, it is correct, the player 15888 has the record 4900...
But for most challenges it is not associating with the right player...
Image

User avatar
k4nm4n
smooth traffic navigator
smooth traffic navigator
Posts: 262
Joined: 11 Feb 2008 10:30
Owned TM-games: TMUF
Location: Slovenia
Contact:

Re: my first work: /nations scoreboard panel

Post by k4nm4n » 16 Dec 2009 08:47

Is this with ID's solved now?

User avatar
Katagrama
road tourist
road tourist
Posts: 86
Joined: 22 Nov 2008 18:31
Owned TM-games: TMNF
Location: Brazil

Re: my first work: /nations scoreboard panel

Post by Katagrama » 16 Dec 2009 12:59

k4nm4n wrote:Is this with ID's solved now?
No, it is not solved yet...
Just to make it clear, the nations panel and the top donators panel are working fine.
The ID's issue is related to the "most top1s" panel that I want to do.
Image

User avatar
Katagrama
road tourist
road tourist
Posts: 86
Joined: 22 Nov 2008 18:31
Owned TM-games: TMNF
Location: Brazil

Re: my first work: /nations scoreboard panel

Post by Katagrama » 16 Dec 2009 23:51

Finally! I did the most top1s panel that I wanted so much (link and instructions updated on the first post). But it is kind of slow, because it does one SQL query for EACH track. It takes about 4 seconds for a server with 800 tracks. I need help to do a faster function (the function I created is the getMostTop1sList). If possible, doing ONLY ONE query for ALL tracks. Thank you!
Image

jamie_macdonald
TM-Patrol
TM-Patrol
Posts: 1612
Joined: 10 Jul 2008 19:48
Owned TM-games: TMUF, TMNF, TMS
Manialink(s): ET
Location: London, UK
Contact:

Re: my first work: /nations scoreboard panel

Post by jamie_macdonald » 19 Dec 2009 08:39

Thankyou katagrama,

Seems to work fine, very nice option for the top panels and kind of you to share.

Appreciated ^^

User avatar
k4nm4n
smooth traffic navigator
smooth traffic navigator
Posts: 262
Joined: 11 Feb 2008 10:30
Owned TM-games: TMUF
Location: Slovenia
Contact:

Re: my first work: /nations scoreboard panel

Post by k4nm4n » 19 Dec 2009 12:59

Katagrama wrote: Just to make it clear, the nations panel and the top donators panel are working fine.
The ID's issue is related to the "most top1s" panel that I want to do.
I misunderstood the post. Now I get it. :thumbsup:

User avatar
szkodnik
cyclist
cyclist
Posts: 30
Joined: 17 Aug 2009 16:27
Owned TM-games: TMU, TMS, TMO
Manialink(s): tmtp://#join=szkodziu
Location: Poland, Szczecin

Re: my first work: /nations scoreboard panel

Post by szkodnik » 21 Dec 2009 11:52

Most players from nations on scoreboardlist? Useless imo. I'm going to add fufi with Top Nation ranks but I don't know when ; )

http://img192.imageshack.us/img192/1479/40198322.jpg check it
I don't know english, PHP and MySQL but I scratch along ; )
TM accs: 20szn, szkodziu, szkodnisia

User avatar
Katagrama
road tourist
road tourist
Posts: 86
Joined: 22 Nov 2008 18:31
Owned TM-games: TMNF
Location: Brazil

Re: my first work: /nations scoreboard panel

Post by Katagrama » 21 Dec 2009 16:02

szkodnik wrote:I'm going to add fufi with Top Nation ranks but I don't know when ; )
What do you mean by "Top Nation ranks"?? :?:
Image

User avatar
szkodnik
cyclist
cyclist
Posts: 30
Joined: 17 Aug 2009 16:27
Owned TM-games: TMU, TMS, TMO
Manialink(s): tmtp://#join=szkodziu
Location: Poland, Szczecin

Re: my first work: /nations scoreboard panel

Post by szkodnik » 21 Dec 2009 16:24

Nation Rank = propably 10 best players ranks from country and average from this
In Top Clans I have average from 3 best players ranks from every team
I don't know english, PHP and MySQL but I scratch along ; )
TM accs: 20szn, szkodziu, szkodnisia

User avatar
Katagrama
road tourist
road tourist
Posts: 86
Joined: 22 Nov 2008 18:31
Owned TM-games: TMNF
Location: Brazil

Re: my first work: /nations scoreboard panel

Post by Katagrama » 21 Dec 2009 17:14

cool
I liked the wins/hours idea. Would you mind sharing the code? :thumbsup:
Image

Post Reply