scope botAppendToMechList_combining. static SS #untransmitted = synchroMap(); static ReliableSingleThread #rst; static int #delay = 2000; svoid botAppendToMechList_combining(S name, S text) { if (emptyAfterTrim(text)) ret; synchronized(untransmitted) { S s = untransmitted.get(name); untransmitted.put(name, appendNewLineIfNempty(s) + text); if (rst == null) rst = rstWithDelay(#delay, r #upload); } rst.trigger(); } svoid #upload() { SS data = cloneAndClearMap(untransmitted); for (S name, text : data) { botAppendToMechList_now(name, text); } } svoid cleanMeUp_botAppendToMechList_combining { while (rst != null && rst.running()) sleep(10); } end scope