Toribash
Original Post
[REL] Toribash Bot Library in Dart
Worked on this over the weekend, a library that makes it easy to write bots for Toribash.

I've written some documentation and have some examples on my GitHub:

- https://github.com/HelgeSverre/dart-toribash-bot
- https://pub.dev/packages/toribash_bot


If you want to check it out, please respect the bot rules here


Example of working bot code:

dart code:

import 'package:toribash_bot/credentials.dart';
import 'package:toribash_bot/events/room_connected.dart';
import 'package:toribash_bot/toribash_bot.dart';

main(List<String> args) async {
String roomName = "testroom";

ToribashBot bot = ToribashBot(
Credentials("USERNAME", "PASSWORD"),
);

bot.events.roomConnected.listen((RoomConnectedEvent event) {
Future.delayed(Duration(seconds: 5), () {
bot.say("Hello world!");
});

Future.delayed(Duration(seconds: 10), () {
bot.disconnect();
});
});

bot.join(roomName);
}



In the future I want to add events and functionality around controlling the match, parsing wins, handling bets, knowing when a turn happens etc, possibly add "replay" logging into it as well.

Tell me what you think.
Helge Sverre - System Developer
https://helgesverre.com
As long as the bots people make do not use the chat, manage rooms (without the presence of a human operator) , are not the house of the bet server, or be in the active queue than they will be alright.

Great work Gamerbad

[Evil] is recruiting!

<DesiTwist> terty plays tb with the ghost turned off, uke turned off and uses that mouse with the ball in it
Originally Posted by Ronan View Post
Mind adding Smurf to it?

What do you mean by adding smurf?

Originally Posted by Aeon View Post
Keep in mind that such bots are illegal. It's an awesome work though.

Originally Posted by tertywerty View Post
As long as the bots people make do not use the chat, manage rooms (without the presence of a human operator) , are not the house of the bet server, or be in the active queue than they will be alright.

Great work Gamerbad


Thanks, IMO the rules are a bit strict when it comes to bots in private servers, I don't see the harm in having a bot respond to commands (novelty stuff like !bot weather) and the like, as long as it doesn't interfere with gameplay.

But this is only a library, what people do with it is their own responsibility, it was interesting to build though, learned more about dart streams, socket programming in dart and it's my first package on pub.dev, worthwhile exercise even if nobody ends up using it.
Helge Sverre - System Developer
https://helgesverre.com