or '!cody f**k off' in data \ or '!cody beat it' in data \ or '!cody gtfo' in data \ and connected == True : if HOST.lower() == '*****@*****.**' \ or HOST.lower() == '*****@*****.**' \ or HOST.lower() == '*****@*****.**' : irc.send ( 'PRIVMSG #code :Fine, whatever\r\n' ) irc.send ( 'QUIT :I never liked you guys anyway\r\n' ) codyAlive = False #!python.problem if '!python.problem' in MESSAGE.lower() \ and connected == True : randomPythonProblem = noRepeatRandom(4) if (randomPythonProblem == 0): irc.send ( 'PRIVMSG #code :Make a guessing game. The computer picks a random number between 1 and 2. The purpose of the game is to guess the number that the computer has picked in as few tries as possible. \r\n' ) elif (randomPythonProblem == 1): irc.send ( 'PRIVMSG #code :Make a math quiz. The computer generates a random multiplication question, and checks whether or not the input the user gives is correct. \r\n') elif (randomPythonProblem == 2): irc.send ( 'PRIVMSG #code :Print the Fibonacci sequence up to 100. c = a + b. \r\n') elif (randomPythonProblem == 3): irc.send ( 'PRIVMSG #code :There are two monkeys. If neither of them are smiling, we have Monkey Trouble. If both of them are smiling, we have Monkey Trouble. If only one of them is smiling, you are the new president and you receive 1 gorillian dollars. Create booleans for these three possibilities, assign random integers, and test whether or not we\'re in Monkey Deep Shit \r\n') elif (randomPythonProblem == 4): irc.send ( 'PRIVMSG #code :Check whether or not a number input by the user between 1 and 100 is a prime number.\r\n')
for quitTrigger in codyQuitTriggers: if 'Cody, '+quitTrigger in data \ and connected == True : if authenticateHost(): irc.send ( 'PRIVMSG '+CHANNEL+' :I guess I don\'t really have a choice\r\n' ) irc.send ( 'QUIT :I never liked you guys anyway\r\n' ) codyAlive = False #!python.problem if '!cody.problem' in MESSAGE.lower() \ and connected == True : irc.send ( 'PRIVMSG '+CHANNEL+' :'+randomPythonProblem[noRepeatRandom(len(randomPythonProblem), 'pythonProblem')] +'\r\n' ) #!cody.join if '!cody.join' in MESSAGE.lower() \ and connected == True \ and authenticateHost(): if len(MESSAGE) > len('!cody.join\r\n') \ and '#' in MESSAGE : irc.send ( 'PRIVMSG '+CHANNEL+' :Joining channel:'+MESSAGE[len('!cody.join'):]+'\r\n') irc.send ( 'JOIN '+MESSAGE[len('!cody.join'):]+'\r\n' ) else: irc.send('PRIVMSG '+CHANNEL+' :Usage: !cody.join [#channel] ' + '\r\n' )
for quitTrigger in codyQuitTriggers: if 'Cody, '+quitTrigger in data \ and connected == True : if authenticateHost(): irc.send('PRIVMSG ' + CHANNEL + ' :I guess I don\'t really have a choice\r\n') irc.send('QUIT :I never liked you guys anyway\r\n') codyAlive = False #!python.problem if '!cody.problem' in MESSAGE.lower() \ and connected == True : irc.send('PRIVMSG ' + CHANNEL + ' :' + randomPythonProblem[noRepeatRandom( len(randomPythonProblem), 'pythonProblem')] + '\r\n') #!cody.join if '!cody.join' in MESSAGE.lower() \ and connected == True \ and authenticateHost(): irc.send('PRIVMSG ' + CHANNEL + ' :Joining channel:' + MESSAGE[len('!cody.join'):] + '\r\n') irc.send('JOIN ' + MESSAGE[len('!cody.join'):] + '\r\n') #!cody.part if '!cody.part' in MESSAGE.lower() \ and connected == True \ and authenticateHost():
MSG_TYPE = parsedMessage[2] CHANNEL = parsedMessage[3] MESSAGE = parsedMessage[4] #QUIT if data.find ( '!cody quit' ) != -1 or data.find ( '!cody f**k off' ) != -1 or data.find ( '!cody beat it' ) != -1 or data.find ( '!cody gtfo' ) != -1 and connected == True: bangPos = data.find('!') reloaderNick = data[1:bangPos] if(NICK == 'lmn' or NICK == 'Inveracity' or NICK == 'Stoy'): irc.send ( 'PRIVMSG #code :Fine, whatever\r\n' ) irc.send ( 'QUIT :I never liked you guys anyway\r\n' ) #!python.problem if '!python.problem' in data.lower() and connected == True: randomPythonProblem = noRepeatRandom(4) if (randomPythonProblem == 0): irc.send ( 'PRIVMSG #code :Make a guessing game. The computer picks a random number between 1 and 2. The purpose of the game is to guess the number that the computer has picked in as few tries as possible. \r\n' ) elif (randomPythonProblem == 1): irc.send ( 'PRIVMSG #code :Make a math quiz. The computer generates a random multiplication question (n1 = randint(1, 10) - n2 = randint(1, 10) -- input("What is %d times %d? " % (n1, n2)), and checks whether ) != -1 or data.find ( not the input the user gives is correct. \r\n') elif (randomPythonProblem == 2): irc.send ( 'PRIVMSG #code :Print the Fibonacci sequence up to 100. c = a + b. \r\n') elif (randomPythonProblem == 3): irc.send ( 'PRIVMSG #code :There are two monkeys. If neither of them are smiling, we have Monkey Trouble. If both of them are smiling, we have Monkey Trouble. If only one of them is smiling, you are the new president and you receive 1 million dollars in prize money. Create booleans for these three possibilities, assign random integers with randint (0, 1), and test whether ) != -1 or data.find ( not we\'re in Monkey Deep Shit \r\n') elif (randomPythonProblem == 4): irc.send ( 'PRIVMSG #code :Check if a number input by the user between 1 and 20 is a prime number ) != -1 or data.find ( not.\r\n')
#QUIT if data.find('!cody quit') != -1 or data.find( '!cody f**k off') != -1 or data.find( '!cody beat it' ) != -1 or data.find('!cody gtfo') != -1 and connected == True: bangPos = data.find('!') reloaderNick = data[1:bangPos] if (NICK == 'lmn' or NICK == 'Inveracity' or NICK == 'Stoy'): irc.send('PRIVMSG #code :Fine, whatever\r\n') irc.send('QUIT :I never liked you guys anyway\r\n') #!python.problem if '!python.problem' in data.lower() and connected == True: randomPythonProblem = noRepeatRandom(4) if (randomPythonProblem == 0): irc.send( 'PRIVMSG #code :Make a guessing game. The computer picks a random number between 1 and 2. The purpose of the game is to guess the number that the computer has picked in as few tries as possible. \r\n' ) elif (randomPythonProblem == 1): irc.send( 'PRIVMSG #code :Make a math quiz. The computer generates a random multiplication question (n1 = randint(1, 10) - n2 = randint(1, 10) -- input("What is %d times %d? " % (n1, n2)), and checks whether ) != -1 or data.find ( not the input the user gives is correct. \r\n' ) elif (randomPythonProblem == 2): irc.send( 'PRIVMSG #code :Print the Fibonacci sequence up to 100. c = a + b. \r\n' )