options: hourly data purge: true # Every hour this purges your menu data so your variables.csv file doesn't get too cluttered. # it will not run if there are players online, this is so that it doesn't interfier with players # Please note that this will only clear temporary data, and not permanent data that may be called # later. on load/unload data purge: true # Purges the menu data on loading and unloading. dynamic inventory: false # Differentiates the player's open inventory from their personal survival inventory, so that they can # move around objects in their main inventory seperately from their open one, this has bugs and isn't # fully working, use at your own risk. every hour: {@hourly data purge} = true purgeMenuData() on load: {@on load/unload data purge} = true purgeMenuData() on unload: {@on load/unload data purge} = true purgeMenuData() function openChest(player: player, rows: integer, title: text, option: text = "normal"): open chest inventory with {_rows} rows named {_title} to {_player} {_option} = "unstealable": set {skmenus::tdata::%{_title}%::option} to "unstealable" function setSlot(player: player, slot: integer, item: item, name: text, lore: text, commands: text = "nothing"): set {_lore::*} to {_lore} split by "||" set slot {_slot} of {_player}'s open inventory to {_item} named {_name} with lore {_lore::*} set {_invname} to name of {_player}'s open inventory set {skmenus::tdata::%{_invname}%::slot%{_slot}%} to {_commands} on inventory click: {@dynamic inventory} = true: set {_invname} to name of event-inventory else: set {_invname} to name of player's open inventory {skmenus::tdata::%{_invname}%::*} is set: set {_slot} to the index of event-slot {skmenus::tdata::%{_invname}%::option} = "unstealable": cancel event set {_commands::*} to {skmenus::tdata::%{_invname}%::slot%{_slot}%} split by "||" loop {_commands::*}: if loop-value = "nothing": cancel event else if loop-value contains "sendMsg->": set {_text::*} to loop-value split by "sendMsg->" send {_text::2} to player else if loop-value = "close": closeChest(player) else if loop-value contains "wait": set {_ts::*} to loop-value split by ":" set {_seconds} to ({_ts::2} parsed as integer) loop {_seconds} times: wait 1 second else if loop-value = "stealable": doNothing() else: execute player command loop-value cancel event else: stop function purgeMenuData(): player count = 0 clear {skmenus::tdata::*} function doNothing(): add 1 to {_nothing} subtract 1 from {_nothing} function closeChest(p: player): clear {_p}'s open inventory close inventory of {_p}