mirror of
https://github.com/correl/mercenary.git
synced 2024-11-23 19:19:51 +00:00
Correl Roush
7315012830
Also, some placeholder functions for the great and powerful script manager! git-svn-id: file:///srv/svn/ircclient/trunk@2 a9804ffe-773b-11dd-bd7c-89c3ef1d2733
39 lines
991 B
C++
39 lines
991 B
C++
#include <QTextStream>
|
|
#include "script.h"
|
|
|
|
int main(int argc, char* argv[]) {
|
|
QTextStream output(stdout);
|
|
|
|
MIRCScriptManager *mirc = new MIRCScriptManager;
|
|
MIRCScript *ms = new MIRCScript(mirc);
|
|
if (argc < 2) {
|
|
output << "No mIRC script file was specified!\n";
|
|
return(1);
|
|
}
|
|
output << "Attempting to load " << argv[1] << "\n";
|
|
if (ms->load(argv[1])) {
|
|
output << "MRC LOADED\n";
|
|
output << "Code:\n" << ms->code();
|
|
output << "Aliases:\n";
|
|
QMapIterator<QString, mirc_alias> alias(ms->aliases());
|
|
while(alias.hasNext()) {
|
|
alias.next();
|
|
output << (alias.value().global ? "global" : "local");
|
|
output << " " << alias.key() << "\n";
|
|
}
|
|
if (ms->run()) {
|
|
output << "MRC RAN SUCCESSFULLY\n";
|
|
QMapIterator<QString, QString> i(ms->variables());
|
|
output << "Variables:\n";
|
|
while(i.hasNext()) {
|
|
i.next();
|
|
output << i.key() << " = " << i.value() << "\n";
|
|
}
|
|
}
|
|
} else {
|
|
output << "Failed to load " << argv[1] << "\n";
|
|
return(1);
|
|
}
|
|
|
|
return 0;
|
|
}
|