Example #1
0
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */
/** @require functions */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php";
$actions = isset($_POST["data"]) ? $_POST["data"] : false;
$send = isset($_GET["send"]) ? $_GET["send"] : false;
$shell = new COM("WScript.Shell");
$shell->AppActivate("Elite - Dangerous (CLIENT)");
if ($actions !== false) {
    foreach ($actions as $action) {
        if (substr($action, 0, 10) != "sleep_for_") {
            if (is_array($action)) {
                $repeat = $action[0];
                $keypress = $action[1];
                for ($i = 0; $i < $repeat; $i++) {
                    $shell->SendKeys($keypress);
                }
            } else {
                $shell->SendKeys("{" . $action . "}");
                echo $action;
            }
        } else {
            $sleep = str_replace("sleep_for_", "", $action);
            usleep($sleep);
        }
    }
    exit;
}
if ($send !== false) {
    $shell->SendKeys($send);
    //write_log($send);
Example #2
0
}
if ($mode === "del") {
    echo "Mode: restart (delete tasks)<br>";
    $valid = true;
}
if ($valid) {
    $WshShell = new COM("WScript.Shell");
    $obj = $WshShell->Run("SMS\\putty.exe -serial com5", 5, false);
    echo $obj;
    $WshShell->appactivate("PuTTy");
    $message = null;
    if ($mode === "keep") {
        $message = "SQQPC;RESTART;" . $name . ";0000;SQQPC";
    } else {
        if ($mode === "del") {
            $message = "SQQPC;REBOOT;" . $name . ";0000;SQQPC";
        }
    }
    sleep(1);
    $WshShell->SendKeys("AT{+}CMGF=1{ENTER}");
    $WshShell->SendKeys("AT{+}CMGS=");
    $WshShell->SendKeys("\"" . $number . "\"{ENTER}");
    $WshShell->SendKeys($message);
    sleep(1);
    $WshShell->SendKeys("^{z}");
    sleep(1);
    $WshShell->SendKeys("%{F4}" . "{ENTER}");
    echo "<br>Sent";
} else {
    echo "Wrong mode argument.<br>Message has not been sent.";
}