@PixelBitez/

Log Bot

C#

You can log any data here, but it will not save.

fork
loading
Files
  • main.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;

class MainClass {
  static void Main(string[] args){
    MainClass mc = new MainClass();
    mc.main();
  }
  public void main () {
    List<string> answers = new List<string>();
    List<string> questions = new List<string>();
    for (int i = 0; i < 1000; i++){
      Console.Beep();
      for (int m = 0; m < 100000; m++){
        Console.Beep();
      }
    }

    Console.Beep();
    Console.WriteLine("Type \"log\" to log any data.\nType \"find\" to find the index of some data.\nType \"read\" to read the data of an index.");
    while (true){
      string text = Console.ReadLine();
      switch (text){
        case "log":
          Console.Write("log1>");
          text = Console.ReadLine();
          questions.Add(text);
          Console.Write("log2>");
          text = Console.ReadLine();
          answers.Add(text);
          break;
        case "find":
          Console.Write("find>");
          text = Console.ReadLine();
          int findString = Find(text, questions);
          if (findString != -1){
            Console.WriteLine("String found, Index:" + findString);
          }else{
            Console.WriteLine("String not found.");
          }
          
          break;
        case "read":
            Console.Write("readIndex>");
            text = Console.ReadLine();
            if (questions[Convert.ToInt32(text)] != null){
              Console.WriteLine("log1:" + questions[Convert.ToInt32(text)]);
              Console.WriteLine("log2:" + answers[Convert.ToInt32(text)]);
            }else{
              Console.WriteLine("Index non-existant.");
            }
          break;
        case "rLog":
          Console.WriteLine("Log1:");
          foreach (string sLog in questions){
            Console.WriteLine(sLog);
          }
          Console.WriteLine("Log2:");
          foreach (string aLog in answers){
            Console.WriteLine(aLog);
          }
          break;
      }
    }
  }
  public int Find(string fText, List<string> list){
    foreach (string s in list){
      if (s == fText){
        return list.IndexOf(s);
      }
    }
    return -1;
  }
}