Metadata-Version: 2.4
Name: pyscreeps-arena
Version: 0.7.1
Summary: Python api|interface to play game: Screeps: Arena.
Author-email: 2229066748@qq.com
Maintainer: Eagle'sBaby
Maintainer-email: 2229066748@qq.com
License: Apache Licence 2.0
Keywords: python,screeps:arena,screeps
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: <3.13,>=3.12
Description-Content-Type: text/markdown
Requires-Dist: pyperclip
Requires-Dist: colorama
Requires-Dist: py7zr
Requires-Dist: chardet
Requires-Dist: Transcrypt==3.9.1
Requires-Dist: PyQt6
Requires-Dist: mkdocs
Requires-Dist: mkdocstrings[python]
Requires-Dist: mkdocs-material
Requires-Dist: fastmcp<3,>=2
Requires-Dist: Pillow
Requires-Dist: beautifulsoup4
Requires-Dist: requests
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

[![Python](https://img.shields.io/badge/python-==3.12-blue.svg)](https://www.python.org/downloads/) [![Pyscreeps-Arena](https://img.shields.io/pypi/v/pyscreeps-arena.svg?label=Pyscreeps-Arena)](https://pypi.org/project/pyscreeps-arena/)

V0.7.0: Support for season4.
[Update Details](https://github.com/EagleBaby/python_screeps_arena/blob/main/updates.md)

# Welcome to PyScreeps-Arena

&nbsp;&nbsp;&nbsp;&nbsp;This project is for players who want to play Screeps: Arena with python. The project provides a 'standard library' (std.py) to act as a glue layer between js and python. Players write their own logic code in the main.py loop, and run build.py to generate main.mjs

<font color="#FC8480">
&nbsp;&nbsp;&nbsp;&nbsp;Please note that the codes for `Screeps:Arena` and 'Screeps:World' are not compatible.

</font><font color="gray">

&nbsp;&nbsp;&nbsp;&nbsp;(If you want to play Screeps:World, i recommend you to try the Github project: ['screeps-starter-python'](https://github.com/daboross/screeps-starter-python))
</font>

## 1. Quick Prepare Environment

&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FCAE80>This project need python == 3.12 (for the limit of `transcrypt`). </font>Please make sure you have download&install from python.org


&nbsp;&nbsp;&nbsp;&nbsp;Use python pip to install this package:
&nbsp;&nbsp;&nbsp;&nbsp;```pip install pyscreeps-arena```

&nbsp;&nbsp;&nbsp;&nbsp;Use cmd command to create a new game project:
&nbsp;&nbsp;&nbsp;&nbsp;```pyscreeps-arena 'Your Project Path'```
&nbsp;&nbsp;&nbsp;&nbsp;(or the short alias: ```psanew 'Your Project Path'```)

&nbsp;&nbsp;&nbsp;&nbsp;Use GUI cmd command to create a new game project:
&nbsp;&nbsp;&nbsp;&nbsp;```psaui```

&nbsp;&nbsp;&nbsp;&nbsp;Use GUI cmd command to view map and mark element as code(map at `/docs/maps`):
&nbsp;&nbsp;&nbsp;&nbsp;```psaui -m```

&nbsp;&nbsp;&nbsp;&nbsp;Use GUI cmd command to replay a local simulation battle:
&nbsp;&nbsp;&nbsp;&nbsp;```psaplay <replay_output_dir>```

&nbsp;&nbsp;&nbsp;&nbsp;Use cmd command to start the MCP server (for AI-assisted development):
&nbsp;&nbsp;&nbsp;&nbsp;```psamcp```

&nbsp;&nbsp;&nbsp;&nbsp;Use your editor to open the project<font color="gray">(recommand PyCharm)</font>.


## 2. Tutorial

* [Tutorial 1: Console Output](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/1.md)
* [Tutorial 2: Object Acquisition and Movement](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/2.md)
* [Tutorial 3: Attacking Enemies](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/3.md)
* [Tutorial 4: Creep Composition](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/4.md)
* [Tutorial 5: Resource Fetch and Deposit](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/5.md)
* [Tutorial 6: Terrain Impact](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/6.md)
* [Tutorial 7: Creating New Creeps](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/7.md)
* [Tutorial 7+: Creating New Creeps (Object-Oriented)](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/7%2B.md)
* [Tutorial 8: Harvesting Energy](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/8.md)
* [Tutorial 8+: Harvesting Energy (Object-Oriented)](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/8%2B.md)
* [Tutorial 9: Building Construction](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/9.md)
* [Tutorial 10: Final Test](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/10.md)
* [Tutorial 10+: Final Test (Object-Oriented)](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/10%2B.md)
* [Extra: Behavior Tree](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/Behavior%20Tree.md)
* [Extra: Event System](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorial/Event%20System.md)

&nbsp;&nbsp;&nbsp;&nbsp;中文教程见仓库 [tutorial - cn](https://github.com/EagleBaby/python_screeps_arena/tree/main/tutorial%20-%20cn) 目录。

## 3. Transcrypt: Different between python and js
* in python:```if []:``` is False, but get true in js.
* in python:```_list[-1]``` is ok, but not work in js.
* in python： use ```dict.py_get()``` instead of ```dict.get()```
* in python： use ```container.py_clear()``` instead of ```container.clear()```
* operator reaload do not work in js. Mean in python```[1] * 5``` do not work in js.
* kwargs do not work in js. Mean in python```func(1, b = 5)``` do not work in js.

## 4. Document

&nbsp;&nbsp;&nbsp;&nbsp;See *.md under the `docs` folder of your game project (tutorials, system guides, season notes and arena maps).

## Last

&nbsp;&nbsp;&nbsp;&nbsp;Goodluck & Have fun. :)
