tritonas00 / RoRServerBot

Rigs of Rods Multiplayer Bot for RoRNet 2.44, updated to Python 3 and Discord
2 stars 3 forks source link

Added new command "-roll" #7

Closed Goetterescu closed 7 months ago

Goetterescu commented 2 years ago

This command allows players to roll virtual dices. 1-6 dices from D4-D20 can be rolled. Please note that I had to implement the random package for this. I also made three variables global, feel free to correct my work if you want to make it better

Goetterescu commented 2 years ago

Any thoughts about adding this command to the bot?

tritonas00 commented 2 years ago

Hi! Will test soon.

tritonas00 commented 2 years ago

Just checked the code. It needs cleaning

the rest are fine, but the code needs to lineup with the rest existing code, for consistency

Goetterescu commented 2 years ago
  • random is already imported, see first line

Yep, we discussed this a while ago and you can remove that.

  • why the global vars?

See my answer above. During my test-phase I had issues with the those variables, so I made them global. For some reason it worked the usual way on your build. So please try to find your overworked version of my code (I can not access it atm)

  • whats the purpose of extra die_com and die_com2 vars?

Those are my own interpretations of the user input, feel free to use your arrays (a[0] and a[1] in this case) instead. It was just a solution for my own since I preferred it this way, the code was initially not meant to be used by others!

I could rewrite the code for you if you want to, but I am unable to test it since I am on vacation.