| 88 | } |
| 89 | |
| 90 | void BWScriptEmulator::onSendText(std::string text) |
| 91 | { |
| 92 | std::stringstream ss(text); |
| 93 | std::string cmd; |
| 94 | ss >> cmd; |
| 95 | |
| 96 | if ( cmd == "/fc" || cmd == "/farcast" ) |
| 97 | { |
| 98 | farcasting = !farcasting; |
| 99 | Broodwar << "Farcasting " << (farcasting ? "ENABLED" : "DISABLED") << std::endl; |
| 100 | } |
| 101 | else if ( cmd == "/r" || cmd == "/run" || cmd == "/script" ) |
| 102 | { |
| 103 | std::string script; |
| 104 | ss >> script; |
| 105 | |
| 106 | AICreateThread(script.c_str(), Broodwar->getScreenPosition() + Broodwar->getMousePosition() ); |
| 107 | } |
| 108 | else |
| 109 | { |
| 110 | Broodwar->sendText("%s", text.c_str()); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | void BWScriptEmulator::onReceiveText(BWAPI::Player player, std::string text) |
| 115 | {} |
nothing calls this directly
no test coverage detected