The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rank out of Tags
Author Message
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #1
Rank out of Tags
Hey!

I would like some advice on how to make/start a rank board out of TAGS.

Just for an example, not a real one:

Code:
*Player kills a monster*
SRC.TAG.MONSTERKILL=(<EVAL <SRC.TAG.MONSTERKILL>> + 1)

How can I make a rank from all players listing the ones with the highest MONSTERKILL tag?

I'm seriously lost here.

Thanks everyone!
10-25-2013 07:55 PM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Rank out of Tags
Take a look at this top player board by soulless http://forum.spherecommunity.net/sshare....wnload=249
There's all sorts in "Downloads" but it doesn't show up with a forum search

[Image: 2nis46r.jpg]
10-25-2013 08:41 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #3
RE: Rank out of Tags
First, thank you Mordaunt! Always helpful.
I tried editing, but it seems more complicated than I thought.

While it works smoothly with fame/kills/karma/etc, when I try to add my own argv/tag it doesn't work.

For example, the argv is fame, so it uses: ref2.fame... ok, that will work.

Or karma: ref2.karma... just fine too.

Now,
If I use "monsterkill", it uses: ref2.monsterkill... that won't work, cause sphere doesn't know that..

Can you or someone explain how I could turn monsterkill to be readable?

Thanks again everyone!
(This post was last modified: 10-26-2013 11:13 AM by pinku.)
10-26-2013 10:51 AM
Find all posts by this user Like Post Quote this message in a reply
Rattlehead
Master
**

Posts: 290
Likes Given: 3
Likes Received: 8 in 6 posts
Joined: Jun 2012
Reputation: 8



Post: #4
RE: Rank out of Tags
ref2.tag.monsterkill

remember tags arent something u can call by their name without prefixing it with 'tag'

karma, u can reference by src.karma, but if u want to reference a tag on src it has to be referenced like src.tag.monsterkill or <src.tag0.monsterkill>

[Image: matts_siggy.gif]
10-26-2013 02:54 PM
Find all posts by this user Like Post Quote this message in a reply
xwerswoodx
Journeyman
*

Posts: 86
Likes Given: 4
Likes Received: 7 in 4 posts
Joined: Jun 2012
Reputation: 0

UoMMO

Post: #5
RE: Rank out of Tags
use mysql, insert table the values of tag and after you can sort it

http://www.phpeasystep.com/mysql/11.html
10-28-2013 08:02 AM
Find all posts by this user Like Post Quote this message in a reply
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #6
RE: Rank out of Tags
@Mordaunt & Rattlehead:
It turns out this script only "ranks" the online players.. that wasn't exactly what I was looking for.. Sad
Is there another way?

@xwerswoodx
Isn't there a way out of MySQL? I do not intend to use it on my server.. Plus, I tend to have a lot of problems with it.. lol

I have more or less an idea, but it's one rank person, doesn't really help me out..

Code:
Player logins.
Checks if Player tag is higher than VAR Server Record.
If yes, set new server record... if not, nope.

But how could I extend it to let's say... 10 players?
If I make 9 other VARs using the same system, that won't work, since the highest player will set the record for all 10 VARs when he logins..

Ideas?

Thanks everyone!
(This post was last modified: 11-05-2013 08:32 PM by pinku.)
11-05-2013 08:31 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #7
RE: Rank out of Tags
Use a LIST structure to store the data... not a set of VARs. Then sort the list however you want to before the dialog that displays it.

Here is an example function to sort a poker card hand that is stored in a LIST structure:

Code:
[FUNCTION f_Poker_SortCards]
//"
// Usage: f_Poker_SortCards CardArray
//
// Sorts an existing LIST object named CardArray, which is assumed to contain
// CardSymbols.  The sort order has highest ranked cards (Ace) first (suit is
// ignored.)
//"
IF (<ARGV>==0)
   f_pokerlog 1,"Poker_SortCards: needs a CardArray"
   RETURN 1
ENDIF
LOCAL.Input=<ARGS>
LOCAL.InputSize=<LIST.<LOCAL.Input>.COUNT>
IF (<LOCAL.InputSize> < 2)
   f_pokerlog 1,"Poker_SortCards: CardArray <LOCAL.Input> is too small to sort"
   RETURN 1
ENDIF
LOCAL.Swapped=1
WHILE (<dLOCAL.Swapped>==1)
   LOCAL.Swapped=0
   FOR LoopNumber 1 <EVAL <LOCAL.InputSize>-1>
      IF (<LOCAL.LoopNumber>)
         LOCAL.CardA="<STRSUB 1 2 <LIST.<LOCAL.Input>.<EVAL <LOCAL.LoopNumber>-1>>>"
         LOCAL.CardB="<STRSUB 1 2 <LIST.<LOCAL.Input>.<dLOCAL.LoopNumber>>>"
         IF (<f_Poker_RankCards <LOCAL.CardA>,<LOCAL.CardB>>==-1) //CardA ranks lower than CardB
            LIST.<LOCAL.Input>.<EVAL <LOCAL.LoopNumber>-1>=<LOCAL.CardB>
            LIST.<LOCAL.Input>.<dLOCAL.LoopNumber>=<LOCAL.CardA>
            LOCAL.Swapped=1
         ENDIF
      ENDIF
   ENDFOR
   LOCAL.InputSize=<EVAL <LOCAL.InputSize>-1>
ENDWHILE
11-06-2013 10:16 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)