From 0baed246b6f287e1c03519536011f34e87d19920 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 15 Aug 2018 18:45:29 -0400 Subject: Started to modernize bot (this is completely broken) --- 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..7f2dfa0 --- /dev/null +++ b/main.cpp @@ -0,0 +1,33 @@ +#include "infinite.h" + +int main(int argc, char** argv) +{ + Magick::InitializeMagick(nullptr); + + std::random_device randomDevice; + std::mt19937 rng(randomDevice()); + + if (argc != 2) + { + std::cout << "usage: infinite [configfile]" << std::endl; + return -1; + } + + std::string configfile(argv[1]); + + try + { + infinite 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