Toribash Community » Toribash » Mods » Third party
Reply
 
Thread Tools Display Modes
Old Aug 18, 2019   #1
Gamerbad
Senior Member
 
10th Dan Black Belt
Join Date: Mar 2008
Posts: 1,289



[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
Gamerbad is offline   Reply With Quote
Old Aug 18, 2019   #2
Ronan
 
10th Dan Black Belt
Join Date: Nov 2012
Posts: 631
Clan: Nest



Mind adding Smurf to it?
Ronan is offline   Reply With Quote
Old Aug 18, 2019   #3
Aeon
 
Ruined my life to get this Belt
Join Date: Jan 2008
Posts: 461
Clan: Hack



Keep in mind that such bots are illegal. It's an awesome work though.
Aeon is offline   Reply With Quote
Old Aug 18, 2019   #4
tertywerty
Big bad bully :'(
 
10th Dan Black Belt
Join Date: Nov 2006
Posts: 6,289
Clan: Evil



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
ToriAgent Admin
[Evil] is recruiting!

<DesiTwist> terty plays tb with the ghost turned off, uke turned off and uses that mouse with the ball in it
tertywerty is online now   Reply With Quote
Old Aug 19, 2019   #5
Gamerbad
Senior Member
 
10th Dan Black Belt
Join Date: Mar 2008
Posts: 1,289



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
Gamerbad is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:44 PM.




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game