Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1001088 // Print chat stats and last 10 lines

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2191L/17K/50K).

!747

m {

  static !include #1000774 // CircularFifoBuffer
  
  p {
    long lines = 0, chars = 0;
    CircularFifoBuffer<S> buf = new CircularFifoBuffer<S>(10);
    
    print("Sucking chat...");
    while (true) {
      S s = suckFromChat();
      if (s == "") break;
      ++lines;
      chars += s.length();
      buf.add(s);
    }
    
    print("Chat lines: " + lines + " (total characters w/overhead: " + chars + ")");
    print("Last " + buf.size() + " line(s):");
    print();
    for (S s : buf)
      print("  " + s);
    print();
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001088
Snippet name: Print chat stats and last 10 lines
Eternal ID of this version: #1001088/1
Text MD5: e910911e1522924a926a43bdcf3d6dc8
Transpilation MD5: bbc2291a55dfca85fa5cca766559673d
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-20 18:20:34
Source code size: 574 bytes / 27 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 609 / 634
Referenced in: [show references]