#(fishjones_) list of items in inventory

102 messages · Page 1 of 1 (latest)

alpine shore
#

just trying to return a list of items that match a similar script name upon opening an enderchest, i've done a few variations of this but its not returning the list as items, ive tried .simple too but i cant get it to take the items

full pondBOT
#

(fishjones_) list of items in inventory

full pondBOT
#

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.

regal lynx
#

The list_content returns a list with item tags in it, you first have to loop trough the list.

#

!c foreach

crisp yachtBOT
# regal lynx !c foreach
Group

queue

Syntax

foreach [stop/next/<object>|...] (as:<name>) (key:<name>) [<commands>]

Short Description

Loops through a ListTag, running a set of commands for each item.

Description

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...

alpine shore
#

yea i tried that too i couldnt get it right

regal lynx
#

What did you try?

alpine shore
odd sphinx
#

foreach is only meant to be the actual list, not have any conditions in it

alpine shore
#

so a seperate if line under it?

cursive nightBOT
odd sphinx
#

correct

regal lynx
#

I would recommend reading the guide about loops.

odd sphinx
#

but also, there's no <context.item> for this event

alpine shore
#

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

odd sphinx
#

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

crisp yachtBOT
alpine shore
#

so ill scrap the define

#

gotcha

fallow forge
#

Also be aware that an item may not have a script tag and will error.

alpine shore
#

sorry im still confused 🥲

odd sphinx
#

there's no <context.item> for this event

alpine shore
#

ooh sorry i forgot, what would i put there to take the items then?

#

would the defined tag work?

odd sphinx
#

!tias

crisp yachtBOT
# odd sphinx !tias
Info: 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.

fallow forge
#

I'm not sure that'd even work.

#

An equals doesn't support wildcards?

odd sphinx
#

could use

#

!t starts_with

crisp yachtBOT
alpine shore
fallow forge
#

Why not matches?

fallow forge
#

Check if the script tag exists on the item.

#

Or.

#

!t objecttag.if_Null

crisp yachtBOT
# fallow forge !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.

Returns

ObjectTag

zenith skiff
#

!c take

crisp yachtBOT
# zenith skiff !c take
Group

item

Syntax

take [iteminhand/cursoritem/bydisplay:<name>/bycover:<title>|<author>/slot:<slot>/flagged:<flag>/item:<matcher>] (quantity:<#>) (from:<inventory>)

Short Description

Takes an item from the player.

Description

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...

zenith skiff
#

slot:<slot>

#

!t inventory.find_all_items

crisp yachtBOT
alpine shore
#

it says it has a script within the item

zenith skiff
#

just - take slot:<player.inventory.find_all_items[script_matcher_*]> quantity:64

fallow forge
alpine shore
#

its erroring on every item i just showed the enderchest one

fallow forge
#

Tek has a better solution if you're looking for all variants of an item script and plan to take them out.

zenith skiff
#

ya idk what ur exactly trying to do

#

if u explain more there might be multiple ways

fallow forge
alpine shore
#

haha yeah tek's solution worked

#

so simple

zenith skiff
#

sometimes it does sometimes it doesnt 💔

fallow forge
#

That feels like a !itworks

zenith skiff
#

why though it's not really hacky

fallow forge
#

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.

alpine shore
#

i got it to the point where it was running the if and reading the script but the '*' wasnt working

fallow forge
#

Especially since you say sometimes it doesn't work.

alpine shore
#

it was actually just looking for an *

zenith skiff
#

i meant for different commands

fallow forge
zenith skiff
#

eg for inventory command slot always takes a single value

alpine shore
ionic wadi
#

Good catch

#

But also why not use item:<matcher> to take all items that match script_matcher_*?

alpine shore
#

oh yeah that would work too

#

so just for clarification

#

i should not use this way?

ionic wadi
#

It's fine, but would probably be cleaner using item:<matcher> (which just removes all items that match the matcher you pass in)

fallow forge
#

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?

alpine shore
#

yeah this works, man idk how i overlook the most simple solutions

#

thank you everyone

fallow forge
#

No need for the foreach.

#

It's esentially pointless.

alpine shore
#

it needs to take multiple items doesnt it?

zenith skiff
alpine shore
#

i thought it would only take one

fallow forge
#

I think we're all a bit confused, that's what I get for playing warframe and trying to help.

alpine shore
#

hahaha no worries

zenith skiff
#

i lied u can specify a larger quantity

#

guess if u dont wanna calc it just have it as 999 or something

fallow forge
#

I swear theres a tag for getting the count of an item in the inventory.

zenith skiff
#

!t count

crisp yachtBOT
# zenith skiff !t count
Cannot Specify Searched Tag

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>.

zenith skiff
#

!t inventory.count

crisp yachtBOT
#
Possible Confusion

Did you mean to search for elementtag.font?

fallow forge
#

!t inventorytag.quantity_item

crisp yachtBOT
fallow forge
#

There we go.

zenith skiff
#

i hate the bot 💔

#

but ya item matcher and that for quantity also works

alpine shore
#

so many ways to do it and i missed them all lol

#

thank u everyone very helpful as usual!!!