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 { daemon "Connect" { while (licensed() && on) { pcall { 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) {} } io = null; sleepSeconds(5); } } } }