#(dqniwan) GUI Help

121 messages ยท Page 1 of 1 (latest)

rough juniper
#

Hey guys,
I recently created this GUI where I'm trying to make it so that when a player inserts a certain item in the GUI, it automatically goes into slot:12 of the Inventory GUI. Whether the player shift clicks the item, drags, or clicks the item in it just goes into slot 12. It sets the slot, and the player has the choice to take it back if needed to.

I don't know if its understandable ๐Ÿ˜ฌ

honest pathBOT
#

(dqniwan) GUI Help

honest pathBOT
#

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>

worthy osprey
#

You'd listen to relevant inventory events and set the item in the 12 slot

rough juniper
# worthy osprey Well, what's the question?

I'd like to know how one could do that. The thing is I set the slot as slot:12 on the event on player drags wooden_shovel in mechanic_inventory I also did click and shift right and shift left too. I don't know what else to do after that as I'm still trying to learn about inventory mechanics ๐Ÿ˜ฌ

#

I can send a code of it, if you'd like?

#

!paste

ember wolfBOT
rough juniper
#

The reason why I kept the determine passively cancelled is because I don't want players to take the item from the GUI

#

And the last event, I wanted to make sure that players don't put anything else into the GUI, but it doesn't allow them to move anything at all. I intended it to be like, if a player puts an item that isn't intended it just goes back into the inventory

#

This event doesn't seem to do that ๐Ÿ˜ฌ

rough juniper
#

Let me know if I'm doing it wrong ๐Ÿ˜ฌ

rough juniper
#

Is this not possible? Or have I made it confusing?

rough juniper
#

๐Ÿ˜ฌ

rough juniper
#

I can try and create a picture to show you how I planned ๐Ÿ˜ฌ

rough juniper
#

Is there a way to have the GUI feature set true for some instance and false for another?

#

As in, I'd like players to move around things around the inventory when they have the GUI inventory open, but I;d only want certain things to be kept in the GUI

#

I dont know if that sounds just vague...

tulip violet
warm sail
#

You forgot to specify the destination

#

If this inventory is only allowing you to click one or very specific slots then maybe you want the gui key in your inventory script container so it default cancels any actions inside of the inventory, that way you can just check for on player clicks *_shovel in my_inventory and check the context slot and do your business.

#

!c inventory

ember wolfBOT
# warm sail !c inventory
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.

Description

Use this command to edit the state of inventories.
By default, the destination inventory is the current attached player's inventory.

If you are copying, swapping, removing from (including via "keep" and "exclude"), adding to, moving, or filling inventories,
you'll need both destination and origin inventories.

Origin inventories may be specified as a list of ItemTags, but destinations must be actual InventoryTags.

Using "open", "clear", or "update" only require a destination.
"Update" also req...

rough juniper
rough juniper
#

I'm so sorry for the ping!!! I didnt mean that!!

tulip violet
#

GUI is meant for players to not be able to change the contents of the chest.
You'll have to make your own inventory with event listeners to make what you want work

warm sail
tulip violet
#

I recommend checking this API created by pobab
#showcase message

rough juniper
#

I'll take a look at the API

worthy osprey
#

Set gui to true, listen to a specific event, and determine cancelled:false

tulip violet
rough juniper
simple timber
#

thats helpful

rough juniper
#

Well, Im still learning about inventory

#

So pleas expect me to send in some stuff for help ๐Ÿ˜ฌ

rough juniper
#

!paste

ember wolfBOT
rough juniper
#

I cant get the paper to turn into a wooden shovel

#

And I cant seem to move the items from my inventory, I know its because of the last script event

#

Im just so confused over inventory script

rough juniper
#

I dont know if Im making any sense ๐Ÿ˜ฌ

wet kayakBOT
warm sail
#

Well first of all.

#

You can't cancel an event after it's fired. Only during.

#

Also can you

ember wolfBOT
# warm sail !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!

rough juniper
# warm sail !debug

Hey there! I made a few changes to the script as suggested by a friend. Here is the debug and the new script -
Debug -https://paste.denizenscript.com/View/112105
Script -https://paste.denizenscript.com/View/112106

warm sail
#

But are you still having the same issue?

ember wolfBOT
# warm sail !checklogs https://paste.denizenscript.com/View/112105
Server Version

Paper version git-Paper-538 (MC: 1.19.4)-- (Outdated build, behind by 12... Current build is 550)

Plugin Version(s)

Denizen: 1.2.7-SNAPSHOT (build 1792-REL) -- (Outdated build, behind by 1)
Depenizen: 2.0.0 (build 834) -- (Outdated build, behind by 2)

Checked For

@warm sail

UUID Version

0 (:triangular_flag_on_post: Hacked or Invalid ID)

Java Version

17.0.7 :white_check_mark:

Other Noteworthy Plugin(s)

ProtocolLib: 5.1.0-SNAPSHOT-654

Problematic Plugin(s)

Geyser-Spigot: 2.1.1-SNAPSHOT - Bedrock clients are unsupportable. Please do all testing with a Java Edition client.
floodgate: 2.2.2-SNAPSHOT (b??-2702bc3)

Possibly Relevant Plugin(s)

TAB: 3.3.2 - This plugin adds Below_Name scoreboards to NPCs.
ViaVersion: 4.7.0 - Mixed client vs server versions can sometimes cause packet-related issues.

warm sail
#

Oh.

#

I'll have to let a helper/dev look at this issue.

rough juniper
#

Why does it say hacked or Invalid??

#

I've not changed any settings on the server?

rough juniper
#

I've given my debug a lot of times earlier and it didn't seem to show that error. Is it because it's run locally?

#

Or the plugins not being updated?

rough juniper
#

