Poker::Robot - base class for building Mojo Poker poker robots
Version 0.02
package Poker::Robot::Mybot; use Moo; # Poker::Robot::Random shows a working example extends 'Poker::Robot::Random'; # override default method sub move { # move selection logic goes here } # and elsewhere in a script ... use Poker::Robot::Mybot; # Note: you must pick a unique username! $robot = Poker::Robot::Mybot->new( websocket => 'wss://localhost:443/websocket', username => 'Mybot', ring_ids => [ 1 ], ); $robot->connect;
Handlers are automatically executed at appropriate stages of the game, allowing your bot to run on autopilot. By default, these handlers return legal but essentially random values. Your job is to override them in your subclass with something that makes more sense. Poker::Robot::Random shows a working example.
Download and install Mojo Poker to set up your own poker server. This is where you can deploy your bot once it is ready and have it compete against other bots and humans in real-time.
To see what your bot is doing, do a tail -f on robot.log
Websocket address of the test server. Default is wss://localhost/websocket
Required. Ids of ring games to join. Before setting this attribute, bring up the test site on your browser to see which tables have open seats.
The following handlers can be overriden in your subclass with custom code for you robot. At some point I'll get around to documenting this better, but this will have to do for now.
guest_login login_snap ring_snap tour_snap player_snap table_snap message_snap table_update player_update login_update new_game end_game deal_hole begin_new_round begin_new_action deal_community showdown high_winner low_winner move_button forced_logout
notify_login notify_update_login notify_logout notify_create_ring notify_join_table notify_unjoin_table notify_post notify_bet notify_check notify_fold notify_discard notify_draw notify_credit_chips notify_table_chips notify_lobby_update notify_message notify_pick_game notify_lr_update
join_ring_res unjoin_ring_res watch_table_res unwatch_table_res login_res logout_res register_res bet_res check_res fold_res discard_res draw_res pick_game_res reload_res
join_ring unjoin_ring watch_table unwatch_table login logout register bet check fold discard draw pick_game reload
Nathaniel Graham, ngraham@cpan.org
ngraham@cpan.org
Please report any bugs or feature requests directly to ngraham@cpan.org
Copyright 2016 Nathaniel Graham.
This program is free software; you can redistribute it and/or modify it under the terms of the MIT license.
To install Poker::Robot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Poker::Robot
CPAN shell
perl -MCPAN -e shell install Poker::Robot
For more information on module installation, please visit the detailed CPAN module installation guide.