SHOW:
|
|
- or go back to the newest paste.
1 | #!/usr/bin/python | |
2 | version = '2.1.5' | |
3 | import sys | |
4 | import os | |
5 | import string | |
6 | import random | |
7 | import urllib | |
8 | import socket | |
9 | import time | |
10 | import re | |
11 | import StringIO | |
12 | import getpass | |
13 | import shelve | |
14 | import traceback | |
15 | import csv | |
16 | import pickle | |
17 | from time import * | |
18 | ||
19 | server = 'irc.rizon.net' | |
20 | port = 6667 | |
21 | myname = 'InfoBot' | |
22 | identd = 'Bot' | |
23 | real_name = "Python IRC Information Bot" | |
24 | nickpass = 'YOthisPassIsNotcrackAbleMuhahha' | |
25 | - | connected = 0 |
25 | + | channels = '#Aha2Y' |
26 | version = '3.5' | |
27 | - | try: |
27 | + | |
28 | - | data = irc.recv ( 4096 ) |
28 | + | |
29 | - | raw = data.split() |
29 | + | |
30 | - | print data |
30 | + | |
31 | - | if connected == 2: |
31 | + | |
32 | - | break |
32 | + | |
33 | - | if data.find ( 'PING' ) != -1: |
33 | + | |
34 | - | irc.send( 'PONG ' + data.split() [ 1 ] + '\r\n' ) |
34 | + | connected = 1 |
35 | - | if data.find('This nickname is registered and protected.') != -1: |
35 | + | |
36 | - | identify() |
36 | + | data = irc.recv ( 4096 ) |
37 | - | if data.find('End of /MOTD command.') != -1: |
37 | + | raw = data.split() |
38 | - | perform() |
38 | + | print data |
39 | - | def perform(): |
39 | + | if connected == 3: |
40 | - | irc.send('mode %s +B\r\n' % myname) |
40 | + | break |
41 | - | irc.send('mode %s +B\r\n' % myname) |
41 | + | if data.find ( 'PING' ) != -1: |
42 | - | irc.send('mode %s +B\r\n' % myname) |
42 | + | irc.send( 'PONG ' + data.split() [ 1 ] + '\r\n' ) |
43 | - | irc.send('JOIN %s\r\n' % channels) |
43 | + | if data.find('This nickname is registered and protected.') != -1: |
44 | - | irc.send('JOIN %s\r\n' % channels) |
44 | + | identify() |
45 | - | irc.send('JOIN %s\r\n' % channels) |
45 | + | if data.find('End of /MOTD command.') != -1: |
46 | - | connected = connected + 1 |
46 | + | perform() |
47 | - | def identify(): |
47 | + | def perform(): |
48 | - | irc.send('privmsg NickServ :Identify %s\r\n' % nickpass) |
48 | + | irc.send('mode %s +B\r\n' % myname) |
49 | - | irc.send('privmsg NickServ :update\r\n') |
49 | + | irc.send('mode %s +B\r\n' % myname) |
50 | - | irc.send('JOIN %s\r\n' % channels) |
50 | + | irc.send('mode %s +B\r\n' % myname) |
51 | - | irc.send('JOIN %s\r\n' % channels) |
51 | + | irc.send('JOIN %s\r\n' % channels) |
52 | - | irc.send('mode %s +B\r\n' % myname) |
52 | + | irc.send('JOIN %s\r\n' % channels) |
53 | - | irc.send('mode %s +B\r\n' % myname) |
53 | + | irc.send('JOIN %s\r\n' % channels) |
54 | - | connected = connected + 1 |
54 | + | connected = connected + 1 |
55 | def identify(): | |
56 | irc.send('privmsg NickServ :Identify %s\r\n' % nickpass) | |
57 | irc.send('privmsg NickServ :update\r\n') | |
58 | connected = connected + 1 | |
59 | ||
60 | # We are connected, lets fuck up with the messages to suit us :D | |
61 | message_prefix = "!" | |
62 | ||
63 | def _processMessage(raw): | |
64 | sender = raw[0][1:] | |
65 | data = {"nick": sender.split("!")[0], "ident": sender.split(sender.split("!")[1].split("@")[0]), | |
66 | "host": sender.split(sender.split("!")[1].split("@")[1]), "type": raw[1], "source": raw[2], | |
67 | "command": raw[3][1:]} | |
68 | if len(raw) > 3: | |
69 | - | try: |
69 | + | |
70 | - | data = irc.recv ( 4096 ) |
70 | + | |
71 | - | raw = data.split() |
71 | + | |
72 | - | TargetDict = {} |
72 | + | |
73 | - | print data |
73 | + | data = irc.recv ( 4096 ) |
74 | - | if data.find ( 'PING' ) != -1: |
74 | + | raw = data.split() |
75 | - | irc.send( 'PONG ' + data.split() [ 1 ] + '\r\n' ) |
75 | + | print data |
76 | - | if data.find(":!elitebnc") != -1: |
76 | + | if data.find ( 'PING' ) != -1: |
77 | - | if len(raw) != 5: |
77 | + | irc.send( 'PONG ' + data.split() [ 1 ] + '\r\n' ) |
78 | - | channel = raw[2] |
78 | + | if data.find(":!elitebnc") != -1: |
79 | - | checksock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
79 | + | if len(raw) != 5: |
80 | - | try: |
80 | + | channel = raw[2] |
81 | - | checksock.connect(('alpdha.elitebnc.net', 1337)) |
81 | + | checksock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
82 | - | checksock.shutdown(2) |
82 | + | try: |
83 | - | alpha = 'Online!'; |
83 | + | checksock.connect(('alpdha.elitebnc.net', 1337)) |
84 | - | except: |
84 | + | checksock.shutdown(2) |
85 | - | checksock.shutdown(0) |
85 | + | alpha = 'Online!'; |
86 | - | alpha = 'Offline!'; |
86 | + | except: |
87 | - | irc.send('notice %s :Alpha: %s\r\n' % (nick, alpha)) |
87 | + | checksock.shutdown(0) |
88 | - | except: |
88 | + | alpha = 'Offline!'; |
89 | - | fp = StringIO.StringIO() |
89 | + | irc.send('notice %s :Alpha: %s\r\n' % (nick, alpha)) |