- $this->uplink->privmsg($this->bot, $entry['channel'], $line);
- }
- }
- if(!file_exists("tmp/debug_".$entry['id'].".class")) {
- unlink("tmp/debug_".$entry['id'].".java");
- break;
- }
+ ";
+ } else {
+ $javacode = "import java.*;
+ @SuppressWarnings(\"unused\")
+ public class Debug_".$entry['id']." {
+ ".$exp[1]."
+ }
+ ";
+ };
+ $fp = fopen("tmp/Debug_".$entry['id'].".java", "w");
+ fwrite($fp, $javacode);
+ fclose($fp);
+ $err = shell_exec("javac tmp/Debug_".$entry['id'].".java 2>&1");
+ if($err) {
+ $err=str_replace("\r","",$err);
+ $lines=explode("\n",$err);
+ $i=0;
+ foreach($lines as $line) {
+ if($line == "") continue;
+ $i++;
+ if($i>100) {
+ $this->uplink->privmsg($this->bot, $entry['channel'], "too many lines!");
+ break;
+ }
+ $this->uplink->privmsg($this->bot, $entry['channel'], $line);
+ }
+ }
+ if(!file_exists("tmp/Debug_".$entry['id'].".class")) {
+ unlink("tmp/Debug_".$entry['id'].".java");
+ break;
+ }