Advertisement
Guest User

tresing34

a guest
Jun 26th, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //antichat bot in the making
  3. //
  4. //essie 2019/6/27
  5.  
  6.  
  7. //Antichat bot to get the last message from a user text chat.
  8.  
  9. User_number = Count_chat_numbers.length
  10.  
  11. //countes the users messages in a room/gets the message-text class in the room.
  12. Count_chat_numbers = document.getElementsByClassName('message-text');
  13.  
  14. //extracts the numbers of messages and thn extracts the message text about the message-text class/ it gets the text message from the last user that posted anything.
  15. Extract_last_chat_message = Count_chat_numbers[Count_chat_numbers .length-1].offsetParent.innerText
  16.  
  17.  
  18.  
  19. // a test to see IF the message text is equal to the text pizza AND if its a new user so it does not send/loop it self.
  20.  
  21.  
  22. if (Count_chat_numbers.length = "50" AND Extract_last_chat_message == "pizza")
  23. {
  24. check_user_number_and_word = "same user and word"
  25. }
  26. else
  27. {
  28. check_user_number_and_word = "same user and word"
  29. }
  30.  
  31. check_user_number_and_word
  32.  
  33. // a test to see IF the user is the same or not/user number.
  34.  
  35. Count_chat_numbers_new.length
  36.  
  37. if (Count_chat_numbers.length == Count_chat_numbers_new.length)
  38. {
  39. check_user_number = "same user"
  40. }
  41. else
  42. {
  43. check_user_number = "not same user"
  44. }
  45.  
  46. check_user_number
  47.  
  48.  
  49. // a test to see IF the message text is equal to the text pizza then make the test variable equal to yes else no and then shows the test variable.
  50. if (Extract_last_chat_message == "pizza")
  51. {
  52. check_word = "word found"
  53. }
  54. else
  55. {
  56. check_word = "word not found"
  57. }
  58.  
  59. check_word
  60.  
  61. //raw without comments
  62.  
  63. Count_chat_numbers = document.getElementsByClassName('message-text');
  64. Extract_last_chat_message = Count_chat_numbers[Count_chat_numbers .length-1].offsetParent.innerText
  65.  
  66. if (Extract_last_chat_message == "pizza")
  67. {
  68. test = "yes"
  69. }
  70. else
  71. {
  72. test = "no"
  73. }
  74.  
  75. test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement