#(yyykilla_3) How to format map properly?

51 messages · Page 1 of 1 (latest)

paper sequoia
#

Hi! How do i avoid these type of maps:
map@[upm=map@[__value=map@[dashes=map@[__value=3]]]]?
I'm really annoying by it, i just wanna
map@[ump=map@[dashes=3;something=foobar]]

Im using this:
/ex inventory flag slot:hand upm.dashes:3
and this:
/ex inventory flag slot:hand upm:<map[dashes=3]>
Result is the same

snow flumeBOT
#

(yyykilla_3) How to format map properly?

snow flumeBOT
#

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.

lament turtle
#

the format best to use varies depending on how you want to actually use it in a script, or if you're just testing/one-time running things using /ex as you mentioned

#

if a command takes a maptag as input, you can just put [dashes=3;something=foobar]
but if you're using flags, you can also just use flag nodes in general

#

!command inventory usage

teal parcelBOT
# lament turtle !command inventory usage
Group

item

Syntax

inventory [open/close/copy/move/swap/set/keep/exclude/fill/clear/update/adjust <mechanism>:<value>/flag <name>(:<action>)[:<value>] (expire:<time>)] (destination:<inventory>) (origin:<inventory>/<item>|...) (slot:<slot>)

Short Description

Edits the inventory of a player, NPC, or chest.

Use to open a chest inventory, at a location.
- inventory open d:<context.location>
Use to open a virtual inventory with a title and some items.
- inventory open d:generic[size=27;title=BestInventory;contents=snowball|stick]
Use to open another player's inventory.
- inventory open d:<[player].inventory>
Use to remove all items from a chest, except any items in the specified list.
- inventory keep d:<context.location.inventory> o:snowball|ItemScript
Use to remove all sticks and stones from the player's inventory.
- inventory exclude origin:stick|stone
Additional Usage Examples

... and 5 more.

lament turtle
#

eg, /ex inventory flag slot:hand upm.dashes:3

#

but if you're using multiple nodes in a script, you can also use this to construct a maptag:

#

!tag definemap

teal parcelBOT
#
Possible Confusion

Did you mean to search for plotsquaredplottag.denied?

lament turtle
#

er

#

!command definemap

teal parcelBOT
lament turtle
#

!guide definitions

teal parcelBOT
lament turtle
#

or, you can use data script containers

#

!lang data script container

teal parcelBOT
# lament turtle !lang data script container

Data script containers are generic script containers for information that will be referenced by other scripts.

No part of a 'data' script container is ever run as commands.

There are no required keys.

Generally, data is read using the !tag ScriptTag.data_key tag.


data_script_name:

    type: data

    # Your data here
    some_key: some value
    some_list_key:
    - some list value
    some_map_key:
        some_subkey: some value


Group

Script Container System

lament turtle
#

or, you can use yaml

#

or, you can use existing flags

#

there are various ways to do what you're doing, it's vague without more clear information of what your goal is and what works best for your scripts

round rover
paper sequoia
round rover
pale surge
#

!t flag_map

teal parcelBOT
# pale surge !t flag_map
Cannot Specify Searched Tag

Multiple possible tags: <server.flag_map[<name>|...]>, <FlaggableObject.flag_map[<name>|...]>.

pale surge
#

!t FlaggableObject.flag_map

teal parcelBOT
# pale surge !t FlaggableObject.flag_map

Returns a raw map of the objects internal flag data for the flags with the given flag name. Names must be root names (no '.').
Output is a MapTag wherein each key is a flag name, and each value is a MapTag, containing keys '__value' and '__expiration', where '__value' contains the real object value.
Output also may contain key '__clear', which is a ListTag of flags that were listed in input but weren't present in output.
Using this without a parameter to get ALL flags is allowed exclusively for debug/testing reasons, and should never be used in a real script.
See !language flag system.

Returns

MapTag

pale surge
#

^ see the docs, it's a debugging tool that intentionally returns the internal Denizen format as opposed to the readable script format

#

!xy

teal parcelBOT
# pale surge !xy
Info: xy

Your question seems to be an XY Problem - you're asking about your attempted solution rather than your original problem.
Read in detail about the XY Problem here: http://xyproblem.info/

For an example of an XY Problem we've seen in Denizen, the question "how do I make an event for when a flag expires" has no answer, but the same question asked with full background detail will be something more like "I have this script: [LINK HERE], which sets a 3 minute cooldown flag on a player for when they use an ability. I want the player to be notified when the cooldown completes - how do I do this?" which we can then answer quite effectively (in this example, all that was needed was a simple wait command, no events or flag-listening or anything).

pale surge
#

What are you trying to do that requires getting an object's flag map?

paper sequoia
#

My post is about ugly formatting of said flag map.
Thing is, sometimes it looks like
map@[foo=map@[fofo=barbar]] and sometimes like this unreadable monstrocity

pale surge
#

What are you trying to make that requires this tag?

#

Tbc, it's like that on purpose - the only real use case for this tag is e.g. debugging tools, where you would want the full internal data with the value, expiry, etc.

#

Which is why I'm pulling up !xy

paper sequoia
#

to debug with readable format*

#

and to confirm that this is okay to have this format

wind token
#

If you want a readable map for debugging you could

patent wingBOT
dapper gyro
#

It's fine to use it for debugging purposes.

pale surge
#

Yeah if you want it for debugging that's fine, in which case that format is good as you're getting the actual full flag data (including e.g. expiry durations)

quartz quailBOT
#
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.)

#

@paper sequoia

paper sequoia
#

thanks guys, will try!