Made it possible to automaticaly execute commands on startup using startcmd.txt

This commit is contained in:
Juhani Haverinen 2013-07-18 16:31:25 +03:00
parent 78903fb097
commit 3a5966e13d
4 changed files with 10 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
msgs.txt
trusted.txt
startcmd.txt
*.pyc

View File

@ -97,6 +97,8 @@ def parse((line,irc)):
msglock.release()
elif line[3]==':#help':
irc.send('PRIVMSG %s :%s'%(chan,help(' '.join(line[4:]))))
elif line[3]==':#esoteric' and chan=='#esoteric':
irc.send('PRIVMSG %s :Nothing here'%chan)
elif line[3][1:] in ('oonbotti:', 'oonbotti', 'oonbotti,', 'oonbotti2', 'oonbotti2:', 'oonbotti2,'):
irc.send('PRIVMSG %s :%s: %s'%(chan,nick,doctor.respond(' '.join(line[4:]))))
elif line[1]=='NOTICE' and line[0].split('!')[0]==':NickServ' and line[4]=='ACC':

Binary file not shown.

View File

@ -54,7 +54,13 @@ class Connhandler(threading.Thread):
self.send('NICK %s'%self.nick)
self.send('USER %s a a :%s'%(self.nick,self.name))
self.send('JOIN %s'%(self.chan))
f=open('startcmd.txt','r')
for i in f:
if i[-1]=='\n': i=i[:-1]
self.send(i)
f.close()
for i in self.chan.split(' '):
self.send('JOIN %s'%(i))
buf=''
while True: