#(behr) maptag usage question

43 messages · Page 1 of 1 (latest)

quick blade
#

!tag maptag.sort_b

atomic pawnBOT
# quick blade !tag maptag.sort_b

Returns a copy of the map, sorted alphanumerically by the value under each key.
Optionally, specify a tag to apply to the value.
To sort by key, use !tag MapTag.get_subset with list sort tags, like 'map.get_subset[map.keys.sort_by_value[...]]'.
This also lets you apply list filters or similar to the keyset.
To apply a '.parse' to the values, use !tag ListTag.map_with, like 'map.keys.map_with[map.values.parse[...]]'

Returns

MapTag

Examples
# Narrates a map of [a=1;b=2;c=3]
- narrate <map[c=3;a=1;b=2].sort_by_value>
# Narrates a map of [c=3;b=2;a=1]
- narrate <map[c=3;a=1;b=2].sort_by_value[mul[-1]]>
sacred krakenBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

quick blade
#

using this tag, i can sort my maptag by values under each key

#

how do i re-create a new map withj just the top five keys based on the sort value?

#

no, this is vague

#

i currently flag the server by their discord ID to give them:

- flag server behr.discord.users.<[user_id]>.experience:+:<[experience]>```
#

<[experience]> is just define experience <util.random.int[2].to[5]>

#

but the flag behr.discor.users.<[user_id]>.level also exists in additon to their experience

#

im looking for help on understanding how to format a tag that would indicate something like this:

old burrowBOT
#
Leaderboard for `Denizen and Citizens`

Click To View Full Leaderboard Online

Rank 1: @cyan flame (mcmonkey#6666): Level: 108, Total XP: 2,401,657
Rank 2: @quick blade (Hydra Melody#0001): Level: 79, Total XP: 1,000,576
Rank 3: @sand crescent (Mergu#0001): Level: 69, Total XP: 667,840
Rank 4: @heavy bison (Wahrheit#0001): Level: 64, Total XP: 548,715
Rank 5: @eternal quest (Xeane#0001): Level: 64, Total XP: 546,812
Rank 6: @obsidian escarp (The_Conductor): Level: 63, Total XP: 512,903
Rank 7: @sudden shuttle (calico-kid#0519): Level: 57, Total XP: 396,896
Rank 8: @main hearth (Xenmai): Level: 57, Total XP: 396,253
Rank 9: @brave portal (Icecapade#8825): Level: 57, Total XP: 389,408
Rank 10: @gloomy bough (zozer_firehood#7723): Level: 56, Total XP: 379,508

ivory briar
#

Is experience their total experience, or just the experience to the next level

brave portal
#

Total experience

#

xp to the next level is on the leaderboard

ivory briar
#

For sure, I meant more in Behr's usecase

brave portal
#

Oh I totally forgot behr and was focused on the denizen leaderboard kekw_dog

ivory briar
#

Lol

#

@quick blade If you're tracking their total experience, then sort by experience, and parse out the user. Not to mess up your schema here, but it would be easier if behr.discord.users was a list of maps

#

where each map was yaml user_id: blah level: blah experience: blah because then you could do

#

<[user_list].sort_by_value[get[experience]]>

#

And then the first 5 in userlist, you could just get their ids. <[userlist].first.get[user_id]>

brave portal
#

!t list.highest.count

atomic pawnBOT
# brave portal !t list.highest.count

Returns a list of the highest values in a list of decimal numbers.
Optionally specify a tag to run on each list entry that returns the numeric value for that entry.
Note: if you want to sort the entire list, rather than just getting a few values, use a sort tag like !tag listtag.sort_by_number

Returns

ListTag

Examples
# Narrates a list of '10|5'
- narrate "<list[3|2|1|10].highest.count[2]>
# Narrates the names of the 5 players with the most money currently online
- narrate <server.online_players.highest[money].count[5].parse[name].formatted>
brave portal
ivory briar
#

even better

#

he'd still need a list of maptags

brave portal
#

yep

#

Could also do something like

- define sorted_map <[map].sort_by_value[get[experience]]>
- define result <[map].get_subset[<[sorted_map].keys.get[1].to[10]>]>
bleak vigilBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@quick blade

quick blade
#

i

#

was literally just reading over this and .keys

#

shit

#

that's absolutely what i needed

#

thanks guys, gals, and toasters