// ==UserScript== // @name Frost-UI Menu Example // @namespace http://tampermonkey.net/ // @version 1.0.0 // @description Example usage of Frost-UI // @author FrozenProductions // @match https://*/* // @require https://raw.githubusercontent.com/FrozenProductions/Frost-UI/main/scripts/Library.js // @grant GM_getValue // @grant GM_setValue // @grant GM_addStyle // @grant GM_log // ==/UserScript== /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * NOTE: THIS IS JUST A SIMPLE EXAMPLE *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ (() => { /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * Configuration Setup *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ const config = GM_getValue('menuConfig', { combat: { killAura: false, reach: 3, criticals: false, noJump: false, autoClicker: { enabled: false, cps: 12, }, targetMode: 'Single', priority: 'Distance', targetTypes: ['Players'], targetPriority: ['Players', 'Monsters', 'Animals'], }, movement: { speed: false, speedValue: 1, flight: false, noFall: false, sprint: false, step: false, stepHeight: 1, stepMode: 'Normal', abilities: [], }, render: { esp: false, tracers: false, nametags: false, fullbright: false, chams: false, opacity: 100, noWeather: false, clearSky: false, espColor: '#7289DA', }, world: { timer: false, timerSpeed: 1, autoFish: false, autoMine: false, autoFarm: false, xray: false, caveFinder: false, }, }); const saveConfig = () => GM_setValue('menuConfig', config); /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * Menu Initialization *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ const combatMenu = window.frostManager.addMenu( 'combat', 'Combat Menu', { x: 100, y: 100 }, 'ShiftRight', { enabled: true, gridSize: 20, showGrid: true } ); const movementMenu = window.frostManager.addMenu( 'movement', 'Movement Menu', { x: 420, y: 100 }, 'ShiftRight', { enabled: true, gridSize: 20, showGrid: true } ); const renderMenu = window.frostManager.addMenu( 'render', 'Render Menu', { x: 740, y: 100 }, 'ShiftRight', { enabled: true, gridSize: 20, showGrid: true } ); const worldMenu = window.frostManager.addMenu( 'world', 'World Menu', { x: 740, y: 400 }, 'ShiftRight', { enabled: true, gridSize: 20, showGrid: true } ); const search = new window.frostSearch({ 'Combat Menu': combatMenu, 'Movement Menu': movementMenu, 'Render Menu': renderMenu, 'World Menu': worldMenu, }); /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * Frost-UI Global Configuration *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ // Configure Frost-UI global settings window.frostManager.setConfig({ dimOnMenuOpen: false, // Dim background when any menu is open blurOnMenuOpen: false, // Blur background when any menu is open rememberPositions: false, // Save menu positions across page reloads }); /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * Combat Menu Setup *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ combatMenu .addCategory('Combat') .addToggle('Combat', 'KillAura', (enabled, key) => { config.combat.killAura = enabled; saveConfig(); }) .addSlider('Combat', 'Reach', 3, 6, config.combat.reach, (value) => { config.combat.reach = value; saveConfig(); }) .addToggle( 'Combat', 'Criticals', (enabled) => { config.combat.criticals = enabled; saveConfig(); }, 'KeyJ' ) .addOrderList('Combat', 'Target Priority', config.combat.targetPriority, (items) => { config.combat.targetPriority = items; saveConfig(); }) .addSwitch( 'Combat', 'NoJump', config.combat.noJump, (enabled) => { config.combat.noJump = enabled; saveConfig(); }, 'slim' ) .addCategory('AutoClicker') .addToggle('AutoClicker', 'Enabled', (enabled) => { config.combat.autoClicker.enabled = enabled; saveConfig(); }) .addDualSlider('AutoClicker', 'CPS', 0, 20, 10, 15, ({ start, end }) => { console.log(`Price range: $${start} - $${end}`); }) .addCategory('Target') .addRadioGroup( 'Target', 'Target Mode', ['Single', 'Multiple', 'Switch'], config.combat.targetMode, (value) => { config.combat.targetMode = value; saveConfig(); } ) .addSelect( 'Target', 'Priority', ['Distance', 'Health', 'Angle'], config.combat.priority, (value) => { config.combat.priority = value; saveConfig(); } ) .addMultiSelect( 'Target', 'Target Types', ['Players', 'Animals', 'Monsters', 'Villagers', 'Invisibles'], config.combat.targetTypes, (selected) => { config.combat.targetTypes = selected; saveConfig(); } ); /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * Movement Menu Setup *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ movementMenu .addCategory('Movement') .addToggle('Movement', 'Speed', (enabled) => { config.movement.speed = enabled; saveConfig(); }) .addSlider('Movement', 'Speed Value', 1, 3, config.movement.speedValue, (value) => { config.movement.speedValue = value; saveConfig(); }) .addToggle('Movement', 'Flight', (enabled) => { config.movement.flight = enabled; saveConfig(); }) .addToggle('Movement', 'NoFall', (enabled) => { config.movement.noFall = enabled; saveConfig(); }) .addSwitch( 'Movement', 'Sprint', config.movement.sprint, (enabled) => { config.movement.sprint = enabled; saveConfig(); }, 'pill' ) .addGridSelector( 'Movement', 'Movement Abilities', [ { id: 'flight', icon: ``, label: 'Flight', }, { id: 'bhop', icon: `circle arrow up 2`, label: 'Bunny Hop', }, { id: 'longjump', icon: `arrow trend up`, label: 'Long Jump', }, ], config.movement.abilities, (selected) => { config.movement.abilities = selected; saveConfig(); }, 1 ) .addCategory('Step') .addToggle('Step', 'Enabled', (enabled) => { config.movement.step = enabled; saveConfig(); }) .addSlider('Step', 'Height', 1, 4, config.movement.stepHeight, (value) => { config.movement.stepHeight = value; saveConfig(); }) .addPageSelector( 'Step', 'Step Mode', ['Normal', 'Jump', 'Spider', 'Matrix'], 0, (value) => { config.movement.stepMode = value; saveConfig(); } ); /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * Render Menu Setup *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ renderMenu .addCategory('ESP') .addToggle('ESP', 'Players', (enabled) => { config.render.esp = enabled; saveConfig(); }) .addToggle('ESP', 'Tracers', (enabled) => { config.render.tracers = enabled; saveConfig(); }) .addToggle('ESP', 'Nametags', (enabled) => { config.render.nametags = enabled; saveConfig(); }) .addColorInput('ESP', 'ESP Color', '#7289DA', (color) => { config.render.espColor = color; saveConfig(); }) .addCategory('Visual') .addToggle('Visual', 'Fullbright', (enabled) => { config.render.fullbright = enabled; saveConfig(); }) .addToggle('Visual', 'Chams', (enabled) => { config.render.chams = enabled; saveConfig(); }) .addSlider('Visual', 'Opacity', 0, 100, config.render.opacity, (value) => { config.render.opacity = value; saveConfig(); }) .addCategory('Weather') .addToggle('Weather', 'No Weather', (enabled) => { config.render.noWeather = enabled; saveConfig(); }) .addToggle('Weather', 'Clear Sky', (enabled) => { config.render.clearSky = enabled; saveConfig(); }); /*━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ * World Menu Setup *━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━*/ worldMenu .addCategory('Timer') .addToggle('Timer', 'Enabled', (enabled) => { config.world.timer = enabled; saveConfig(); }) .addSlider('Timer', 'Speed', 0, 5, config.world.timerSpeed, (value) => { config.world.timerSpeed = value; saveConfig(); }) .addCategory('Automation') .addToggle('Automation', 'Auto Fish', (enabled) => { config.world.autoFish = enabled; saveConfig(); }) .addToggle('Automation', 'Auto Mine', (enabled) => { config.world.autoMine = enabled; saveConfig(); }) .addToggle('Automation', 'Auto Farm', (enabled) => { config.world.autoFarm = enabled; saveConfig(); }) .addCategory('World') .addToggle('World', 'XRay', (enabled) => { config.world.xray = enabled; saveConfig(); }) .addToggle('World', 'Cave Finder', (enabled) => { config.world.caveFinder = enabled; saveConfig(); }) .addChart('World', 'Entities', { width: 260, height: 100, maxDataPoints: 100, series: [ { label: 'Players', color: '#ff4757', }, { label: 'Mobs', color: '#2ed573', }, ], }) .addCategory('Modals') .addButton( 'Modals', 'Confirm Dialog', async () => { const result = await window.frostManager.showModal({ title: 'Delete Item', message: 'Are you sure you want to delete this item? This action cannot be undone.', buttons: [ { text: 'Cancel', variant: window.frostManager.buttonVariant.DEFAULT, result: 'cancel' }, { text: 'Delete', variant: window.frostManager.buttonVariant.DESTRUCTIVE, result: 'delete' } ] }); window.frostManager.showToast({ message: `Result: ${result}`, type: result === 'delete' ? window.frostManager.toastType.SUCCESS : window.frostManager.toastType.INFO, duration: 2000 }); }, 'primary' ) .addButton( 'Modals', 'Critical Choice', async () => { const result = await window.frostManager.showModal({ title: 'Critical Decision', message: 'You must choose an option to continue:', buttons: [ { text: 'Option A', variant: window.frostManager.buttonVariant.DEFAULT, result: 'a' }, { text: 'Option B', variant: window.frostManager.buttonVariant.PRIMARY, result: 'b' } ], closeOn: [window.frostManager.modal.closeOn.BUTTON] }); window.frostManager.showToast({ message: `Selected: ${result}`, type: window.frostManager.toastType.SUCCESS, duration: 2000 }); } ) .addButton( 'Modals', 'Info Only', async () => { await window.frostManager.showModal({ title: 'Notice', message: 'Click anywhere outside this modal to close it.', closeOn: [window.frostManager.modal.closeOn.BACKDROP] }); } ) .addButton( 'Modals', 'Single Button', async () => { const result = await window.frostManager.showModal({ title: 'Welcome', message: 'Press the button below to continue.', buttons: [ { text: 'Continue', variant: window.frostManager.buttonVariant.PRIMARY, result: 'continue' } ] }); window.frostManager.showToast({ message: `Result: ${result}`, type: window.frostManager.toastType.SUCCESS, duration: 2000 }); } ) .addButton( 'Modals', 'Escape Close', async () => { const result = await window.frostManager.showModal({ title: 'Press Escape', message: 'Close this modal by pressing the Escape key.', buttons: [ { text: 'OK', variant: window.frostManager.buttonVariant.DEFAULT, result: 'ok' } ], closeOn: [window.frostManager.modal.closeOn.ESCAPE, window.frostManager.modal.closeOn.BUTTON] }); window.frostManager.showToast({ message: result ? `Button pressed: ${result}` : 'Closed via Escape', type: window.frostManager.toastType.INFO, duration: 2000 }); } ) .addButton( 'Modals', 'No Dim', async () => { await window.frostManager.showModal({ title: 'No Dim', message: 'This modal has no backdrop dimming.', buttons: [ { text: 'Close', variant: window.frostManager.buttonVariant.DEFAULT, result: 'close' } ], dim: false }); } ) .addButton( 'Modals', 'No Blur', async () => { await window.frostManager.showModal({ title: 'No Blur', message: 'This modal has no backdrop blur.', buttons: [ { text: 'Close', variant: window.frostManager.buttonVariant.DEFAULT, result: 'close' } ], blur: false }); } ) .addButton( 'Modals', 'No Effects', async () => { await window.frostManager.showModal({ title: 'No Effects', message: 'This modal has neither dim nor blur effects.', buttons: [ { text: 'Close', variant: window.frostManager.buttonVariant.DEFAULT, result: 'close' } ], dim: false, blur: false }); } ) .addButton( 'Modals', 'Midnight Theme', async () => { await window.frostManager.showModal({ title: 'Midnight Theme', message: 'This modal uses the midnight theme.', buttons: [ { text: 'Close', variant: window.frostManager.buttonVariant.DEFAULT, result: 'close' } ], theme: window.frostManager.themes.MIDNIGHT }); } ) .addButton( 'Modals', 'Nord Theme', async () => { await window.frostManager.showModal({ title: 'Nord Theme', message: 'This modal uses the nord theme.', buttons: [ { text: 'Close', variant: window.frostManager.buttonVariant.DEFAULT, result: 'close' } ], theme: window.frostManager.themes.NORD }); } ) .addCategory('UI Settings') .addToggle('UI Settings', 'Dim Background', (enabled) => { const config = window.frostManager.getConfig(); window.frostManager.setConfig({ ...config, dimOnMenuOpen: enabled }); }) .addToggle('UI Settings', 'Blur Background', (enabled) => { const config = window.frostManager.getConfig(); window.frostManager.setConfig({ ...config, blurOnMenuOpen: enabled }); }) .addToggle('UI Settings', 'Remember Positions', (enabled) => { const config = window.frostManager.getConfig(); window.frostManager.setConfig({ ...config, rememberPositions: enabled }); }); let playerCount = 50; let mobCount = 30; setInterval(() => { const chart = worldMenu.getCategories().get('World')?.items.get('Entities'); if (chart) { playerCount = Math.max(0, Math.min(100, playerCount + (Math.random() - 0.5) * 10)); mobCount = Math.max(0, Math.min(100, mobCount + (Math.random() - 0.5) * 8)); chart.addDataPoint(0, playerCount); chart.addDataPoint(1, mobCount); } }, 100); })();