Guest User

Untitled

a guest
Nov 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. public static string[] GetChatData(int position, bool test = false)
  2. {
  3. List<string> chat = new List<string>();
  4. int cr = 0;
  5. for (int i = 0; i < chatdata.Count; i++)
  6. {
  7. if (chatdata[i].Length > 56)
  8. {
  9. string data = chatdata[i].Substring(56);
  10. chat.Add(chatdata[i].Substring(0, 56));
  11. while (data.Length > 0)
  12. {
  13. cr++;
  14. if (data.Length > 52)
  15. {
  16. chat.Add(" " + data.Substring(0, 52));
  17. data = data.Substring(52);
  18. }
  19. else
  20. {
  21. chat.Add(" " + data);
  22. data = "";
  23. }
  24. }
  25. }
  26. * else
  27. {
  28. chat.Add(chatdata[i]);
  29. }
  30. }
  31. List<string> actualChat = new List<string>();
  32. for (int x = 0; x < 10; x++)
  33. {
  34. if (position + x >= chat.Count)
  35. break;
  36. if (position < 0)
  37. position = 0;
  38. actualChat.Add(chat[position + x]);
  39. }
  40. if (test)
  41. {
  42. string[] send = new string[1];
  43. send[0] = Convert.ToString(chat.Count - position);
  44. return send;
  45. }
  46. return actualChat.ToArray();
  47. }
Add Comment
Please, Sign In to add comment