← Back to context

Comment by promiseofbeans

1 year ago

The game state clears on reload, so here's a wee console snippet to export your list of elements:

    console.log(JSON.stringify({discoveries: window.$nuxt.$root.$children[2].$children[0].$children[0]._data.discoveries, elements:window.$nuxt.$root.$children[2].$children[0].$children[0]._data.elements}))

I'll figure out how to re-import the state later, but it's past midnight for me now.

The state can be re-imported like this: ``` a = (insert JSON output here) window.$nuxt.$root.$children[2].$children[0].$children[0]._data.elements = a.elements; window.$nuxt.$root.$children[2].$children[0].$children[0]._data.discoveries = a.discoveries; ```

  • I made a bookmarklet that loads the state from localstorage and also autosaves the state on each new craft

        javascript:(function(){
            const exportState = () => JSON.stringify({
                discoveries: window.$nuxt.$root.$children[2].$children[0].$children[0]._data.discoveries, 
                elements: window.$nuxt.$root.$children[2].$children[0].$children[0]._data.elements
            });
    
            const importState = (state) => {
                const { discoveries, elements } = JSON.parse(state);
                const gameInstance = window.$nuxt.$root.$children[2].$children[0].$children[0]._data;
                gameInstance.discoveries = discoveries;
                gameInstance.elements = elements;
            };
    
            /* Set up a MutationObserver to listen for changes in the DOM and automatically export the current state. */
            const observer = new MutationObserver((mutations) => {
                const state = exportState();
                localStorage.setItem('gameState', state);
            });
    
            /* Start observing DOM changes to auto-save the game state. */
            const startObserving = () => {
                const targetNode = document.querySelector('.sidebar');
                observer.observe(targetNode, { childList: true, subtree: true });
            };
    
            /* Check for a saved state in localStorage and import it if available. */
            const savedState = localStorage.getItem('gameState');
            if (savedState) importState(savedState);
            else localStorage.setItem('gameState', exportState() );
    
            startObserving();
        })();

  • I used this to import my own terms.

    This can be used to get a novel starting point (disregarding the original starting point).

    It can also be used to start from unreachable elements, although it isn't clear to me exactly how the "First discovery" works, e.g. will your unreachable elements pollute the neal.fun datastore, or only the byproducts? Either way, it is interesting.

Thank you!

These were my discoveries:

["Leviathan Shark","Burnzilla","Burnado","Chocolate Tree Shark","Cybersharktopus","Toadatorzilla","Bacon Sharktopusnado","Rainbow Hooktopus","T-48000050","T-48000050","T-19800050","T-19800050","T-64000050","T-83800050","T-83800050","T-121800050","T-121800051","T-185800001","T-185800002","T-185800004","T-185800008","T-82980058","T-121800051 + T-160000"]

Seems like I've stumbled across a self reproducing AI, although the emojis went from robot emoji to universe emoji and then to poop emoji. I wonder at which of those levels of AI we're at currently :p