1. #1
    Deleted

    Lightbulb Simulation bot for discord

    Hello,
    Due to all the none techie guys/girls in the guild I am in kept asking for help to do simulationcrafts to get stat weights and check dps did I take on the task on creating a discord bot that does all the boring stuff for you.

    This bot will require you having a TCI version of simulationcraft on the server the bot is running and a webserver is needed too. I would recommend having a CPU(s) with a total of at least 8 threads, else a sim will take too long.

    All setting are set from a .json file. This file needs to configured to your needs.
    Right now the bot does a 25000 iterations, this number can be set in user_data where you can tell it to use either the simulation ingame addon string or armory, stat scaling can also be activated.

    Bot has been tested on the following systems:
    • Debian 8
    • Ubuntu 16.04
    • RHEL 7
    • FreeBSD 11.0 SimulationCraft does not build well in FreeBSD
    • Windows 2016 Server

    Feel free to test it and come with input on what needs to be improved or features missing.

    https://github.com/stokbaek/simc-discord

    example of .json file:
    Code:
    {
      "server_opt": [
        {
          "serverid": "244541647122580469",
          "channelid": "266793125324014828",
          "token": "DISCORD BOT TOKEN"
        }
      ],
      "simcraft_opt": [
        {
          "website": "WEBSITE ADDR",
          "api_key": "KEY",
          "htmldir": "/var/www/simc/",
          "default_realm": "magtheridon",
          "executable": "/usr/local/sbin/simc-715",
          "region": "eu",
          "allow_iteration_parameter": true,
          "default_iterations": "25000",
          "fightstyles": ["Patchwerk", "LightMovement" ,"HeavyMovement", "HecticAddCleave", "HelterSkelter"],
          "aoe_targets": 6
        }
      ]
    }
    • serverid is used to change presence of the bot, this is what the bot uses to check if a simulation is running.
    • channelid is used to tell the bot what channel people are allowed to use the bot in. (Version check and help command is excluded for this lock)

    Any problems can we made as an issue on github or PM me on discord: stokbaek#1042
    Last edited by mmoc25a0d9b155; 2017-04-07 at 12:27 PM. Reason: Added discord name

  2. #2
    This is a really cool idea! I think a option to just parse and paste the DPS output with scalings as a workaround for not having a webserver would be handy.


    BTW the link to your github is broken.

  3. #3
    Deleted
    Quote Originally Posted by Snobby View Post
    This is a really cool idea! I think a option to just parse and paste the DPS output with scalings as a workaround for not having a webserver would be handy.


    BTW the link to your github is broken.
    Thanks, guess it was too late when I made the post

  4. #4
    Interesting. I have no clue how to set this up for my guild but do you have a discord running where we could look at this?

  5. #5
    Deleted
    Quote Originally Posted by Nastrand View Post
    Interesting. I have no clue how to set this up for my guild but do you have a discord running where we could look at this?
    I am running this on my guilds discord. I know that some people are using a fork version of this bot on the warlock discord. It is sort of the same happening there as in my bot except they have changed it abit around to be able to handle alot of people doing sims at the same time ( queue as for an example has been created in it)

  6. #6
    Deleted
    This seems awesome!

    I just tried to use it, and I got the following error :

    Code:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/site-packages/discord/client.py", line 307, in _run_event
        yield from getattr(self, event)(*args, **kwargs)
      File "simc.py", line 334, in on_ready
        print(check_simc())
      File "simc.py", line 57, in check_simc
        subprocess.Popen(simc_opts['executable'], universal_newlines=True, stderr=null, stdout=stdout)
      File "/usr/local/lib/python3.5/subprocess.py", line 676, in __init__
        restore_signals, start_new_session)
      File "/usr/local/lib/python3.5/subprocess.py", line 1282, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    PermissionError: [Errno 13] Permission denied
    What kind of Permissions are missing here? The user has full Access to the simc folder, tried it as root and got the same error. (Debian 8)
    Maybe someone can help me with this.

  7. #7
    The best way to obtain this is join the simcraft bot devs server and shoot him a msg

  8. #8
    Deleted

    Unhappy

    Quote Originally Posted by Grindfactor View Post
    The best way to obtain this is join the simcraft bot devs server and shoot him a msg
    Good call, unfortunately I dont know on what Discord he is

    //edit: something changed, I dont get the error anymore, but the bot wont connect to discord
    Last edited by mmoc7b2671dfe2; 2017-04-06 at 11:01 PM.

  9. #9
    Read your private messages.

  10. #10
    Deleted
    Quote Originally Posted by miko90 View Post
    Good call, unfortunately I dont know on what Discord he is

    //edit: something changed, I dont get the error anymore, but the bot wont connect to discord
    Sorry for not giving any sound. Seems like I dont get any notifications when a new reply is made.

    Are you still having issues?

  11. #11
    Deleted
    Hey,

    it actually works now! For everyone that has the same issue, the simc executable field had to be "/usr/local/sbin/simc/engine/simc" to work...
    Last edited by mmoc7b2671dfe2; 2017-04-07 at 05:39 PM.

  12. #12
    Deleted
    Quote Originally Posted by miko90 View Post
    Hey,

    it actually works now! For everyone that has the same issue, the simc executable field had to be "/usr/local/sbin/simc/engine/simc" to work...
    The error indicates that the bot didn't have execute rights on the simc application.

    When you say the field has to be /usr/local/sbin/simc/engine/simc did you change it in the code of simc.py or in user_data.json. I would recommend not changing in simc.py as it has been build around all custom data can be set in user_data.json including were the simc application is located.

  13. #13
    Deleted
    I have made some updates to the bot.

    • Bot now have a queue system.
    • Better error caching in a log file.


    Hope this will help people in the furture if they are getting errors.

    If people is having trouble feel free to pm me on discord: stokbaek#1042

  14. #14
    Deleted

    Lightbulb New update

    Some new updates:

    • Support any kind of simcraft data strings.
    • Improved queue system.

    This update will require installation of python-flask before it will work.

    Any new ideas on whats missing is welcome.

  15. #15
    Deleted
    Minor update:


    • Bot will no longer post position 0.
    • Added a timeout option to the sim. This timeout can be set in user_data.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •