Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'Wojto'
- import socket
- import random
- host = "irc.freenode.net"
- chan = "#sram"
- bnick = "Guwnobot"
- port = 6667
- ircsock = socket.socket()
- ircsock. connect((host, port))
- #guwner
- podmiot = open('podmiot.txt', 'r')
- okolicznik = open('okolicznik.txt', 'r')
- orzeczenie = open('orzeczenie.txt', 'r')
- dopelnienie = open('dopelnienie.txt', 'r')
- przydawka = open('przydawka.txt', 'r')
- linep = random.choice(open('podmiot.txt').readlines())
- lineok = random.choice(open('okolicznik.txt').readlines())
- lineorz = random.choice(open('orzeczenie.txt').readlines())
- linedop = random.choice(open('dopelnienie.txt').readlines())
- lineprz = random.choice(open('przydawka.txt').readlines())
- handle = ircsock.makefile(mode='rw', buffering=8, encoding='utf-8', newline='\r\n')
- print('NICK', bnick, file=handle)
- print('USER', bnick, bnick, bnick, ':'+bnick, file=handle)
- print('JOIN', chan, file=handle)
- for line in handle:
- line = line.strip()
- print(line)
- if 'PING' in line:
- print("PONG :" + line.split(':')[1], file=handle)
- if 'Witam' in line:
- print('PRIVMSG', chan, 'Witam guwno jebane', file=handle)
- if 'Zguwnij' in line:
- print('PRIVMSG', chan, linep.rstrip()+ lineok.rstrip()+ lineorz.rstrip()+ linedop.rstrip()+ lineok.rstrip()+ lineprz.rstrip(), file=handle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement