SHOW:
|
|
- or go back to the newest paste.
1 | #!/usr/bin/python | |
2 | import socket | |
3 | ||
4 | host1 = 'irc.rizon.net' | |
5 | - | s.connect ( ( host, 6667) ) |
5 | + | host2 = 'irc.hardchats.org' |
6 | ||
7 | - | s.send ( 'USER %s %s %s :%s\r\n' % (nick, ident, host, name)) ; print("Succesfully entered %s" % host) |
7 | + | nick = 'vTox' ; ident = 'vTox' ; name = 'IRC Robot' |
8 | channel = '#vTox' | |
9 | ||
10 | s = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) | |
11 | x = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) | |
12 | s.connect ( ( host1, 6667) ) | |
13 | x.connect ( ( host2, 6667) ) | |
14 | s.send ( 'NICK %s\r\n' % nick) | |
15 | x.send ( 'NICK %s\r\n' % nick) | |
16 | s.send ( 'USER %s %s %s :%s\r\n' % (nick, ident, host1, name)) ; print("Succesfully entered %s" % host1) | |
17 | - | if data.find ( ':@calc' ) != -1: |
17 | + | x.send ( 'USER %s %s %s :%s\r\n' % (nick, ident, host2, name)) ; print("Succesfully entered %s" % host2) |
18 | s.send ( 'JOIN %s\r\n' % channel) ; print("Succesfully joined %s" % channel) | |
19 | x.send ( 'JOIN %s\r\n' % channel) ; print("Succesfully joined %s" % channel) | |
20 | - | s.send('notice %s :Prefix: @calc <numbers> \r\n' % nick) |
20 | + | |
21 | while True: | |
22 | - | s.send('notice %s :%s\r\n' % eval(raw[4])) |
22 | + | |
23 | raw = data.split() | |
24 | print data | |
25 | nick = data.split('!')[0][1:] | |
26 | if data.find ( 'PING' ) != -1: | |
27 | s.send ( 'PONG ' + data.split() [ 1 ] + '\r\n' ) | |
28 | if data.find ( ':$help' ) != -1: | |
29 | channel = raw[2] | |
30 | if len(raw) != 5: | |
31 | s.send('notice %s :[Public] $calc\r\n' % nick) | |
32 | if data.find ( ':$calc' ) != -1: | |
33 | channel = raw[2] | |
34 | if len(raw) != 5: | |
35 | s.send('notice %s :Prefix: $calc <numbers> \r\n' % nick) | |
36 | else: | |
37 | s.send('privmsg %s :%s\r\n' % (raw[2], eval(raw[4]))) |