!7 static long timeout = 5000; static int maxEntries = 10; static AutoComboBox3 box; static JComboBox cbAction; static JTextArea taChat; p-noconsole { autoRestart(); smartBot_autoComplete_defaultMaxEntries = maxEntries; smartBot_autoComplete_defaultHardTimeout = timeout; box = autoComboBox3(f smartBot_autoComplete); centerComboBox(box); setFontSize(box, 20); setComboBoxListFontSize(box, 20); cbAction = jcombobox( "Say in Smart Bot's Chat", "Say in Stefan's Chat", "Open topic in browser"); onEnterWithClose(box, f doIt); taChat = jtextarea(); setFontSize(taChat, 16); showCenterFrame(800, 600, centerAndSouth(withMargin(withTitle("Smart Bot's Chat", taChat)), centerAndEast(box, jline(cbAction, jbutton("OK", f doIt))))); awtLater(box, 500, r { focus(box) }); smartBotsChat_onLine_chatMsg(10, voidfunc(ChatMsg m) { appendToTextAreaAndMoveCaret(taChat, (m.botMark ? "[BOT]" : "[USER]") + "\n" + rtrim(m.text) + "\n\n"); }); } sS input() { ret getText(box); } svoid doIt { S action = getText(cbAction); S s = input(); if (eqic(action, "Say in Smart Bot's Chat")) { if (!postToSmartBotsChat_user(s)) infoBox("!*&$"); } else if (eqic(action, "Say in Stefan's Chat")) { if (!postToStefansChat_user(s)) infoBox("!*&$"); } else openPlatformBrowser(smartBot_topicLink(s)); }