Warning: session_start(): open(/var/lib/php/sessions/sess_ka1vlb9n0dg8a5kgbbsbphftj6, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule TrainableBot > DynSockPuppetConvo {
LS suggestions;
S functions;
transient SingleComponentPanel scpSuggestions;
transient FunctionsLoader loader;
transient Thread playThread;
visual jvsplit(super,
jhsplit(
jCenteredSection("Suggestions", scpSuggestions = singleComponentPanel(renderSuggestions())),
northAndCenterWithMargin(
jrightaligned(jbutton("Load", rThreadEnter loadFunctions)),
dm_textAreaAsSection functions())));
JComponent renderSuggestions() {
ret ele_renderSuggestions(null, suggestions,
sayAction := (IVF1) s -> addPost(s, true),
submitAction := (IVF1) s -> addPost(s, false));
}
void showSuggestions(Cl suggestions) {
setField(suggestions := asList(suggestions));
showSuggestions();
}
void showSuggestions {
scpSuggestions?.setComponent(renderSuggestions());
}
void loadFunctions {
dispose loader;
loader = new FunctionsLoader(tlftj(functions));
loader.onLoaded(r startPlaying);
loader.loadInBackground();
}
void startPlaying enter {
cancelThread(playThread);
playThread = null;
playThread = startThread(rEnter play);
}
void play {
//showSuggestions(ll("test " + now()));
new LinkedHashSet l;
S input = lastInput();
for (S f : loader.functions) {
addIfInstanceOf(l, S, pcallOpt(loader.blob, f));
if (nempty(input))
addIfInstanceOf(l, S, pcallOpt(loader.blob, f, input));
}
showSuggestions(l);
}
}