diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-08-15 18:45:29 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-08-15 18:45:29 -0400 |
commit | 0baed246b6f287e1c03519536011f34e87d19920 (patch) | |
tree | d9eb44f28d8ad5edf7e78f47e3bdb830114a7432 /main.cpp | |
parent | d7fbb904d0dc70d1eada1dbb5f57f2ee9e5b399f (diff) | |
download | infinite-modern.tar.gz infinite-modern.tar.bz2 infinite-modern.zip |
Started to modernize bot (this is completely broken) modern
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..7f2dfa0 --- /dev/null +++ b/main.cpp | |||
@@ -0,0 +1,33 @@ | |||
1 | #include "infinite.h" | ||
2 | |||
3 | int main(int argc, char** argv) | ||
4 | { | ||
5 | Magick::InitializeMagick(nullptr); | ||
6 | |||
7 | std::random_device randomDevice; | ||
8 | std::mt19937 rng(randomDevice()); | ||
9 | |||
10 | if (argc != 2) | ||
11 | { | ||
12 | std::cout << "usage: infinite [configfile]" << std::endl; | ||
13 | return -1; | ||
14 | } | ||
15 | |||
16 | std::string configfile(argv[1]); | ||
17 | |||
18 | try | ||
19 | { | ||
20 | infinite bot(configfile, rng); | ||
21 | |||
22 | try | ||
23 | { | ||
24 | bot.run(); | ||
25 | } catch (const std::exception& ex) | ||
26 | { | ||
27 | std::cout << "Error running bot: " << ex.what() << std::endl; | ||
28 | } | ||
29 | } catch (const std::exception& ex) | ||
30 | { | ||
31 | std::cout << "Error initializing bot: " << ex.what() << std::endl; | ||
32 | } | ||
33 | } | ||