#How to make a multi Purpose menu

1 messages · Page 1 of 1 (latest)

abstract estuary
#

So, I am making a home menu and need 14 home slots. However for the players to delete, I need a delete menu, I want to know how i can make it so that with one menu, I can delete the specified home. The Way I know, We need to make 14 different menus for each house. Is there a way to make it all into 1 menu?

red hamlet
#

Whenever they want to delete a specified home, save the home name in a meta string and then get the value of it in the confirmation menu and make it execute /delhome %player_name%:%deluxemenus_meta_homeToDelete_STRING%

red hamlet
#

When the user clicks the delete home item, add to the click_commands

[meta] set homeToDelete STRING <homeName>

and open the delete confirmation menu. From there, when the user clicks on the green wool, the console executes delhome %player_name%:%deluxemenus_meta_homeToDelete_STRING%

abstract estuary
#

home name?

red hamlet
#

that's the meta key which has the value of the home name which the player wants to delete

#

and <homeName> is the home name in the click commands before setting the home

abstract estuary
#

lemme try

abstract estuary
red hamlet
#

You have to do it for each item, with the meta value corresponding to the home name

abstract estuary
#

ok 😄

abstract estuary
red hamlet
#

I tried to recreate the exact same menu you try to but I couldn't get it working correctly because if you delete a home, all the other homes shift -1

abstract estuary
#

uhh

red hamlet
#

But here are some placeholders that could help:

%essentials_home_<number>%
%essentials_home_<number>_<w|x|y|z>%
%essentials_homes_set%
%essentials_homes_max%
abstract estuary
#

like i will be naming the homes. But if a players deletes a home, i want it to show create home again

red hamlet
#

I get that, if you have 2 homes and parse %essentials_home_1% you get the name of the first home you set. If you now delete the first home and parse %essentials_home_1% again, you're going to get the name of the second home

#

They're either using some custom plugin or just have thought it through, honestly no idea

abstract estuary
red hamlet
#

For that you can use the < requirement, input would be %essentials_homes_set%, output would be %essentials_homes_max%

red hamlet
#

it's light_gray_bed. And also, the type would be <, not string equals

abstract estuary
#

ok

abstract estuary
red hamlet
#

do you have the essentials expansion?

abstract estuary
abstract estuary
#

i do

#

the menu is not opening

red hamlet
#

input should be %essentials_homes_set%

abstract estuary
#

missed '' for the < logo

#

sign

abstract estuary
red hamlet
#

Sure, keep me updated!

abstract estuary
abstract estuary
red hamlet
#

a number

#

starting from 1

abstract estuary
red hamlet
#

yeah try it, it shows the home name. If you first set home A and then B, putting 1 into the placeholder would return A, and 2 would return B

abstract estuary
#

but deleting would reset the names

red hamlet
#

And it’d be empty if there’s no home

red hamlet
abstract estuary
#

could i use minimum_requirements

red hamlet
#

Try it idk

abstract estuary
#

like for 1 item ill set all 14

#

and use minimum requirements

abstract estuary
abstract estuary
#

ok nvm

#

i screwed up something

abstract estuary
#

So when the home is set, it doesnt show in the menu

#

but when i change something

#

it does

tranquil solstice
#

.

abstract estuary
tranquil solstice
#

show config

abstract estuary
#

sec

#

!paste

hallow harnessBOT
abstract estuary
#

I want it so that is any one of these contains home1, it should show the value

hallow harnessBOT
tranquil solstice
#

you set minimum as 1

#

and stop if any requirement met

#

:?

abstract estuary
#

yes

abstract estuary
#

if any of those values contain home1

#

it should stop at that

tranquil solstice
#

what will these return ?

abstract estuary
#

if any one of these return home1

#

the item should be shown

tranquil solstice
#

ok, try remove stop_at_success

abstract estuary
#

doesn't work

tranquil solstice
#

you can use meta, it from deluxemenus and can use as memory

abstract estuary
#

so

#

how can i make it so that the menu remembers if a person has set home on a specific item

#

?

tranquil solstice
#
click_commands:
  - '[meta] set home1 STRING yes' #(0)
  #- '[meta] set home1 STRING or whatever you want' #(1)
view_requirement:
  requirements:
    'use placeholder':
      type: string equals
      input: '%deluxemenus_meta_home1_STRING%'
      output: 'yes'
    'use deluxemenus config':
      type: has meta
      key: 'home1'
      meta_type: STRING
      value: yes

# %deluxemenus_meta_<meta name>_<type>_<default>%
#
# <meta name> is the name of meta, i set above 'home1'
#
# <type> is data type in program language
#  + STRING to store some text, (0) will return 'yes'
#                               (1) will return 'or whatever you want'
#  + INTEGER to store a number: 0, 1, 123, 5435 
#  + DOUBLE to store a number with decimal: 0.0, 1.56, 2.123123
#  + BOOLEAN to store 'true' or 'false' value
#
# <default> will return it if nothing got memory
#
# example: %deluxemenus_meta_this-is-a-test_INTEGER_100%
# 1. return with nothing inside: 100
# 2. return with a value inside:
#    + [meta] set this-is-a-test INTEGER 2000 -> return 2000
#    + [meta] add this-is-a-test INTEGER 1 -> return 2001
#    + [meta] subtract this-is-a-test INTEGER 2 -> return 1999
#    + [meta] remove this-is-a-test INTEGER a -> return 100 (default)
#    + [meta] set this-is-a-test INTEGER null -> same with remove, but meta still get store a blank

# same <meta name> cant get store at two or more diffefent <type>
# %deluxemenus_meta_home1_STRING% %deluxemenus_meta_home1_INTEGER%, if you call two of these, you get some error