Giter VIP home page Giter VIP logo

luna_bot's Introduction

Lunabot - Digimon TCG Memory Gauge Discord Bot

Lunabot is a Discord bot designed to enhance the Digimon Trading Card Game (TCG) experience by providing a customizable digital intractable memory gauge to assist with online and offline play.

Click here to add to your server.

Features

  • Memory Gauge Tracking: Lunabot helps players keep track of their memory gauge during Digimon TCG matches.

  • Command Prefix: The default command prefix is !, but it can be customized.

Building from Source

Prerequisites

Installation

  1. Put your font of choice in Templates named font.ttf

  2. Put your counters in Counters named 1.png... Then add them in the function get_counter_bytes() in memory_gauge.rs. Then change number of counters in change_counter() in commands.rs (Or stick with default 5)

  3. Put your gauges in Gauges named 1.jpg... Then add them in the function get_gauge_bytes() in memory_gauge.rs. Then change number of counters in change_gauge() in commands.rs (Or stick with default 17)

  4. If you changed the number of gauges and counters you will also want to change the text in Responses

  5. Clone the repository:

    git clone https://github.com/yourusername/lunabot.git
  6. Navigate to the project directory:

    git cargo build --release
  7. Add the bot secret token. (Replace TOKEN with your token)

    export LUNABOT_TOKEN=TOKEN
  8. You will want to put a folder beside the executable called Table for temporary storage of gauge images.

Commands

!start @Player - Starts a new match.

!end - Ends the current game.

!reset - Starts a new game with the same player.

!pass - Passes turn resetting energy to 3.

!status - Checks your match information.

+3 - Add energy.

-3 - Spend energy.

Customization (Lasts until game is !end You can !reset though.)

a. !board 15 - Changes the memory gauge. Accepts 1 to 17.

b. !counter 5 - Change the energy counter. Accepts 1 to 5.

c. Color commands to change your name color:

!color Red - For default colors.

!color #ffffff or !color #fff - To use hex color codes

!color (100,100,100) or !color 100,100,100 - To use RGB color codes.

Contributing

If you'd like to contribute to Lunabot, feel free to open an issue or submit a pull request. All contributions are welcome!

Currently, we could really could be assisted by any artists interested in making more custom memory gauges, counters, and a profile picture for the bot.

The counters are (80px,80px), the memory gauges are (500px,350px). 2 examples of psd's with placement of memory gauge and template are in the main directory.

On the code side optimization, code cleanup, and bug fixes are the current priority however there are some features being considered for future updates.

License

This project is licensed under the MIT License.

luna_bot's People

Contributors

0xdema avatar

Stargazers

 avatar

Watchers

 avatar

luna_bot's Issues

Conf file to store player preferences for color/board/font?

It does not feel worth setting up with so few users, and my server has very very little space left.
Save time by creating the board when game starts or board is changed only, then just place the counter on turn changes.
This is an idea I came up with later down the line to help with optimization but would take more server space and only would matter if bot runs slowly due to amount of players.

Find way to make it safely without using unsafe.

The main reason I am using unsafe is because I could not find another way to have a variable that could be edited and accessed anywhere without making it an unsafe static. I am sure there is probably a better way to do it but i am still pretty early into learning rust.

Updated 2/6/24: I was learning more rust and looking into other code and I believe that I have a solution, currently there is no timeframe on when I will fix this as I'm working on other projects right now, it should be in the next update however.

Sending image directly from memory

From what I've found it is not yet possible due to serenity-rs having issues not being able to create the magic numbers on the fly which causes it to crash unless saved. As a note the magic numbers are a hex header that each file has that lets the computer know what filetype it is and therefore how to handle the data.

Card Search Feature

I have created bots in the past which can do this for other card games, I am considering having that as another feature but if I do add it I still don't plan to go too in depth with it, and do feel that it'd be better suited for another bot. I may make this as an api or library instead, but am not fully sure I wish to do this still.

Replace GAME_DATA with a more suitable datatype (Struct/Enum/Tuple)

Having everything be a vector array made sense at the start as I was just storing discord ID's and the energy. As I kept coming up with more features I realized how it could benefit from a better datatype. Instead of doing this I wanted to take the challenge of making my own functions to make the rgb colors storable as an integer as this project was more of coding practice and my first project in learning rust.

Update on 2/6/24: I've been looking into this further and am thinking that for future updates it will be a lot better to update this to using a Vec, I am not sure when the next update will be however the next update should include this.

Use a loop to find the file for counters/gauges

Originally the Templates file was outside of the src like the Table file but I really wanted to store nothing on the computer with this project, it was a limitation I set for myself. It can easily be changed back to be a folder outside of the binary/exe file and work fine as a loop. The issue is because I am using a macro include_bytes to grab the image and font files from the binary/exe's memory. Include_bytes needs to know at the time of compilation so it does not accept anything that isn't final. get_gauge_bytes and get_counter_bytes work in meantime however require an update anytime a new image is added.

Custom Graphics Needed

I'd be real appreciative of any artist that wants to help with some graphics for the live version of the bot.

  • We would like some digimon themed counters (80px,80px).
  • We would like a better version of the template made. I get that the quality isn't the greatest but the bot does rely on those positions.
  • We would be interested in memory gauges being made using your custom art and if they fit will they will be added to the live bot which will credit you. (500px,350px)
  • We are also interested in a profile picture for the bot as well.

If there's anyone with interest feel free to help out!

Focus on speed optimization and reduction of code size

With this being my first project and also having many more features added later on the overall code size and speed were affected.

Update on 2/6/24: I have some changes I am planning to implement, some should come in next update but this is still something that I will keep re-addressing as I learn more.

Custom fonts?

I think I'd only want to set this up if there is a conf file as there'd be too many customizations to do every single game.

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.