Metadata-Version: 2.4
Name: dumbscript
Version: 2.0.1
Summary: A fun, simplified scripting language engine.
Author-email: LemonyLou <liam.cyou@gmail.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Interpreters
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# DumbScript

DumbScript is a fun, simplified scripting language written in Python. It's designed to be easy to read and write, with a focus on simplicity and a few chaotic, fun features.

This engine can interpret `.ds` files containing DumbScript code.

## Changelogs

Fixed README.md

## Installation

```bash
pip install dumbscript
```

## Usage

Create a script file (e.g., `hello.ds`):

```
# hello.ds
say "Hello, World!"
my_name = "DumbScript"
say "My name is {my_name}."
```

Run it from your terminal:

```bash
dumbscript hello.ds
```

## Features


🎛️ Core Data & Variables
These are the fundamental building blocks for storing and managing information in your scripts.

Variable Assignment

Description: Creates a variable and assigns it a value. The engine automatically detects the type (string, integer, float, boolean, or list).
Syntax: variable_name = value
Example:
dumbscript
name = "DumbScript"
version = 2.0
is_awesome = true
features = ["variables", "recipes", "logic"]
Dictionary Assignment

Description: Creates a dictionary (a key-value map).
Syntax: dict variable_name = {key: value, ...}
Example:
dumbscript
dict user = {"name": "Gemini", "level": 99}
Measure

Description: Gets the length of a string (number of characters) or a list (number of items) and stores it in another variable.
Syntax: measure var_to_measure into destination_var
Example:
dumbscript
my_list = [10, 20, 30]
measure my_list into list_size # list_size is now 3
Type Casting

Description: Forces a variable to be a specific type (string, int, float, bool).
Syntax: force variable to type
Example:
dumbscript
my_num_str = "123"
force my_num_str to int # my_num_str is now the integer 123
Pull Substring (Slicing)

Description: Extracts a portion of a string and updates the string to be only that portion.
Syntax: pull_substring from variable start_index to end_index
Example:
dumbscript
full_text = "Hello World"
# Extracts "World" (indices 6 through 11)
pull_substring from full_text 6 to 11
say "The result is: {full_text}" # Prints "The result is: World"
🔢 Math & Random
Commands for performing calculations and introducing unpredictability.

Math

Description: Evaluates a mathematical expression involving numbers and other variables.
Syntax: math destination_var = expression
Example:
dumbscript
score = 100
math final_score = score * 1.5 + 10 # final_score is 160.0
Increment/Decrement

Description: A shortcut to add or subtract 1 from a numeric variable.
Syntax: variable++ or variable--
Example:
dumbscript
counter = 5
counter++ # counter is now 6
Random

Description: Selects a random item from a list of choices.
Syntax: random destination_var = [option1, option2, ...]
Example:
dumbscript
random chosen_fruit = ["apple", "banana", "cherry"]
say "The fruit is: {chosen_fruit}"
🧵 Control Flow & Logic
These commands control the order in which your script executes, allowing for branching and conditional logic.

Check (If/Else)

Description: The primary if/else statement. Executes one block of code if a condition is true, and another if it's false.
Syntax: check condition: command otherwise command
Example:
dumbscript
age = 21
check age >= 18: say "You are an adult." otherwise say "You are a minor."
If Holds / If Exists

Description: A simpler if statement for two common cases: checking if a list/string contains a value, or checking if a file exists.
Syntax: if list_or_string holds value: command or if exists "filename": command
Example:
dumbscript
items = ["key", "map"]
if items holds "key": say "You found the key!"
if exists "config.txt": read "config.txt" into config_data
GoTo (Jump/Label)

Description: Unconditionally jumps the script's execution to a predefined label. Use with caution, as it can make code hard to follow.
Syntax: label my_label and jump my_label
Example:
dumbscript
 Show full code block 
say "Starting..."
jump the_end

label the_middle
say "This will be skipped."

label the_end
say "The end."
Stall Until

