send("s" . $cmd4 . $cmd5 . $cmd6); pause2(100); //sleep(1); $lo += fread($fp, 100); } for ($i = 65; $i > 0; $i -= 1) { //$cmd1="s01".($i+60).";"; $cmd1 = "02" . (90 - $i) . ";"; $cmd2 = "03" . (48 + $i * 2) . ";"; $cmd3 = "04" . (90 + $i) . ";"; $cmd4 = "11" . (90 - $i) . ";"; $cmd5 = "10" . (45 + $i * 2) . ";"; $cmd6 = "09" . (97 + $i) . ";"; send("s" . $cmd1 . $cmd2 . $cmd3); send("s" . $cmd4 . $cmd5 . $cmd6); pause2(100); //sleep(1); $lo += fread($fp, 100); } send("s0290;0345;0490;"); send("s1190;1045;0990;"); //sleep(10); fclose($fp); print $lo; print "OK"; function send($str) { global $fp; print microtime(true) . " Send: "; for ($i = 0; $i < strlen($str); $i++) { fwrite($fp, substr($str, $i, 1));
function send($str, $wait = false) { global $fp; print microtime(true) . " Send: "; for ($i = 0; $i < strlen($str); $i++) { fwrite($fp, substr($str, $i, 1)); print substr($str, $i, 1); } //fwrite($fp, '\n'); fwrite($fp, "\n"); if ($wait) { pause2(100); } print "\n<br>"; }