sclass StefansOS_ConnectToServer { DialogIO io; volatile bool on; void start { on = true; connect(); doEvery_daemon(30000, r { if (io != null) io.sendLine("") }); } void cleanMeUp { on = false; } void connect { thread "Connect" { while (licensed() && on) { try { io = talkTo("smartbot.botcompany.de", 6000); io.getSocket().setSoTimeout(30000+10000); print("Connected."); temp tempAfterwards(r { print("Disconnected.") }); io.sendLine(format("computerID=*", computerID())); print("Sent computer ID: " + computerID()); S line; while ((line = io.readLine()) != null) {} } catch e { // pcall would also do an annoying message box printShortException(e); } io = null; sleepSeconds(5); } } } }