Description: Pauses the script indefinitely until a specific condition becomes true.
Syntax: stall until condition
Example:
dumbscript
# This script will wait until you manually run a command
# in another thread that sets 'game_started' to true.
game_started = false
stall until game_started == true
say "The game has started!"
🍳 Recipes (Functions)
Recipes allow you to group commands into reusable blocks, similar to functions in other languages.

Recipe Definition

Description: Defines a named block of code that can accept arguments.
Syntax: recipe recipe_name(arg1, arg2, ...):
Example:
dumbscript
recipe greet(name, time_of_day):
    say "Good {time_of_day}, {name}!"
Do (Call a Recipe)

Description: Executes a previously defined recipe, passing in values for its arguments.
Syntax: do recipe_name(value1, value2, ...)
Example:
dumbscript
do greet("Alice", "morning") # Prints "Good morning, Alice!"
Fork (Background Task)

Description: Executes a recipe in a separate background thread, allowing the main script to continue without waiting. Note: Currently does not support passing arguments.
Syntax: fork recipe_name
Example:
dumbscript
 Show full code block 
recipe long_task:
    say "Background task started."
    pause(5)
    say "Background task finished."

fork long_task
say "Main script continues immediately."
CONSOLE & I/O
Commands for interacting with the user via the console.

Say

Description: Prints a message to the console. Can use colors. Variables are automatically substituted.
Syntax: say "message" or say_color "message"
Example:
dumbscript
user = "Bob"
say "Hello, {user}!"
say_red "This is an error message."
Typewrite

Description: Prints a message to the console one character at a time, simulating a typewriter effect.
Syntax: typewrite 'message' speed
Example:
dumbscript
typewrite 'Loading system...' 0.1
Ask

Description: Prompts the user for input and stores the result in a variable.
Syntax: ask "Question" into destination_var
Example:
dumbscript
ask "What is your name?" into user_name
Clear

Description: Clears the entire console screen.
Syntax: clear
📁 File System, Networking & Persistence
Commands for working with files, the internet, and saving data.

Write / Read File

Description: Writes content to a file or reads a file's entire content into a variable.
Syntax: write "filename" "content" and read "filename" into var
Example:
dumbscript
write "greeting.txt" "Hello from DumbScript!"
read "greeting.txt" into file_content
Run Command

Description: Executes a command in the operating system's terminal/shell.
Syntax: run_cmd "command"
Example:
dumbscript
# On Windows
run_cmd "dir"
# On Linux/macOS
run_cmd "ls -l"
Pull/Push Data (GET/POST)

Description: Fetches data from a URL (GET) or sends data to a URL (POST).
Syntax: pull_data from "URL" into var and push_data payload_var to "URL"
Example:
dumbscript
# GET request
pull_data from "https://api.github.com/users/octocat" into github_user
# POST request
dict new_post = {"title": "My Post", "body": "Hello!"}
push_data new_post to "https://jsonplaceholder.typicode.com/posts"
Serve Folder

Description: Starts a simple local web server to host the files in a specified folder.
Syntax: serve_folder "path/to/folder" on port
Example:
dumbscript
serve_folder "my_website" on 8080
Save / Load (DataStore)

Description: Persistently saves a variable to a datastore.json file or loads it back. This allows data to survive between script runs.
Syntax: save var to "key" and load "key" into var
Example:
dumbscript
 Show full code block 
# First run
high_score = 1000
save high_score to "player_high_score"

# Later run
load "player_high_score" into loaded_score
say "The saved high score is: {loaded_score}"
🌪️ Chaos & Meta
Fun, disruptive, or self-referential commands.

Explode

Description: Intentionally triggers a runtime error. Useful for testing attempt/fail blocks.
Syntax: explode
Gaslight

Description: For pure chaos. Subtly and randomly changes a variable's value (flips a boolean or nudges a number by +/- 1) without telling you.
Syntax: gaslight variable
Rickroll

Description: Opens the user's default web browser to a certain well-known music video.
Syntax: rickroll
Self Destruct

Description: Deletes the script file itself after it finishes running.
Syntax: self_destruct
Help

Description: Prints a list of available feature categories.
Syntax: help
