Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket #imports module allowing connection to IRC
- import threading #imports module allowing timing functions
- import time
- import random
- phrases = [
- "MrDestructoid BEEP BOOP ATOMICUS MrDestructoid",
- "MrDestructoid THIS MrDestructoid TRACK MrDestructoid IS MrDestructoid ILL MrDestructoid NASTY MrDestructoid",
- "MrDestructoid HEY MrDestructoid ATOMICUS MrDestructoid HOW MrDestructoid ABOUT MrDestructoid SOME MrDestructoid BROTHERMAN MrDestructoid VIEWBOT MrDestructoid",
- "MrDestructoid VIEWBOT #254743 REPORTING IN MrDestructoid"
- ]
- def message(msg):
- irc.send("PRIVMSG " + channel + " :" + msg + "\n")
- #sets variables for connection to twitch chat
- bot_owner = 'Gasolinebased'
- nick = 'fwnaeuifbweoyi'
- channel = '#atomicus'
- server = 'irc.twitch.tv'
- password = 'oauth:891j6yyz3nqg38afw1alxrn58eba07'
- queue = 13 #sets variable for anti-spam queue functionality
- irc = socket.socket()
- irc.connect((server, 6667)) #connects to the server
- #sends variables for connection to twitch chat
- irc.send('PASS ' + password + '\r\n')
- irc.send('USER ' + nick + ' 0 * :' + bot_owner + '\r\n')
- irc.send('NICK ' + nick + '\r\n')
- irc.send('JOIN ' + channel + '\r\n')
- startTime = int(round(time.time() * 1000))
- oldTime = 0
- while True:
- babadata = irc.recv(1204) #gets output from IRC server
- babauser = babadata.split(':')[1]
- babauser = babauser.split('!')[0] #determines the sender of the messages
- print babadata
- currentTime = int(round(time.time() * 1000))
- if babadata.find('MrDestructoid') != -1:
- message("MrDestructoid BEEP BOOP MrDestructoid")
- print currentTime - oldTime
- if currentTime - oldTime > 31000: #to prevet removal from double messaging within 30 sec
- oldTime = currentTime
- message(random.choice(phrases))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement