Skip to content

Seabattle game for WinDrop/Eggdrop!

License

Notifications You must be signed in to change notification settings

GamesLT/SeaBattle.tcl

Repository files navigation

License GitHub release Docker Build Status Docker Pulls Readme In English Readme In Lithuanian

Seabattle

Screenshot

What is this?

This is scripts adds a possibility to play classical Sea batlle/Battleship game in IRC channel to Eggdrop/Windrop bots.

Features included in this script:

  • Text-only
  • Multiplayer for two users
  • Use MySQL for game data
  • Build-in user registrations
  • Nickserver support
  • Multilanguage support

How to install?

There are two options:

1. Use Docker container (recommended)

Docker is one of best ways to quickly to run any process isolated and you can it use too also for running SeaBattle!

You need just run this command on the server:

docker run -d \
           -e SEABATTLE_DB_USER=seabattle \
           -e SEABATTLE_DB_PASS=seabattle \
           -e SEABATTLE_DB_HOST=hostname \
           -e SEABATTLE_DB_NAME=seabattle \
           gameslt/seabattle.tcl

SEABATTLE_DB_USER, SEABATTLE_DB_PASS, SEABATTLE_DB_HOST, SEABATTLE_DB_NAME values must be choiced by yourself..

Also it's possible to use other configuration option:

Parameter Default value Where is used?
SEABATTLE_BOT_PASS botsky Bot password
SEABATTLE_DB_USER MySQL database username
SEABATTLE_DB_PASS MySQL database password
SEABATTLE_DB_HOST MySQL database server address
SEABATTLE_DB_NAME MySQL database name
SEABATTLE_LANGUAGE en Game language. Possible values: en, lt
SEABATTLE_GRID_HORIZONTAL_WORD games Horizontal word for game (the word can't have same letters)
SEABATTLE_GRID_VERTICAL_WORD 12345 Vertical word for game (the word can't have same letters)
SEABATTLE_SHIPS_COUNT 5 How many ships will be on battlefield?
SEABATTLE_NICKSERV_AUTH_NEEDED false Do we need NickServ auth for the bot?
SEABATTLE_NICKSERV_HOST irc.data.lt NickServ hostname
SEABATTLE_NICKSERV_TIMEOUT 5 How many seconds bot should wait for NickServ answer, befeore deciding that auth didn't happened
SEABATTLE_LOG_QUERIES no Print SQL queries in console?
EGGDROP_BOTNET_NICK SeaBattle One of EggDrop/WinDrop settings: botnet-nick. More about it you can find in oficiall EggDrop documentation.
EGGDROP_PROTECT_TELNET 0 One of EggDrop/WinDrop settings: protect-telnet. More about it you can find in oficiall EggDrop documentation.
EGGDROP_DCC_SANITY_CHECK 0 One of EggDrop/WinDrop settings: dcc-sanitycheck. More about it you can find in oficiall EggDrop documentation.
EGGDROP_IDENT_TIMEOUT 5 One of EggDrop/WinDrop settings: ident-timeout. More about it you can find in oficiall EggDrop documentation.
EGGDROP_REQUIRE_PARTY 0 One of EggDrop/WinDrop settings: require-p. More about it you can find in oficiall EggDrop documentation.
EGGDROP_OPEN_TELNETS 0 One of EggDrop/WinDrop settings: open-telnets. More about it you can find in oficiall EggDrop documentation.
EGGDROP_STEALTH_TELNETS 0 One of EggDrop/WinDrop settings: stealth-telnets. More about it you can find in oficiall EggDrop documentation.
EGGDROP_USE_TELNET_BANNER 0 One of EggDrop/WinDrop settings: use-telnet-banner. More about it you can find in oficiall EggDrop documentation.
EGGDROP_CONNECTION_TIMEOUT 90 One of EggDrop/WinDrop settings: connect-timeout. More about it you can find in oficiall EggDrop documentation.
EGGDROP_DCC_FLOOD_THR 3 One of EggDrop/WinDrop settings: dcc-flood-thr. More about it you can find in oficiall EggDrop documentation.
EGGDROP_TELNET_FLOOD 5:60 One of EggDrop/WinDrop settings: telnet-flood. More about it you can find in oficiall EggDrop documentation.
EGGDROP_PARANOID_TELNET_FLOOD 1 One of EggDrop/WinDrop settings: paranoid-telnet-flood. More about it you can find in oficiall EggDrop documentation.
EGGDROP_RESOLVE_TIMEOUT 15 One of EggDrop/WinDrop settings: resolve-timeout. More about it you can find in oficiall EggDrop documentation.
EGGDROP_MAX_DCC 50 One of EggDrop/WinDrop settings: max-dcc. More about it you can find in oficiall EggDrop documentation.
EGGDROP_ALLOW_DK_CMDS 1 One of EggDrop/WinDrop settings: allow-dk-cmds. More about it you can find in oficiall EggDrop documentation.
EGGDROP_MODULES dns channels server ctcp irc notes console transfer share What modules for EggDrop/WinDrop to load?
EGGDROP_CHECK_MODULES blowfish Modules for data checking/verifying
EGGDROP_NICK SeaBattle One of EggDrop/WinDrop settings: nick. More about it you can find in oficiall EggDrop documentation.
EGGDROP_ALTNICK SeaBattleBot One of EggDrop/WinDrop settings: altnick. More about it you can find in oficiall EggDrop documentation.
EGGDROP_ADMIN owner One of EggDrop/WinDrop settings: admin. More about it you can find in oficiall EggDrop documentation.
EGGDROP_REAL Bot for Games.lt One of EggDrop/WinDrop settings: realname. More about it you can find in oficiall EggDrop documentation.
EGGDROP_SERVERS irc.data.lt Servers list where to connect automatically
EGGDROP_CHANNELS #seabattle Channels where to join
EGGDROP_NET_TYPE 5 One of EggDrop/WinDrop settings: net-type. More about it you can find in oficiall EggDrop documentation.
EGGDROP_LISTEN_USERS_PORT 3333 Port where bot should listen for users
EGGDROP_LISTEN_BOTS_PORT 3333 Port where bot should listen for other bots
EGGDROP_OWNERS One of EggDrop/WinDrop settings: owner. More about it you can find in oficiall EggDrop documentation.
EGGDROP_SYSTEM_SCRIPTS alltools action.fix compat userinfo What system script to load
EGGDROP_SYSTEM_HELPS userinfo What system language files to load?

2. Install manually

First thing what you need is to make sure that your Eggdrop/Windrop bot is running. How to do, you can find information at your choised bot website. Next things todo:

  • Download the latest release archive
  • Unpack archive
  • Copy src/ files into folder for your bot scripts
  • Add source seabattle_main.tcl line in your eggdrop.conf file (NOTE: you need to prefix seabattle_main.tcl with correct path)
  • Install mysqltcl library (if you use bot on windows or on shared server download compiled 3.02 version and put in tcllibs (create if this folder doesn't exists in your system!) subfolder in same folder where seabattle.tcl is placed.
  • Create new MySQL database and import there install.sql
  • Edit settings in seabattle_config.tcl
  • Run your bot.

How to develop?

If you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, try interactive GitHub tutorial.

It's possible to run Seabattle in local machine with Vagrant. All required files exists in this repo. In that case you must just clone the repo and run vagrant up. Than it's possible to connect to IRC server at seabattle.test and join #seabattle IRC channel. There the bot should sit.