You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -30,12 +30,21 @@ Have you ever left a bot, an API, or a script running in the background while ga
30
30
31
31
**FortScript solves this automatically.** It pauses your scripts when you open a game or resource-heavy application, and resumes them when you close it. Simple as that.
32
32
33
+
**Cross-platform:** FortScript was developed to work on any operating system, whether Windows, Linux, or MacOS.
34
+
33
35
### How it works
34
36
35
-
1. You define which scripts you want to manage (Python bots, Node.js projects, etc.)
37
+
1. You define which scripts you want to manage (Python bots, Node.js projects, executables, etc.)
36
38
2. You define which applications are "heavy" (games, video editors, etc.)
37
39
3. FortScript monitors and does the rest: pauses when needed, resumes when possible.
38
40
41
+
**Callback Events (optional):** You can configure functions that will run automatically when scripts are paused or resumed:
42
+
43
+
-**`on_pause`**: Function executed when scripts are paused (e.g., send notification, save state).
44
+
-**`on_resume`**: Function executed when scripts are resumed (e.g., reconnect services, log return).
45
+
46
+
This is useful for integrating with notification systems, custom logs, or any action you want to perform at those moments.
47
+
39
48
## Installation
40
49
41
50
FortScript can be used in **two ways**: as a Python library or via command line (CLI). Both come in the same package.
@@ -72,128 +81,265 @@ pipx install fortscript
72
81
73
82
## Configuration
74
83
75
-
Regardless of how you use FortScript (code or CLI), configuration is done through a `config.yaml` file:
84
+
FortScript can be configured in **two ways**: via a YAML file or directly through arguments in Python code.
85
+
86
+
### Option 1: YAML File
87
+
88
+
Create a file named `fortscript.yaml` in your project root:
76
89
77
90
```yaml
78
-
# Scripts that FortScript will manage
91
+
# ====================================
92
+
# FORTSCRIPT CONFIGURATION
93
+
# ====================================
94
+
95
+
# Scripts/projects that FortScript will manage
96
+
# FortScript starts these processes automatically
79
97
projects:
80
-
- name: "My Discord Bot"
81
-
path: "./bot/main.py"
98
+
- name: "My Discord Bot"# Friendly name (appears in logs)
> **Note:** The CLI currently runs FortScript from the `config.yaml`. Additional commands like `fort add` are planned for future versions.
258
+
> **Warning:**Currently, the CLI looks for settings in the package's internal file (`src/fortscript/cli/fortscript.yaml`), which limits local customization via CLI. For real projects, using a Python script (Options 1 to 3) is recommended until local CLI config support is implemented.
136
259
137
260
---
138
261
139
-
## Practical Example
262
+
## Practical Example: Gaming Mode
263
+
264
+
Imagine you are a developer who runs work scripts (bots, APIs, automations) during the day but wants to play at night without the PC lagging.
140
265
141
-
Imagine you have the following project structure:
266
+
In this example, we use FortScript's built-in game list (`GAMES`) so you don't have to configure each game manually.
0 commit comments