#(danjoe3) Filter items within an inventory

35 messages · Page 1 of 1 (latest)

thin sage
#

Hi there,
I'm currently creating this filter system for a player auction system and need some help. I've been using proc scripts to filter items through a server flag, checking if the item matches a data script, and showing those items alone within the inventory. I was able to do these filters successfully with the proc script, but I'm stuck in the other category. Here are the proc scripts to filter items accordingly - https://paste.denizenscript.com/View/120974
The other proc doesn't seem to filter the other items that are not within the data script or the item itself for some reason. If there is a way I can improve the script also, please do let me know!

elfin wigeonBOT
#

(danjoe3) Filter items within an inventory

elfin wigeonBOT
#

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.

molten meadow
#

!debug

buoyant sealBOT
# molten meadow !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

molten meadow
#

Send a debug demonstrating it not working

thin sage
# molten meadow Send a debug demonstrating it not working

https://paste.denizenscript.com/View/120976
Here is a video - https://streamable.com/bif2is
Would the filter_tag help in a situation like this?

Watch "Minecraft 1.20.4 - Multiplayer (3rd-party Server) 2024-03-13 02-10-05" on Streamable.

▶ Play video
#

I'm sorry if I pinged you there!!

molten meadow
#

Eh.. wait..

#

You had logic backwards in that proc

#

You say "if item isnt a tool add it to the list" and then "if its not in the farming list also add it to the list"

thin sage
#

Oh wait, so basically take it out of the list

#

Let me just reverse the arrow

molten meadow
#

That could work, you can also do
"If is tool, skip to next item"

#

!c foreach

buoyant sealBOT
# molten meadow !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...

molten meadow
#

See foreach continue

thin sage
#

Oh right, that worked wonders! Thank you!

winged flaxBOT
#
Resolved

Thread closed as resolved.

thin sage
#

I forgot to ask something else as well. I’m currently setting the inventory using the give command and allowing the items to go through the specific slots alone. With the auction command, id like to have the recently added items shown from the first slot itself and not start from the last. Is there anyway I can do this?

winged flaxBOT
#
Thread Reopened

Thread was manually reopened by @thin sage.

molten meadow
#

Eh things usually fill from start.. can you clarify what you are looking for?

thin sage
#

I’ll send over a video as to how it is now, give me a second!

thin sage
molten meadow
#

Reverse the list?

#

!t list reverse

buoyant sealBOT
molten meadow
#

!t list.reverse

buoyant sealBOT
warped minnow
#

Haven't read though the post, but you can also use

#

!t ListTag.insert

buoyant sealBOT
warped minnow
#

To add an item to a list at a specific position (I.e. the start), if that's what you're trying to do

thin sage
#

Awesome! Thank you!