Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- version = '2.1.5'
- import sys
- import os
- import string
- import random
- import urllib
- import socket
- import time
- import re
- import StringIO
- import getpass
- import shelve
- import traceback
- import csv
- import pickle
- from time import *
- server = 'irc.rizon.net'
- port = 6667
- myname = 'InfoBot'
- identd = 'Bot'
- real_name = "Python IRC Information Bot"
- nickpass = 'YOthisPassIsNotcrackAbleMuhahha'
- channels = '#Aha2Y'
- version = '3.5'
- irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
- irc.connect ( ( server, port) )
- irc.send ( 'NICK %s\r\n' % myname)
- irc.send ( 'USER %s %s %s :%s\r\n' % (identd, identd, identd, real_name))
- # Here we make sure to process the login and stuff correctly
- connected = 1
- while True:
- data = irc.recv ( 4096 )
- raw = data.split()
- print data
- if connected == 3:
- break
- if data.find ( 'PING' ) != -1:
- irc.send( 'PONG ' + data.split() [ 1 ] + '\r\n' )
- if data.find('This nickname is registered and protected.') != -1:
- identify()
- if data.find('End of /MOTD command.') != -1:
- perform()
- def perform():
- irc.send('mode %s +B\r\n' % myname)
- irc.send('mode %s +B\r\n' % myname)
- irc.send('mode %s +B\r\n' % myname)
- irc.send('JOIN %s\r\n' % channels)
- irc.send('JOIN %s\r\n' % channels)
- irc.send('JOIN %s\r\n' % channels)
- connected = connected + 1
- def identify():
- irc.send('privmsg NickServ :Identify %s\r\n' % nickpass)
- irc.send('privmsg NickServ :update\r\n')
- connected = connected + 1
- # We are connected, lets fuck up with the messages to suit us :D
- message_prefix = "!"
- def _processMessage(raw):
- sender = raw[0][1:]
- data = {"nick": sender.split("!")[0], "ident": sender.split(sender.split("!")[1].split("@")[0]),
- "host": sender.split(sender.split("!")[1].split("@")[1]), "type": raw[1], "source": raw[2],
- "command": raw[3][1:]}
- if len(raw) > 3:
- data["args"] = raw[3:]
- return data
- while True:
- data = irc.recv ( 4096 )
- raw = data.split()
- print data
- if data.find ( 'PING' ) != -1:
- irc.send( 'PONG ' + data.split() [ 1 ] + '\r\n' )
- if data.find(":!elitebnc") != -1:
- if len(raw) != 5:
- channel = raw[2]
- checksock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- try:
- checksock.connect(('alpdha.elitebnc.net', 1337))
- checksock.shutdown(2)
- alpha = 'Online!';
- except:
- checksock.shutdown(0)
- alpha = 'Offline!';
- irc.send('notice %s :Alpha: %s\r\n' % (nick, alpha))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement