Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //antichat bot in the making
- //
- //essie 2019/6/27
- //Antichat bot to get the last message from a user text chat.
- User_number = Count_chat_numbers.length
- //countes the users messages in a room/gets the message-text class in the room.
- Count_chat_numbers = document.getElementsByClassName('message-text');
- //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.
- Extract_last_chat_message = Count_chat_numbers[Count_chat_numbers .length-1].offsetParent.innerText
- // 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.
- if (Count_chat_numbers.length = "50" AND Extract_last_chat_message == "pizza")
- {
- check_user_number_and_word = "same user and word"
- }
- else
- {
- check_user_number_and_word = "same user and word"
- }
- check_user_number_and_word
- // a test to see IF the user is the same or not/user number.
- Count_chat_numbers_new.length
- if (Count_chat_numbers.length == Count_chat_numbers_new.length)
- {
- check_user_number = "same user"
- }
- else
- {
- check_user_number = "not same user"
- }
- check_user_number
- // 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.
- if (Extract_last_chat_message == "pizza")
- {
- check_word = "word found"
- }
- else
- {
- check_word = "word not found"
- }
- check_word
- //raw without comments
- Count_chat_numbers = document.getElementsByClassName('message-text');
- Extract_last_chat_message = Count_chat_numbers[Count_chat_numbers .length-1].offsetParent.innerText
- if (Extract_last_chat_message == "pizza")
- {
- test = "yes"
- }
- else
- {
- test = "no"
- }
- test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement