kranzky / megahal

MegaHAL is a learning chatterbot.

Home Page:https://rubygems.org/gems/megahal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

passing command-line arguments without interactive console

opened this issue · comments

Hello,
would it be possible to use MegaHAL via the command line without the interactive console so it could be wrapped in scripts?
Much thanks in advance.

@Wubix42: you can do that already; have a look at what the command-line does: https://github.com/jasonhutchens/megahal/blob/master/bin/megahal

here's a simple script:

#!/usr/bin/env bash

require 'megahal'

megahal = MegaHAL.new
megahal.become(:sherlock)
answer = megahal.reply("Hello Sherlock")
puts answer

Here's the API documentation: http://www.rubydoc.info/gems/megahal/MegaHAL#initialize-instance_method