Files
cookieclicker_config.sk
cookieclicker_core.sk
cookieclicker_events.sk
cookieclicker_gui.sk
Code
4 664
cookieclicker_gui.sk
# CookieClicker - GUI Building
# /sk reload cookieclicker_gui
function openCookieClicker(p: player, page: number):
set {_p} to {_p}
set {cookieClicker::%{_p}%::Page} to {_page}
# Create GUI - 54 slots (6 rows)
set {_gui} to new chest inventory with 6 rows named "{@GUIName}"
# Fill background
set {_slot} to 0
while {_slot} < 54:
set slot {_slot} of {_gui} to gray stained glass pane named " "
add 1 to {_slot}
# === PAGE 1: Cursor, Grandma, Farm, Mine ===
if {_page} is 1:
# Unlock checks
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::GrandmaPrice} parsed as number):
set {cookieClicker::%{_p}%::Grandma::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::FarmPrice} parsed as number):
set {cookieClicker::%{_p}%::Farm::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::MinePrice} parsed as number):
set {cookieClicker::%{_p}%::Mine::Unlocked} to true
# Cursor - slot 16
set slot 16 of {_gui} to white candle named "&fCursor" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::CursorPrice})%"
if {cookieClicker::%{_p}%::Cursor} > 0:
set slot 12 of {_gui} to white candle named "&6Cursors: &f%{cookieClicker::%{_p}%::Cursor}%"
if {cookieClicker::%{_p}%::Cursor} > 5:
set slot 13 of {_gui} to white candle named "&6Cursors: &f%{cookieClicker::%{_p}%::Cursor}%"
if {cookieClicker::%{_p}%::Cursor} > 10:
set slot 14 of {_gui} to white candle named "&6Cursors: &f%{cookieClicker::%{_p}%::Cursor}%"
# Grandma - slot 25
if {cookieClicker::%{_p}%::Grandma::Unlocked} is true:
set slot 25 of {_gui} to player head named "&fGrandma" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::GrandmaPrice})%"
else:
set slot 25 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::GrandmaPrice})%"
if {cookieClicker::%{_p}%::Grandma} > 0:
set slot 21 of {_gui} to player head named "&6Grandmas: &f%{cookieClicker::%{_p}%::Grandma}%"
if {cookieClicker::%{_p}%::Grandma} > 10:
set slot 22 of {_gui} to player head named "&6Grandmas: &f%{cookieClicker::%{_p}%::Grandma}%"
if {cookieClicker::%{_p}%::Grandma} > 20:
set slot 23 of {_gui} to player head named "&6Grandmas: &f%{cookieClicker::%{_p}%::Grandma}%"
# Farm - slot 34
if {cookieClicker::%{_p}%::Farm::Unlocked} is true:
set slot 34 of {_gui} to farmland named "&fFarm" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::FarmPrice})%"
else:
set slot 34 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::FarmPrice})%"
if {cookieClicker::%{_p}%::Farm} > 0:
set slot 30 of {_gui} to farmland named "&6Farms: &f%{cookieClicker::%{_p}%::Farm}%"
if {cookieClicker::%{_p}%::Farm} > 10:
set slot 31 of {_gui} to farmland named "&6Farms: &f%{cookieClicker::%{_p}%::Farm}%"
if {cookieClicker::%{_p}%::Farm} > 20:
set slot 32 of {_gui} to farmland named "&6Farms: &f%{cookieClicker::%{_p}%::Farm}%"
# Mine - slot 43
if {cookieClicker::%{_p}%::Mine::Unlocked} is true:
set slot 43 of {_gui} to minecart named "&fMine" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::MinePrice})%"
else:
set slot 43 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::MinePrice})%"
if {cookieClicker::%{_p}%::Mine} > 0:
set slot 39 of {_gui} to minecart named "&6Mines: &f%{cookieClicker::%{_p}%::Mine}%"
if {cookieClicker::%{_p}%::Mine} > 5:
set slot 40 of {_gui} to minecart named "&6Mines: &f%{cookieClicker::%{_p}%::Mine}%"
if {cookieClicker::%{_p}%::Mine} > 10:
set slot 41 of {_gui} to minecart named "&6Mines: &f%{cookieClicker::%{_p}%::Mine}%"
# Big cookie in center - slot 19
set slot 19 of {_gui} to cookie named "&6&l๐ช" with lore "&e&lClick me!"
# Scroll down
set slot 52 of {_gui} to light gray stained glass pane named "&7Scroll Down"
# === PAGE 2: Factory, Bank, Temple, Wizard Tower ===
else if {_page} is 2:
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::FactoryPrice} parsed as number):
set {cookieClicker::%{_p}%::Factory::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::BankPrice} parsed as number):
set {cookieClicker::%{_p}%::Bank::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::TemplePrice} parsed as number):
set {cookieClicker::%{_p}%::Temple::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::WizardTowerPrice} parsed as number):
set {cookieClicker::%{_p}%::WizardTower::Unlocked} to true
# Factory
if {cookieClicker::%{_p}%::Factory::Unlocked} is true:
set slot 16 of {_gui} to dropper named "&fFactory" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::FactoryPrice})%"
else:
set slot 16 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::FactoryPrice})%"
if {cookieClicker::%{_p}%::Factory} > 0:
set slot 12 of {_gui} to dropper named "&6Factories: &f%{cookieClicker::%{_p}%::Factory}%"
if {cookieClicker::%{_p}%::Factory} > 5:
set slot 13 of {_gui} to dropper named "&6Factories: &f%{cookieClicker::%{_p}%::Factory}%"
if {cookieClicker::%{_p}%::Factory} > 10:
set slot 14 of {_gui} to dropper named "&6Factories: &f%{cookieClicker::%{_p}%::Factory}%"
# Bank
if {cookieClicker::%{_p}%::Bank::Unlocked} is true:
set slot 25 of {_gui} to player head named "&fBank" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::BankPrice})%"
else:
set slot 25 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::BankPrice})%"
if {cookieClicker::%{_p}%::Bank} > 0:
set slot 21 of {_gui} to player head named "&6Banks: &f%{cookieClicker::%{_p}%::Bank}%"
if {cookieClicker::%{_p}%::Bank} > 5:
set slot 22 of {_gui} to player head named "&6Banks: &f%{cookieClicker::%{_p}%::Bank}%"
if {cookieClicker::%{_p}%::Bank} > 10:
set slot 23 of {_gui} to player head named "&6Banks: &f%{cookieClicker::%{_p}%::Bank}%"
# Temple
if {cookieClicker::%{_p}%::Temple::Unlocked} is true:
set slot 34 of {_gui} to chiseled tuff bricks named "&fTemple" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::TemplePrice})%"
else:
set slot 34 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::TemplePrice})%"
if {cookieClicker::%{_p}%::Temple} > 0:
set slot 30 of {_gui} to chiseled tuff bricks named "&6Temples: &f%{cookieClicker::%{_p}%::Temple}%"
if {cookieClicker::%{_p}%::Temple} > 5:
set slot 31 of {_gui} to chiseled tuff bricks named "&6Temples: &f%{cookieClicker::%{_p}%::Temple}%"
if {cookieClicker::%{_p}%::Temple} > 10:
set slot 32 of {_gui} to chiseled tuff bricks named "&6Temples: &f%{cookieClicker::%{_p}%::Temple}%"
# Wizard Tower
if {cookieClicker::%{_p}%::WizardTower::Unlocked} is true:
set slot 43 of {_gui} to spyglass named "&fWizard Tower" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::WizardTowerPrice})%"
else:
set slot 43 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::WizardTowerPrice})%"
if {cookieClicker::%{_p}%::WizardTower} > 0:
set slot 39 of {_gui} to spyglass named "&6Wizard Towers: &f%{cookieClicker::%{_p}%::WizardTower}%"
if {cookieClicker::%{_p}%::WizardTower} > 10:
set slot 40 of {_gui} to spyglass named "&6Wizard Towers: &f%{cookieClicker::%{_p}%::WizardTower}%"
if {cookieClicker::%{_p}%::WizardTower} > 20:
set slot 41 of {_gui} to spyglass named "&6Wizard Towers: &f%{cookieClicker::%{_p}%::WizardTower}%"
set slot 7 of {_gui} to light gray stained glass pane named "&7Scroll Up"
set slot 52 of {_gui} to light gray stained glass pane named "&7Scroll Down"
# === PAGE 3: Shipment, Alchemy Lab, Portal, Time Machine ===
else if {_page} is 3:
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::ShipmentPrice} parsed as number):
set {cookieClicker::%{_p}%::Shipment::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::AlchemyLabPrice} parsed as number):
set {cookieClicker::%{_p}%::AlchemyLab::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::PortalPrice} parsed as number):
set {cookieClicker::%{_p}%::Portal::Unlocked} to true
if ({cookieClicker::%{_p}%::Cookies} parsed as number) >= ({cookieClicker::%{_p}%::TimeMachinePrice} parsed as number):
set {cookieClicker::%{_p}%::TimeMachine::Unlocked} to true
# Shipment
if {cookieClicker::%{_p}%::Shipment::Unlocked} is true:
set slot 16 of {_gui} to barrel named "&fShipment" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::ShipmentPrice})%"
else:
set slot 16 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::ShipmentPrice})%"
if {cookieClicker::%{_p}%::Shipment} > 0:
set slot 12 of {_gui} to barrel named "&6Shipments: &f%{cookieClicker::%{_p}%::Shipment}%"
if {cookieClicker::%{_p}%::Shipment} > 5:
set slot 13 of {_gui} to barrel named "&6Shipments: &f%{cookieClicker::%{_p}%::Shipment}%"
if {cookieClicker::%{_p}%::Shipment} > 10:
set slot 14 of {_gui} to barrel named "&6Shipments: &f%{cookieClicker::%{_p}%::Shipment}%"
# Alchemy Lab
if {cookieClicker::%{_p}%::AlchemyLab::Unlocked} is true:
set slot 25 of {_gui} to brewing stand named "&fAlchemy Lab" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::AlchemyLabPrice})%"
else:
set slot 25 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::AlchemyLabPrice})%"
if {cookieClicker::%{_p}%::AlchemyLab} > 0:
set slot 21 of {_gui} to brewing stand named "&6Alchemy Labs: &f%{cookieClicker::%{_p}%::AlchemyLab}%"
if {cookieClicker::%{_p}%::AlchemyLab} > 10:
set slot 22 of {_gui} to brewing stand named "&6Alchemy Labs: &f%{cookieClicker::%{_p}%::AlchemyLab}%"
if {cookieClicker::%{_p}%::AlchemyLab} > 20:
set slot 23 of {_gui} to brewing stand named "&6Alchemy Labs: &f%{cookieClicker::%{_p}%::AlchemyLab}%"
# Portal
if {cookieClicker::%{_p}%::Portal::Unlocked} is true:
set slot 34 of {_gui} to end portal frame named "&fPortal" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::PortalPrice})%"
else:
set slot 34 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::PortalPrice})%"
if {cookieClicker::%{_p}%::Portal} > 0:
set slot 30 of {_gui} to end portal frame named "&6Portals: &f%{cookieClicker::%{_p}%::Portal}%"
if {cookieClicker::%{_p}%::Portal} > 10:
set slot 31 of {_gui} to end portal frame named "&6Portals: &f%{cookieClicker::%{_p}%::Portal}%"
if {cookieClicker::%{_p}%::Portal} > 20:
set slot 32 of {_gui} to end portal frame named "&6Portals: &f%{cookieClicker::%{_p}%::Portal}%"
# Time Machine
if {cookieClicker::%{_p}%::TimeMachine::Unlocked} is true:
set slot 43 of {_gui} to clock named "&fTime Machine" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::TimeMachinePrice})%"
else:
set slot 43 of {_gui} to black concrete named "&f???" with lore "&6&l๐ช &f%formatCookieAmount({cookieClicker::%{_p}%::TimeMachinePrice})%"
if {cookieClicker::%{_p}%::TimeMachine} > 0:
set slot 39 of {_gui} to clock named "&6Time Machines: &f%{cookieClicker::%{_p}%::TimeMachine}%"
if {cookieClicker::%{_p}%::TimeMachine} > 5:
set slot 40 of {_gui} to clock named "&6Time Machines: &f%{cookieClicker::%{_p}%::TimeMachine}%"
if {cookieClicker::%{_p}%::TimeMachine} > 10:
set slot 41 of {_gui} to clock named "&6Time Machines: &f%{cookieClicker::%{_p}%::TimeMachine}%"
set slot 7 of {_gui} to light gray stained glass pane named "&7Scroll Up"
set slot 52 of {_gui} to light gray stained glass pane named "&7Scroll Down"