#(fishjones_) list of items in inventory
102 messages · Page 1 of 1 (latest)
(fishjones_) list of items in inventory
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.
The list_content returns a list with item tags in it, you first have to loop trough the list.
!c foreach
queue
foreach [stop/next/<object>|...] (as:<name>) (key:<name>) [<commands>]
Loops through a ListTag, running a set of commands for each item.
Loops through a ListTag of any type. For each item in the ListTag, the specified commands will be ran for that list entry.
Alternately, specify a map tag to loop over the set of key/value pairs in the map, where the key will be <[key]> and the value will be <[value]>.
Specify "key:<name>" to set the key definition name (if unset, will be "key").
Specify "as:<name>" to set the value definition name (if unset, will be "value").
Use "as:__player" to change the queue's player link, or "as:__npc" t...
yea i tried that too i couldnt get it right
What did you try?
foreach is only meant to be the actual list, not have any conditions in it
so a seperate if line under it?
correct
I would recommend reading the guide about loops.
but also, there's no <context.item> for this event
oh yea true, but firstly the problem im having now is that its not returning a script name from the define so the if line isnt sending anyways
that also would have to be part of the if statement underneath it, since there's no such thing as ListTag.script
!g do that again
View the guide page 'Do That Again: Loops' at: https://guide.denizenscript.com/guides/basics/loops.html
Also be aware that an item may not have a script tag and will error.
sorry im still confused 🥲
there's no <context.item> for this event
ooh sorry i forgot, what would i put there to take the items then?
would the defined tag work?
!tias
Try it and see!
If somebody pulled this up for you, you're probably asking a question of the public channel that's easier and faster to figure out by just attempting your idea in-game and looking at the result of that attempt.
Returns whether the element starts with a specified element.
element checking
ElementTag(Boolean)
Why not matches?
I did warn of this.
Check if the script tag exists on the item.
Or.
!t objecttag.if_Null
If the object is null (or the tag errors), this will return the input object.
If the object isn't null, the input won't be parsed, and the original object will be returned.
For example, "<player.if_null[<npc>]>" will return the player if there is a player, and otherwise will return the NPC.
This functions as a fallback - meaning, if the tag up to this point errors, that error will be hidden.
ObjectTag
!c take
item
take [iteminhand/cursoritem/bydisplay:<name>/bycover:<title>|<author>/slot:<slot>/flagged:<flag>/item:<matcher>] (quantity:<#>) (from:<inventory>)
Takes an item from the player.
Takes items from a player or inventory.
If the player or inventory does not have the item being taken, nothing happens.
Using 'slot:' will take the items from that specific slot.
Using 'flagged:' with a flag name will take items with the specified flag name, see !language flag system.
Using 'iteminhand' will take from the player's held item slot.
Using 'cursoritem' will take from the player's held cursor item (as in, one that's actively being picked up and moved in an inventory scree...
Returns a list of the location of all slots that contains an item that matches the given item matcher.
Returns an empty list if there's no match.
Uses the system behind !language Advanced Object Matching.
ListTag
it says it has a script within the item
just - take slot:<player.inventory.find_all_items[script_matcher_*]> quantity:64
It's erroring on the ender chest.
its erroring on every item i just showed the enderchest one
Tek has a better solution if you're looking for all variants of an item script and plan to take them out.
I didn't know slot took multiple values.
sometimes it does sometimes it doesnt 💔
That feels like a !itworks
why though it's not really hacky
Would need a more experienced helper or dev to weigh in on that.
Only saying that because of meta not showing support for multiple values in the slot.
i got it to the point where it was running the if and reading the script but the '*' wasnt working
Especially since you say sometimes it doesn't work.
it was actually just looking for an *
i meant for different commands
An equal match for the wildcard won't work because it's reading it as *. You'd have to do - if <[my_definition_item]> matches my_cool_item_*:
eg for inventory command slot always takes a single value
this was what i was doing and it was still reading the *
Looks like it's a meta mistake, the command uses a list internally
Good catch
But also why not use item:<matcher> to take all items that match script_matcher_*?
oh yeah that would work too
so just for clarification
i should not use this way?
It's fine, but would probably be cleaner using item:<matcher> (which just removes all items that match the matcher you pass in)
Would the quantity of 64 only take so many though?
If you want to remove any and all, you'd need a greater quantity right?
yeah this works, man idk how i overlook the most simple solutions
thank you everyone
it needs to take multiple items doesnt it?
it only takes the first match
i thought it would only take one
I think we're all a bit confused, that's what I get for playing warframe and trying to help.
hahaha no worries
i lied u can specify a larger quantity
guess if u dont wanna calc it just have it as 999 or something
I swear theres a tag for getting the count of an item in the inventory.
!t count
Multiple possible tags: <DiscordReactionTag.count>, <MaterialTag.count>, <ListTag.count[<element>]>, <MaterialTag.count_max>, <MaterialTag.count_min>, <MobArenaArenaTag.wave_count>, <NationTag.town_count>, <skyblock.island_count>, <FactionTag.player_count>, <NationTag.player_count>, <TownTag.player_count>, <ListTag.lowest[(<tag>)].count[<#>]>, <WorldTag.gateway_count>, <InventoryTag.can_fit[<item>].count>, <LocationTag.spawner_count>, <ItemTag.spawner_count>, <ListTag.count_matches[<matcher>]>, <ListTag.highest[(<tag>)].count[<#>]>, <LocationTag.hive_bee_count>, <PlayerTag.pvparena.team.player_count>.
!t inventory.count
Did you mean to search for elementtag.font?
!t inventorytag.quantity_item
Returns the combined quantity of itemstacks that match an item matcher if one is specified,
or the combined quantity of all itemstacks if one is not.
Uses the system behind !language Advanced Object Matching.
ElementTag(Number)
There we go.