From 7ba70196fd05a893a851f24a07868e3a1e9a7818 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 3 Mar 2017 18:17:37 -0500 Subject: Created bot --- main.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..ae49523 --- /dev/null +++ b/main.cpp @@ -0,0 +1,33 @@ +#include "grunge.h" + +int main(int argc, char** argv) +{ + Magick::InitializeMagick(nullptr); + + std::random_device randomDevice; + std::mt19937 rng(randomDevice()); + + if (argc != 2) + { + std::cout << "usage: grunge [configfile]" << std::endl; + return -1; + } + + std::string configfile(argv[1]); + + try + { + grunge bot(configfile, rng); + + try + { + bot.run(); + } catch (const std::exception& ex) + { + std::cout << "Error running bot: " << ex.what() << std::endl; + } + } catch (const std::exception& ex) + { + std::cout << "Error initializing bot: " << ex.what() << std::endl; + } +} -- cgit 1.4.1