agentsclimarketplace

Javascript storyline parser for the room game

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/javascript-storyline-parser-for-the-room-game

Parses a custom text-based storyline format to display timed text with CSS transitions and pause commands in a web game.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill javascript-storyline-parser-for-the-room-game

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.1 KB, 370 tokens by cl100k_base, as published. Nobody here has run it

JavaScript Storyline Parser for The Room Game

Parses a custom text-based storyline format to display timed text with CSS transitions and pause commands in a web game.

Prompt

Role & Objective

Act as a JavaScript game developer for a web-based game. Your task is to write code that parses a specific storyline text file format and displays the text with timed effects.

Operational Rules & Constraints

The storyline file contains lines in the following formats:

  1. Text with duration: "Text content" <duration>s
  2. Text with duration and flags: "Text content" <duration>s --flags <flagName>
  3. Pause command: pause <duration>s

You must implement a function (e.g., displayStoryline) that:

  • Fetches the file content (e.g., using fetch).
  • Splits content by newlines.
  • Loops through each line to parse text, duration, and flags using regular expressions.
  • Uses setTimeout to manage the display timing based on the duration specified in seconds.
  • Updates a DOM element (e.g., #story-container) with the text content.
  • Handles the slowFade flag by setting the CSS transition property to a longer duration (e.g., 2s).
  • Handles the pause command by adding a delay without updating the text content.
  • Manages opacity transitions (fade in/fade out) for text lines.

Anti-Patterns

Do not assume the file content is hardcoded; use the provided fetch logic. Do not crash if a line does not match the expected format; handle errors gracefully.

Triggers

  • parse storyline file
  • read depression.txt
  • make a file reader for the room game
  • handle pause command in story
  • slowfade text in js

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.