Git Product home page Git Product logo

arce's Introduction

Toepassingsopdracht Talen en automaten

Made by:

Dependencies:

  • JSON.hpp
  • A program that communicates with your chat program of choice
    • For testing purposes we use: fbchat
  • CMake
  • Make

Installation:

No permanent installation supported yet.

You will have to run the executable from the source directory.

git clone https://github.com/Loreas/ARCE.git
cd ARCE/
cmake .
make
./ARCE

How it works:

The bot reads all incoming messages. Messages starting with a chosen character (currently set as '!') should be handled by the bot, which writes it to a txt file (link/link.txt).

Now the ARCE program reads the file and validates both the command and its arguments with a Deterministic Finite Automaton. If it is valid, the program will execute the script that is associated with the command.

If the command is invalid (a typo has been made) it will be ran through a Levenshtein automaton to find a possible correct match which will then be sent to the chat.

If the arguments are invalid (not compliant with the pre-defined regex) the correct form will be sent to the chat.

Adding scripts:

Scripts (and executables) should be placed in the scripts folder. All languages should be supported, as long as they can write to a file.

The output should be written to link/linkToBot.txt, this way the chat bot can send the output. If you can't/don't want to write to a file, you can also send your output to the file like this ./scripts/executable > ./link/linkToBot.txt.

Remember to also add an entry in commands.json using this format:

{
      "name": "Example dice roll command",
      "description": "This is an example command for a dice roll",
      "command": "exampleRoll",
      "arguments": "(1+2+3+4+5+6+7+8+9)(0+1+2+3+4+5+6+7+8+9)*",
      "amountArgs": "1",
      "form": "exampleRoll <value>",
      "language": "python3",
      "execute": "python3 ./scripts/exampleRoll.py"
}

Possible commands:

  • !ball
  • !roll
  • !log start
  • !log stop
  • !log
  • !log list
  • !note

arce's People

Contributors

meyerjon avatar loreas avatar dawidmiroyan avatar

Watchers

James Cloos avatar

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.