I fixed the item_on_cursor thing for the GUI. But once this thing is sorted, am I allowed to ask for support? ๐Ÿ˜ฌ

rough juniper
#

How can I get an item quantity in a cursor item? Basically I'd like to check the number of blocks/items are being placed in that slot of the inventory and it would take that many, instead of taking one at a time

#

!update

ember wolfBOT
#
Update Paper

Paper is a higher-performance alternative to Spigot that is 100% compatible with the equivalent Spigot version. It's much easier to update than Spigot itself, and carries a lot of performance and quality-of-life benefits.

Latest Paper builds are at https://papermc.io/downloads/paper.

(If you would prefer to use a Spigot build, refer to !update spigot).

rough juniper
rough juniper
ember wolfBOT
rough juniper
ember wolfBOT
# rough juniper !logcheck https://paste.denizenscript.com/View/112115
Server Version

Paper version git-Paper-68 (MC: 1.20.1)-- (Current build :white_check_mark:)

Plugin Version(s)

Denizen: 1.2.8-SNAPSHOT (build 6814-DEV) -- (Current build :white_check_mark:)
Depenizen: 2.1.0 (build 836) -- (Current build :white_check_mark:)

Checked For

@tacit pike

UUID Version

0 (:triangular_flag_on_post: Hacked or Invalid ID)

Java Version

17.0.7 :white_check_mark:

Other Noteworthy Plugin(s)

ProtocolLib: 5.1.0-SNAPSHOT-654

Problematic Plugin(s)

Geyser-Spigot: 2.1.2-SNAPSHOT - Bedrock clients are unsupportable. Please do all testing with a Java Edition client.
floodgate: 2.2.2-SNAPSHOT (b59-2278589)

Possibly Relevant Plugin(s)

TAB: 4.0.3 - This plugin adds Below_Name scoreboards to NPCs.
ViaVersion: 4.7.0 - Mixed client vs server versions can sometimes cause packet-related issues.

rough juniper
#

But online-mode is true

rough juniper
#

I've updated all the plugins, I dont know what it is that seems to be the issue..But Im trying to get stackable items to show in the GUI. Please let me know if the code might be right?
Debug - https://paste.denizenscript.com/View/112116
Code - https://paste.denizenscript.com/View/112117
Video - https://streamable.com/v9wnxn

warm sail
#

So looking from the video do you want to put all of the item stacks you have, or simply keep adding by +1 when you click on that slot?

#

Because if you want to them them all you'll need to specify a quantity argument, which you should consider just using the cursor items quantity for that. You may need to do some math if you also have more blocks than is allowed for the maximum quantity of an item.

#

I'm surprised after events are even working considering gui:true is suppose to block being able to click stuff? ( I might be talking out myself. )

rough juniper
# warm sail I'm surprised `after` events are even working considering `gui:true` is suppose ...

Well I think I've figured out the quantity thing, I can try and send it here just so you can let me know if it's the right method perhaps?

But is there a way to replicate the left click feature from vanilla? Basically taking half of the item?

I also wanted to store those items, so even if a player closes the inventory, those items stay there, I'm guessing it's a location flag? But how can one store the contents?

warm sail
#

Take half of an item? Juse use quantity tag for itemtags.

rough juniper
#

Oh alright

#

And the item storing?

warm sail
#

You could do location flags yes, you can flag the location.

#

Just might want to be aware if osmeone breaks it you'll want to consider removing the flag.

rough juniper
#

I'm sorry, I'm just new to scripting an inventory

rough juniper
#

!t inventorytag.list_contents

ember wolfBOT
rough juniper
#

This might help, but will it go back to the allotted slots?

#

In this instance would noting an inventory help?

#

Cuz the machine can be used by other players. I don't want it to be a per player inventory view.

Basically if player1 kept gravel in the machine, player2 can see the gravel in the machine too

#

Like how a normal furnace works

#

I'm not sure if I'm going in the right direction there ๐Ÿ˜ฌ

warm sail
#

!t inventorytag.map_slots

ember wolfBOT
warm sail
#

You may just want to save the map_slots and forloop the slots and insert their values into the inventory. Unless you want to individually track every slot yourself through flags.

rough juniper
#

I think I've got a fair understanding

#

I've got a doubt and it might sound really dumb. But what does <context.location.simple> do?

wicked dome
#

!t locationtag.simple

ember wolfBOT
rough juniper
#

Oops! I'm sorry about that

#

Another dumb question, is there a way to check, if in slot:12 there is gravel in crusher_inventory, then do the necessary task?

#

I don't know if that makes sense ๐Ÿ˜ฌ. I'm sorry if I'm asking too much

warm sail
#

If you're clicking in an inventory and you're using the in matcher then you should already be able to check what inventory it is, so all you gotta do is check the inventorytag.slot[12]'s material name.

#

on player clicks in:my_inventory: and such.

rough juniper
#

I understand that. I meant like, if the block is noted and it opens a GUI. A player places the gravel in slot:12, closes the GUI. The player then clicks the GUI, it pops up with the Gravel in it, so I'd like to know if there was a way to check if the contents in the GUI has gravel, then do a specific math equation. Cuz I believe inventory adjust doesn't add the quantity of an item within the GUI right?

Like if there was 12 Gravel in the GUI, and the player decides to add in more, I could do a Def total where it adds both the quantity_inv and quantity_cursor and basically set slot 12 with gravel with the quantity total

#

I don't have a script ready for this, or else it would've been easier to explain I believe ๐Ÿ˜ฌ

rough juniper
warm sail
#

If you're flagging the location with the contents, then it's simply enough to just adjust the inventory with the flags provided to that block. Setting the item with the item you've provided should accomodate for the quantity as long as you're updating the flag.

smoky fjordBOT
#
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.)

#

@rough juniper