Giter Site home page Giter Site logo

slaythecli's Introduction

SlayTheCli

SlayTheCli: A console client for the game Slay The Spire

This repository is a tutorial on how to use the SlayTheCli client/server in order to play Slay the Spire from a console. You will need a copy of Slay the Spire (which by the way is one of the greatest video game of all time) and to install 2 mods.

  • CommunicationMod
  • BaseMod

Installation

  1. Clone this repository, go inside the slaythecli folder and then get the 2 git submodules needed by SlayTheCli
cd slaythecli
git submodule update -i
  1. Install maven on your system in order to build a version of the CommunicationMod which adds description to card.
  2. Go to the CommunicationMod repository folder and generate the modified version of CommunicationMod.jar
cd CommunicationMod/
mvn package
  1. Locate the original CommunicationMod.jar from the game (make a backup copy) and replace it with the one generated on the target folder by maven.
  2. Install python3 and pip3 on your system
  3. Go to the spirecomm repository folder and install the python3 requirements with pip3
cd ../spirecomm/
pip3 install -r slaythecli_requirements.txt
  1. Edit your CommunicationMod config file and set the command to python3 path_to_spirecomm/slaythecli.py server
  • Windows: %LOCALAPPDATA%\ModTheSpire\CommunicationMod\config.properties
  • Linux: ~/.config/ModTheSpire/CommunicationMod/config.properties
  • Mac: ~/Library/Preferences/ModTheSpire/CommunicationMod/config.properties

example:

#Sat Jul 11 13:50:20 CEST 2020
command=python3 /home/foo/slaythecli/spirecomm/slaythecli.py server
runAtGameStart=true

The slaythecli.py python3 program takes some arguments

usage: slaythecli.py [-h] [--ip [IP]] [--port [PORT]] [-v] {client,server}

positional arguments:
  {client,server}  client or server

optional arguments:
  -h, --help       show this help message and exit
  --ip [IP]        The server IP to bind to
  --port [PORT]    The server port
  -v, --verbose    Add some logging
  1. You can try running the server yourself :
python3 /home/foo/slaythecli/spirecomm/slaythecli.py server

If everything is working fine, you should see a message saying "ready"

  1. To get latest version of the program you have to do the following commands in the slaythecli repository :
git pull
git submodule update -i

If CommunicationMod submodule changed, you will have to regenerate the jar file with maven

Start Slay the CLI

  1. Start Slay the Spire with only BaseMod and CommunicationMod ticked (Other mods may work but it's not guaranteed)
  2. Check that CommunicationMod started with the following logs in the ModTheSpire logs
   - Communication Mod
   - communicationmod.CommunicationMod
20:45:24.190 INFO communicationmod.DataReader> Received message: ready
20:45:24.191 INFO communicationmod.CommunicationMod> Received message from external process: ready
   - 115ms
Done.
  1. Start SlayTheCli in client mode :
python3 /home/foo/spirecomm/slaythecli.py server

And that's it

known issues

  • SlayTheCli is not compatible with the watcher at the moment
  • Some unexpected behavior may happens if you play from the game at the same time
  • Sometimes you may encounter exception error from the cli, in these case, just use ctrl+c until you leave the program. Normally you will be able to reopen the client just after (if the exception can be reproduced, open an issue, I will try to fix the bug as soon as possible)

If you encounter any bugs, don't hesitate to open an issue on this repository with some logs or explanation.

A last word

SlayTheCli tries to be as user friendly as possible by hiding indexes and commands sent to the game. But you can still send direct commands from the "other" command which allows to directly enter your command.

I also invite you to read the documentation from the CommunicationMod : https://github.com/ForgottenArbiter/CommunicationMod and you can add the option --verbosity to slaythecli client in order to see the commands sent to server when you play

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.